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.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)13.8%top 3.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

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

EcosystemPackageFixed inAdvisory
Debian:12node-moment2.29.2+ds-1DEBIAN-CVE-2022-24785
Debian:13node-moment2.29.2+ds-1DEBIAN-CVE-2022-24785
Debian:14node-moment2.29.2+ds-1DEBIAN-CVE-2022-24785
NuGetmoment.js2.29.2GHSA-8hfj-j24r-96c4
Ubuntu:22.04:LTSnode-moment2.29.1+ds-3ubuntu0.2USN-5559-1
Ubuntu:22.04:LTSnode-moment2.29.1+ds-3ubuntu0.2UBUNTU-CVE-2022-24785
npmmoment2.29.2GHSA-8hfj-j24r-96c4

Affected products (as reported)

VendorProductVersions
moment moment >= 1.0.1, < 2.29.2

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