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](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 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()`.
beschreibt (1)
Zugehörige CVEs.
| ID | Schweregrad | ausnutzbar | ||
|---|---|---|---|---|
| CVE-2026-17495US | — | — | ||
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… | ||||
Referenzen
Externe Belege — Patches, Meldungen, Analysen.
- https://cna.openjsf.org/security-advisories.htmlWEB
- https://github.com/moment/momentPACKAGE
- https://github.com/moment/moment/commit/5f7d983c9881e65e07574de9dda3190d99520c07WEB
- https://github.com/moment/moment/pull/6386WEB
- https://github.com/moment/moment/releases/tag/2.31.0WEB
- https://github.com/moment/moment/security/advisories/GHSA-4p3w-j4w9-5jqwWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-17495ADVISORY
Advisories wie diese benennen die exponierten Produkte, die Angreifer auf Ihrer Angriffsfläche ins Visier nehmen. Sehen Sie mit einem kostenlosen Passiv-Scan, was exponiert ist.
Kostenloser Scan