CVE-2022-24785
HIGH 7.5CVSS 3.1Path Traversal: 'dir/../../filename' in moment.locale
Moment.js is a JavaScript date library for parsing, validating, manipulating, and formatting dates. A path traversal vulnerability impacts npm (server) users of Moment.js between versions 1.0.1 and 2.29.1, especially if a user-provided locale string is directly used to switch moment locale. This problem is patched in 2.29.2, and the patch can be applied to all affected versions. As a workaround, sanitize the user-provided locale name before passing it to Moment.js.
- Published
- 4 Apr 2022
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-22CWE-27
- Also known as
- GHSA-8hfj-j24r-96c4
- Sources
- NVDJSONOSV GHSA-8hfj-j24r-96c4JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 5.0 | AV:N/AC:L/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | momentjs | momentcpe:2.3:a:momentjs:moment:*:*:*:*:*:node.js:*:* |
>= 1.0.1, < 2.29.2 | 2.29.2 |
| NVD | momentjs | momentcpe:2.3:a:momentjs:moment:*:*:*:*:*:nuget:*:* |
>= 1.0.1, < 2.29.2 | 2.29.2 |
| NVD | tenable | tenable.sccpe:2.3:a:tenable:tenable.sc:*:*:*:*:*:*:*:* |
< 5.21.0 | 5.21.0 |
| NVD | netapp | active_iqcpe:2.3:a:netapp:active_iq:-:*:*:*:*:*:*:* |
(no version) | |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* |
= 35 | |
| NVD | fedoraproject | fedoracpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* |
= 36 | |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* |
= 10.0 | |
| OSV | npm | moment | < 2.29.2 | 2.29.2 |
| OSV | NuGet | Moment.js | < 2.29.2 | 2.29.2 |
References
- https://github.com/moment/moment/commit/4211bfc8f15746be4019bba557e29a7ba83d54c5 · Patch, WEB
- https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4 · Vendor Advisory, WEB
- https://lists.debian.org/debian-lts-announce/2023/01/msg00035.html · Mailing List, Third Party Advisory, WEB
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6QIO6YNLTK2T7SPKDS4JEL45FANLNC2Q/ · WEB
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5/ · WEB
- https://security.netapp.com/advisory/ntap-20220513-0006/ · Third Party Advisory, WEB
- https://www.tenable.com/security/tns-2022-09 · Patch, Release Notes, Third Party Advisory, WEB
- https://security.netapp.com/advisory/ntap-20241108-0002/ · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-24785 · ADVISORY
- https://github.com/moment/moment · PACKAGE
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6QIO6YNLTK2T7SPKDS4JEL45FANLNC2Q · WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5 · WEB
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 4 Apr 2022)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 4 Apr 2022)