NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-17495: moment vulnerable to Path Traversal via crafted non-string locale name

mediumCVSS 3.1 5.9GHSA-4p3w-j4w9-5jqw

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.

Published Sep 29, 2026

Affected packages

moment

Ecosystem
npm
Affected
>= 2.29.2, < 2.31.0
Fixed in
2.31.0
Check
npm ls moment

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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().

Credited to zolbooo, UlisesGascon, gilmoreorless, mattjohnsonpint.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology