CVE-2022-24785
JSON

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 packageVersionsReported by
moment moment>= 1.0.1, < 2.29.2CVE List
moment (npm)before 2.29.2GitHub Advisory Database
Moment.js (NuGet)before 2.29.2GitHub Advisory Database
momentjs momentfrom 1.0.1 before 2.29.2NVD
tenable tenable.scbefore 5.21.0NVD
netapp active_iqNot specifiedNVD
fedoraproject fedora35, 36NVD
debian debian_linux10.0NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:P/A:N

Classification

CWE-22CWE-27

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

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:

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

https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4vendor-advisory, web
https://github.com/moment/moment/commit/4211bfc8f15746be4019bba557e29a7ba83d54c5patch, web
https://www.tenable.com/security/tns-2022-09patch, release-notes, third-party-advisory, web
https://security.netapp.com/advisory/ntap-20220513-0006/third-party-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6QIO6YNLTK2T7SPKDS4JEL45FANLNC2Q/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5/vendor-advisory
https://lists.debian.org/debian-lts-announce/2023/01/msg00035.htmlmailing-list, third-party-advisory, web
https://security.netapp.com/advisory/ntap-20241108-0002/
https://nvd.nist.gov/vuln/detail/CVE-2022-24785advisory
https://github.com/moment/momentpackage
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6QIO6YNLTK2T7SPKDS4JEL45FANLNC2Qweb
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5web

Sources

SourceRecordLicence
CVE ListCVE-2022-24785 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-8hfj-j24r-96c4 changed 2026-09-10CC-BY-4.0
NVDCVE-2022-24785 changed 2026-06-17Public domain