Path Traversal in Moment.js
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.
- Published
- Apr 4, 2022
- Updated
- Jun 17, 2026
- EPSS
- 13.9% · 96th percentile
- CWE
- CWE-22
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
34
Monitor
Low priority for now.
- CVSS
- 30 / 40 · 7.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 4 / 30 · 13.9%
CISA SSVC decision
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 7.5
- CNA · GitHub_M
- 7.5
- agree
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpAffected systems
| Vendor | Product | CPE |
|---|---|---|
| momentjs | moment | cpe:2.3:a:momentjs:moment |
| tenable | tenable.sc | cpe:2.3:a:tenable:tenable.sc |
| netapp | active iq | cpe:2.3:a:netapp:active_iq |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- debian debian linux10.0
- fedoraproject fedora35
- fedoraproject fedora36
- momentjs moment1.0.1 and later · before 2.29.2
- netapp active iqall versions
- tenable tenable.scbefore 5.21.0
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
moment moment
- >= 1.0.1, < 2.29.2affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:10 | node-moment | before 2.24.0+ds-1+deb10u1 | 2.24.0+ds-1+deb10u1 |
| Debian:12 | node-moment | before 2.29.2+ds-1 | 2.29.2+ds-1 |
| npm | moment | before 2.29.2 | 2.29.2 |
| npm | moment | before 2.29.2 | 2.29.2 |
| NuGet | Moment.js | before 2.29.2 | 2.29.2 |
| Red Hat:ceph_storage:5.3::el8 | ceph | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-base | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-base-debuginfo | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-common | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-common-debuginfo | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-debugsource | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-fuse | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-fuse-debuginfo | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-grafana-dashboards | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-immutable-object-cache | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-immutable-object-cache-debuginfo | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mds | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mds-debuginfo | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mgr | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mgr-cephadm | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mgr-dashboard | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mgr-debuginfo | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mgr-diskprediction-local | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
| Red Hat:ceph_storage:5.3::el8 | ceph-mgr-k8sevents | before 2:16.2.10-94.el8cp | 2:16.2.10-94.el8cp |
+96
Same product
momentjs: all recordsOther highest-scoring records for the same primary product.
- CVE-2022-31129Inefficient Regular Expression Complexity in moment32Monitor
- CVE-2017-18214The moment module before 2.19.3 for Node.js is prone to a regular expression denial of service via a crafted date string, a different vulner31Monitor
- CVE-2016-4055The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption)29Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| moment moment | 2.29.2 · description | Vendor (CNA) |
| debian:node-moment | 2.29.2+ds-1 · Debian:12 | Package registry (OSV) |
| npm:moment | 2.29.2 | Package registry (OSV) |
| NuGet:Moment.js | 2.29.2 | Package registry (OSV) |
| red hat:eap7-jackson-databind | 0:2.12.6.1-1.redhat_00003.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-all | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-buffer | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec-dns | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec-haproxy | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec-http | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec-http2 | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec-memcache | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec-mqtt | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
| red hat:eap7-netty-codec-redis | 0:4.1.72-4.Final_redhat_00001.1.el7eap · Red Hat:jboss_enterprise_application_platform:7.4::el7 | Package registry (OSV) |
Exploit status
Proof of concept available
A public proof of concept or detection signature exists. Exploit knowledge is out there; don't delay patching.
Evidence
- Proof-of-concept repository on GitHub ×1
Noroxi does not host or link to exploit code. Metasploit module names and Nuclei template ids are shown (names, not code); Exploit-DB entries and PoC repositories are given as counts only.
| Source | Kind | Date |
|---|---|---|
| Proof-of-concept repository on GitHub | stars:1 | 2023-05-29 |
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
- Published
- First PoC+419 d
- TodayOct 10, 2026+1650 d
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
The product’s vendor appears in a public program. Matched by name; verify the scope text in the program.
National notice (Türkiye Cybersecurity Directorate / USOM)
Official security notices citing this record; remediation advice is on the agency's page.
- TR-22-0594 · Sep 7, 2022(IBM Güvenlik Zafiyeti)
- TR-22-0544 · Aug 11, 2022(Ubuntu Güvenlik Güncellemesi)
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- high · data or configuration can be modified
- Availability
- none
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- High
- Availability impact
- None
Weakness class (CWE)
CWE-22 · Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
nvd-primary
Root cause
A user-supplied file name is joined with the allowed directory, but the result is never checked to confirm it is still inside that directory.
The bug in code
The whole CWE-22 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const file = path.join(ROOT, req.query.name);res.sendFile(file);Fixed
const file = path.resolve(ROOT, req.query.name);if (!file.startsWith(ROOT + path.sep)) { return res.sendStatus(400);}res.sendFile(file);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Path TraversalCAPEC-126likelihood: High · Very High
- Using Slashes and URL Encoding Combined to Bypass Validation LogicCAPEC-64likelihood: High · High
- Manipulating Web Input to File System CallsCAPEC-76likelihood: High · Very High
- Using Escaped Slashes in Alternate EncodingCAPEC-78likelihood: High · High
- Using Slashes in Alternate EncodingCAPEC-79likelihood: High · High
ATT&CK techniques
—
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- github.com/moment/moment/commit/4211bfc8f15746be4019bba557e29a7ba83d54c5
- github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4
- lists.debian.org/debian-lts-announce/2023/01/msg00035.html
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6QIO6YNLTK2T7SPKDS4JEL45FANLNC2Q/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5/
- security.netapp.com/advisory/ntap-20220513-0006/
- www.tenable.com/security/tns-2022-09
- security.netapp.com/advisory/ntap-20241108-0002/
Vendor advisories and official records. Exploit/PoC links are deliberately left out.