CVE-2022-24785
published high CVSS 3.1 · 7.5Path Traversal in Moment.js
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| moment | — | moment>= 1.0.1, < 2.29.2 | Affected | Not stated | GitHub_M |
| Debian | buster | node-moment | Advisory build | 2.24.0+ds-1+deb10u1 | DLA-3295-1 |
| Ubuntu | bionic | libjs-moment | Advisory build | 2.20.1+ds-1ubuntu0.1 | USN-5559-1 |
| Ubuntu | bionic | node-moment | Advisory build | 2.20.1+ds-1ubuntu0.1 | USN-5559-1 |
| Ubuntu | focal | libjs-moment | Advisory build | 2.24.0+ds-2ubuntu0.1 | USN-5559-1 |
| Ubuntu | focal | node-moment | Advisory build | 2.24.0+ds-2ubuntu0.1 | USN-5559-1 |
| Ubuntu | jammy | libjs-moment | Advisory build | 2.29.1+ds-3ubuntu0.2 | USN-5559-1 |
| Ubuntu | jammy | node-moment | Advisory build | 2.29.1+ds-3ubuntu0.2 | USN-5559-1 |
Show 2 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | xenial | libjs-moment | Advisory build | 2.11.0+ds-1ubuntu0.1~esm2 | USN-9117-1 |
| Ubuntu | xenial | node-moment | Advisory build | 2.11.0+ds-1ubuntu0.1~esm2 | USN-9117-1 |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| moment | moment | >= 1.0.1, < 2.29.2 (affected) | GitHub_M · cna |
Weaknesses
2- CWE-22 CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
- CWE-27 CWE-27: Path Traversal: 'dir/../../filename'
References
8- https://github.com/moment/moment/commit/4211bfc8f15746be4019bba557e29a7ba83d54c5
- https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4
- [debian-lts-announce] 20230130 [SECURITY] [DLA 3295-1] node-moment security update https://lists.debian.org/debian-lts-announce/2023/01/msg00035.html
- FEDORA-2022-85aa8e5706 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6QIO6YNLTK2T7SPKDS4JEL45FANLNC2Q/
- FEDORA-2022-35b698150c https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5/
- https://security.netapp.com/advisory/ntap-20220513-0006/
- https://security.netapp.com/advisory/ntap-20241108-0002/
- https://www.tenable.com/security/tns-2022-09
Provider assertions
3GitHub_M · cna
Path Traversal in Moment.js
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 35eee1c8897e8c86c15f414997cf78e558d546e0bae7f29ada3cc447f7dade83
- Ingested
- 23 Sep 2026, 07:58:57 UTC
- Source record
- Official CVE record