MODERATE 5.9

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)

ArtifactAffected versionsFixed 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

3affected artifacts
13affected versions
174dependent artifacts (est.)
12,318dependent versions

40% of the dependent artifacts (71) still pull an affected version in their latest release.

DepthDependent 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

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