Vulnerability · Published Apr 4, 2022 · Assigned by GitHub_M
CVE-2022-24785Path Traversal in Moment.js
High 7.5
In plain English
A high-severity path traversal in moment from moment. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 13.8% (higher than 97% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-moment | 2.29.2+ds-1 | DEBIAN-CVE-2022-24785 |
| Debian:13 | node-moment | 2.29.2+ds-1 | DEBIAN-CVE-2022-24785 |
| Debian:14 | node-moment | 2.29.2+ds-1 | DEBIAN-CVE-2022-24785 |
| NuGet | moment.js | 2.29.2 | GHSA-8hfj-j24r-96c4 |
| Ubuntu:22.04:LTS | node-moment | 2.29.1+ds-3ubuntu0.2 | USN-5559-1 |
| Ubuntu:22.04:LTS | node-moment | 2.29.1+ds-3ubuntu0.2 | UBUNTU-CVE-2022-24785 |
| npm | moment | 2.29.2 | GHSA-8hfj-j24r-96c4 |
Affected products (as reported)
Weakness: CWE-22, CWE-27 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
References
- https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4
- https://github.com/moment/moment/commit/4211bfc8f15746be4019bba557e29a7ba83d54c5
- https://www.tenable.com/security/tns-2022-09
- https://security.netapp.com/advisory/ntap-20220513-0006/
- FEDORA-2022-85aa8e5706 vendor-advisory
- FEDORA-2022-35b698150c vendor-advisory
- [debian-lts-announce] 20230130 [SECURITY] [DLA 3295-1] node-moment security update mailing-list
- https://security.netapp.com/advisory/ntap-20241108-0002/