Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

moment vulnerable to Path Traversal via crafted non-string locale nameGHSA-4p3w-j4w9-5jqw

MEDIUMFix: moment/moment#6386

GHSA-4p3w-j4w9-5jqw 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.

Also known asCVE-2026-17495
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

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 GHSA-4p3w-j4w9-5jqw.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs28th percentile — riskier than 28% of all scored CVEsHighest risk
0.00%0.29%0.57%0.86%0.4%0.4%Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

GHSA-4p3w-j4w9-5jqw 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

1 pkg affected

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.

71Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
momentnpm
22.6Mdownloads / week

Description

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

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmmoment≥ 2.29.2&&< 2.31.02.31.0npm install moment@2.31.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    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.

  2. Fix

    Update moment to 2.31.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4p3w-j4w9-5jqw is resolved across your whole dependency graph.

  3. Workarounds

    Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.

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.

Red HatModerate

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…

Workaround published by Red Hat
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 GHSA-4p3w-j4w9-5jqw (CC BY 4.0)

Frequently Asked Questions

### Impact moment before 2.31.0 is vulnerable to path traversal in `moment.locale()`. When an application passes a non-string, attacker-influenced value to `moment.locale()`, a specially crafted object can bypass the locale name validation and cause moment to load a file from an attacker-controlled path. This is a further bypass of the validation added in 2.29.2 for [CVE-2022-24785](https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4). This affects server-side (npm) users only. Plain string input is not affected: the existing validation correctly rejects strings that con
O3 Security · Impact-Aware SCA

Is GHSA-4p3w-j4w9-5jqw in your dependencies?

Find it across npm, including transitive dependencies.

moment vulnerable to Path Traversal via crafted…