Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. moment
  4. ›
  5. CVE-2026-17495

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

September 29, 2026

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.

References

  • cna.openjsf.org/security-advisories.html
  • github.com/advisories/GHSA-4p3w-j4w9-5jqw
  • github.com/moment/moment/commit/5f7d983c9881e65e07574de9dda3190d99520c07
  • github.com/moment/moment/pull/6386
  • github.com/moment/moment/releases/tag/2.31.0
  • github.com/moment/moment/security/advisories/GHSA-4p3w-j4w9-5jqw
  • nvd.nist.gov/vuln/detail/CVE-2026-17495

Code Behaviors & Features

Detect and mitigate CVE-2026-17495 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.29.2 before 2.31.0

Fixed versions

  • 2.31.0

Solution

Upgrade to version 2.31.0 or above.

Impact 5.9 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-27: Path Traversal: 'dir/../../filename'

Source file

npm/moment/CVE-2026-17495.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Mon, 12 Oct 2026 12:17:17 +0000.