CVE-2026-17495
moment vulnerable to Path Traversal via crafted non-string locale name
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().
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.9
moment vulnerable to Path Traversal via crafted non-string locale name
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().
- Record
CVE-2026-17495- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-27
- Updated
- 2026-11-02
EUVDEUVD-2026-78277
5.9
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().
- Record
EUVD-2026-78277- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-4p3w-j4w9-5jqw
5.9
moment vulnerable to Path Traversal via crafted non-string locale name
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.
This affects server-side (npm) users only. Plain string input is not affected: the existing validation correctly rejects strings that contain path separators.
Patches
This issue is patched in moment 2.31.0.
Workarounds
Validate that any user-supplied input is a string before passing it to moment.locale().
- Record
GHSA-4p3w-j4w9-5jqw- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-27
- Updated
- 2026-11-02
NVD
5.9
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().
- Record
CVE-2026-17495- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-27
- Updated
- 2026-11-02
OSV
5.9
moment vulnerable to Path Traversal via crafted non-string locale name
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().
- Record
CVE-2026-17495- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-27
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-17495
5.9
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().
- Record
DEBIAN-CVE-2026-17495- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVGHSA-4p3w-j4w9-5jqw
5.9
moment vulnerable to Path Traversal via crafted non-string locale name
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.
This affects server-side (npm) users only. Plain string input is not affected: the existing validation correctly rejects strings that contain path separators.
Patches
This issue is patched in moment 2.31.0.
Workarounds
Validate that any user-supplied input is a string before passing it to moment.locale().
- Record
GHSA-4p3w-j4w9-5jqw- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-27
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-17495
5.9
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().
- Record
UBUNTU-CVE-2026-17495- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVCLSA-2026-1793190763 No score
TuxCare security update for moment (1 CVE)
TuxCare rebuilt moment to address 1 CVE. Fixed in 2.30.1-tuxcare.1.
- Record
CLSA-2026-1793190763- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
momentnpm |
2.29.2 up to 2.31.0 | 2.31.0 |
momentTuxCare:npm |
2.30.1-tuxcare.0 up to 2.30.1-tuxcare.1, plus listed versions 2.30.1 |
2.30.1-tuxcare.1 |
node-momentDebian:12 |
All versions, plus listed versions 2.29.4+ds-12.30.1+ds-12.30.1+ds1-12.30.1+ds1-22.30.1+ds1-32.31.0+ds1-1 |
None known |
node-momentDebian:13 |
All versions, plus listed versions 2.29.4+ds-12.30.1+ds-12.30.1+ds1-12.30.1+ds1-22.30.1+ds1-32.31.0+ds1-1 |
None known |
node-momentDebian:14 |
before 2.31.0+ds1-1, plus listed versions 2.29.4+ds-12.30.1+ds-12.30.1+ds1-12.30.1+ds1-22.30.1+ds1-3 |
2.31.0+ds1-1 |
node-momentUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 2.10.6+dfsg-12.11.0+ds-12.11.0+ds-1ubuntu0.1~esm1 |
None known |
node-momentUbuntu:18.04:LTS |
All versions, plus listed versions 2.18.1+ds-12.19.1+ds-12.19.2+ds-12.19.3+ds-12.19.4+ds-12.20.1+ds-12.20.1+ds-1ubuntu0.1 |
None known |
node-momentUbuntu:20.04:LTS |
All versions, plus listed versions 2.24.0+ds-12.24.0+ds-22.24.0+ds-2ubuntu0.1 |
None known |
node-momentUbuntu:22.04:LTS |
All versions, plus listed versions 2.29.1+ds-22.29.1+ds-32.29.1+ds-3ubuntu0.2 |
None known |
python-xstatic-momentUbuntu:22.04:LTS |
All versions, plus listed versions 2.8.4.2-2 |
None known |
Show 6 moreShow less
| Package | Affected | Fixed |
|---|---|---|
node-momentUbuntu:24.04:LTS |
All versions, plus listed versions 2.29.4+ds-1 |
None known |
python-xstatic-momentUbuntu:24.04:LTS |
All versions, plus listed versions 2.8.4.2-3 |
None known |
node-momentUbuntu:26.10 |
All versions, plus listed versions 2.30.1+ds-12.30.1+ds1-3 |
None known |
python-xstatic-momentUbuntu:26.10 |
All versions, plus listed versions 2.8.4.2-6 |
None known |
node-momentUbuntu:26.04:LTS |
All versions, plus listed versions 2.29.4+ds-12.30.1+ds-1 |
None known |
python-xstatic-momentUbuntu:26.04:LTS |
All versions, plus listed versions 2.8.4.2-42.8.4.2-6 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-17495 is a medium vulnerability (CVSS 5.9) in Moment, published September 15, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.52%, the 44th percentile. Fixed in moment 2.31.0.