CVE-2026-17495 is a medium-severity (CVSS 5.9) CWE-27 vulnerability in moment. A fix is available for moment — see the affected versions and patch details below.
moment vulnerable to Path Traversal via crafted non-string locale name
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-17495.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-17495 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
momentnpmDescription
moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. In versions 2.29.2 through 2.30.1, a specially crafted non-string object passed to moment.locale() can bypass the locale-name path-traversal guard. The guard assumes the input is a string, so an object whose match() method satisfies the check while its toString() returns a traversal path reaches an internal require() call with attacker-controlled path segments. This is an incomplete fix for CVE-2022-24785 and primarily affects npm (server-side) users that pass user-provided input directly to moment.locale(). The issue is fixed in moment 2.31.0, and users should upgrade to 2.31.0 or later. As a workaround, validate that any user-supplied input is a string before passing it to moment.locale().
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | moment | ≥ 2.29.2&&< 2.31.0 | 2.31.0npm install moment@2.31.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for moment, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update moment to 2.31.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-17495 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Moderate: A path traversal vulnerability exists in the `moment` JavaScript library when specially crafted non-string input is passed to the `moment.locale()` function. This flaw could allow an attacker to access or create files outside of intended directories on systems where user-provided input is directly used by…
To mitigate this issue, implement strict input validation to ensure that all user-supplied data passed to the `moment.locale()` function is a string. This operational control prevents the processing of crafted non-string objects that could lead to path traversal.Source: Red Hat security advisory for CVE-2026-17495 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2026-17495 in your dependencies?
Find it across npm, including transitive dependencies.