High

Path Traversal: 'dir/../../filename' in moment.locale

  • Disclosed: 04.04.2022
  • Updated: 11.10.2026 11:23

Impact

This vulnerability impacts npm (server) users of moment.js, especially if user provided locale string, eg fr is directly used to switch moment locale.

Patches

This problem is patched in 2.29.2, and the patch can be applied to all affected versions (from 1.0.1 up until 2.29.1, inclusive).

Workarounds

Sanitize user-provided locale name before passing it to moment.js.

References

Are there any links users can visit to find out more?

For more information

If you have any questions or comments about this advisory:

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package moment < 2.29.2 2.29.2
.NET (NuGet) Moment.js < 2.29.2 2.29.2

References

CVSS score 7.5/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weakness (CWE)
CWE-22, CWE-27
Platform
npm, .NET (NuGet)
Package
moment, Moment.js
Disclosed
04.04.2022
Updated
11.10.2026 11:23

Sources and licenses

OSV / GitHub Advisory Database - GHSA-8hfj-j24r-96c4 - CC BY 4.0

Vulnerability history: moment

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
5
First → latest
10.2017 09.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 3
  • Medium 2

Disclosures per year

  1. 2017: 1
  2. 2018: 1
  3. 2019: 0
  4. 2020: 0
  5. 2021: 0
  6. 2022: 2
  7. 2023: 0
  8. 2024: 0
  9. 2025: 0
  10. 2026: 1
  1. Medium · 5.9 CVE-2026-17495 >= 2.29.2, < 2.31.0 2.31.0
  2. High · 7.5 CVE-2022-31129 >= 2.18.0, < 2.29.4 2.29.4
  3. Path Traversal: 'dir/../../filename' in moment.locale this entry
    High · 7.5 CVE-2022-24785 < 2.29.2 2.29.2
  4. High · 7.5 CVE-2017-18214 < 2.19.3 2.19.3
  5. Medium · 6.5 CVE-2016-4055 < 2.11.2 2.11.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.