CVE-2026-17495
moment vulnerable to Path Traversal via crafted non-string locale name
Description
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().
Affected Maven artifacts (3)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » momentvia npm moment | >= 2.29.2, < 2.31.0 | 2.31.0 |
| org.webjars » momentjsvia npm moment | >= 2.29.2, < 2.31.0 | 2.31.0 |
| org.webjars.npm » momentvia npm moment | >= 2.29.2, < 2.31.0 | 2.31.0 |
Blast radius
40% of the dependent artifacts (71) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 502 |
| 2 hops | 1,496 |
| 3 hops | 2,567 |
| 4 hops | 5,808 |
| 5 hops | 1,167 |
| 6 hops | 778 |
Most used dependents
- org.xwiki.platform » xwiki-platform-test-docker101 usages
- org.xwiki.platform » xwiki-platform-panels-ui62 usages
- de.agilecoders.wicket » wicket-bootstrap-extensions59 usages
- com.googlecode.wicket-jquery-ui » wicket-kendo-ui50 usages
- com.googlecode.wicket-jquery-ui » wicket-jquery-ui38 usages
- org.apache.isis.viewer » isis-viewer-wicket-ui32 usages
- org.xwiki.platform » xwiki-platform-appwithinminutes-ui31 usages
- org.xwiki.platform » xwiki-platform-livedata-macro26 usages
- com.googlecode.wicket-jquery-ui » wicket-jquery-ui-core26 usages
- org.wicketstuff » wicketstuff-kendo-ui20 usages
- org.xwiki.platform » xwiki-platform-mail-ui19 usages
- org.xwiki.platform » xwiki-platform-index-ui16 usages
- org.xwiki.platform » xwiki-platform-user-profile-ui14 usages
- org.xwiki.platform » xwiki-platform-notifications-ui13 usages
- org.xwiki.platform » xwiki-platform-xclass-ui13 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2026-17495 | nvd.nist.gov |
| Package | moment/moment | github.com |
| Web | moment/moment advisory GHSA-4p3w-j4w9-5jqw | github.com |
| Web | moment/moment pull request #6386 | github.com |
| Web | moment/moment commit 5f7d983 | github.com |
| Web | security-advisories.html | cna.openjsf.org |
| Web | moment/moment release 2.31.0 | github.com |
