7.5high
Path Traversal in Moment.js
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 5.44% (higher than 92% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-8hfj-j24r-96c4
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
| Product or package | Versions | Reported by |
|---|---|---|
| moment moment | >= 1.0.1, < 2.29.2 | CVE List |
| moment (npm) | before 2.29.2 | GitHub Advisory Database |
| Moment.js (NuGet) | before 2.29.2 | GitHub Advisory Database |
| momentjs moment | from 1.0.1 before 2.29.2 | NVD |
| tenable tenable.sc | before 5.21.0 | NVD |
| netapp active_iq | Not specified | NVD |
| fedoraproject fedora | 35, 36 | NVD |
| debian debian_linux | 10.0 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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
NVD (es)
Moment.js es una librería de fechas en JavaScript para analizar, comprobar, manipular y formatear fechas. Una vulnerabilidad de salto de ruta afecta a usuarios de npm (servidor) de Moment.js entre las versiones 1.0.1 y 2.29.1, especialmente si es usada directamente una cadena de configuración regional proporcionada por el usuario para cambiar la configuración regional de Moment. Este problema está parcheado en la versión 2.29.2, y el parche puede aplicarse a todas las versiones afectadas. Como medida de mitigación, sanee el nombre de la configuración regional proporcionada por el usuario antes de pasarlo a Moment.js
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-24785 changed 2025-11-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8hfj-j24r-96c4 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2022-24785 changed 2026-06-17 | Public domain |