Loading...
Skip to main content

CVE-2022-24785 — Path Traversal: 'dir/../../filename' in moment —...

HIGH

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

Published April 4, 2022Updated September 10, 2026Source: osv

Summary

### 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: * Open an issue in [moment repo](https://github.com/moment/moment)

Advisory Timeline

  • First published April 4, 2022 (1652 days ago).
  • Last revised September 10, 2026 — 1619 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update moment to 2.29.2 or later
npm install moment@2.29.2
NuGet
Update Moment.js to 2.29.2 or later
dotnet add package Moment.js --version 2.29.2

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 2 ecosystems: npm (1), nuget (1).

PackageEcosystemAffectedFixed In
moment
npm
All versions2.29.2
Moment.js
nuget
1.2.0, 1.3.0, 1.4.0, 1.5.0 (+68 more)2.29.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Frequently Asked Questions

What is CVE-2022-24785?
Path Traversal: 'dir/../../filename' in moment.locale This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2022-24785?
CVE-2022-24785 affects moment and Moment.js. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-24785 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-8hfj-j24r-96c4

Related CVEs

  • CVE-2026-107375
    HIGH

    JHipster: SQL Injection in the Parameter of JHipster-Generated Reactive (WebFlux + R2DBC) Applicationssort

  • CVE-2026-107384
    HIGH

    MariaDB Connector/Node.js: SQL injection through object keys in SET expansion (permitSetMultiParamEntries)

  • CVE-2022-31129
    HIGH

    Moment.js vulnerable to Inefficient Regular Expression Complexity

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies