{"id":"CVE-2026-17495","state":"PUBLISHED","title":"moment vulnerable to Path Traversal via crafted non-string locale name","description":"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 moment.locale() can bypass the locale-name path-traversal guard. The guard assumes the input is a string, so an object whose match() method satisfies the check while its toString() returns a traversal path reaches an internal require() call with attacker-controlled path segments. This is an incomplete fix for CVE-2022-24785 and primarily affects npm (server-side) users that pass user-provided input directly to moment.locale(). The issue is fixed in moment 2.31.0, and users should upgrade to 2.31.0 or later. As a workaround, validate that any user-supplied input is a string before passing it to moment.locale().","publishedAt":"2026-09-15T05:40:55.263Z","updatedAt":"2026-09-15T17:49:57.391Z","severity":{"score":5.9,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"openjs"},"assigner":"openjs","products":["moment moment"],"affected":[{"vendor":"moment","product":"moment","packageURL":"pkg:npm/moment","defaultStatus":"unaffected","versions":[{"version":"2.29.2","status":"affected","lessThan":"2.31.0","versionType":"semver"},{"version":"2.31.0","status":"unaffected","versionType":"semver"}]}],"references":["https://github.com/moment/moment/security/advisories/GHSA-4p3w-j4w9-5jqw","https://cna.openjsf.org/security-advisories.html"],"weaknesses":["CWE-27"],"ingestedAt":"2026-10-29T20:11:00.674Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/17xxx/CVE-2026-17495.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-17495","state":"PUBLISHED","datePublished":"2026-09-15T05:40:55.263Z","dateUpdated":"2026-09-15T17:49:57.391Z","assignerShortName":"openjs","assignerOrgId":"ce714d77-add3-4f53-aff5-83d477b104bb","dateReserved":"2026-07-26T13:49:41.562Z"},"containers":{"cna":{"title":"moment vulnerable to Path Traversal via crafted non-string locale name","descriptions":[{"lang":"en","value":"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 moment.locale() can bypass the locale-name path-traversal guard. The guard assumes the input is a string, so an object whose match() method satisfies the check while its toString() returns a traversal path reaches an internal require() call with attacker-controlled path segments. This is an incomplete fix for CVE-2022-24785 and primarily affects npm (server-side) users that pass user-provided input directly to moment.locale(). The issue is fixed in moment 2.31.0, and users should upgrade to 2.31.0 or later. As a workaround, validate that any user-supplied input is a string before passing it to moment.locale()."}],"affected":[{"vendor":"moment","product":"moment","packageURL":"pkg:npm/moment","defaultStatus":"unaffected","versions":[{"version":"2.29.2","status":"affected","lessThan":"2.31.0","versionType":"semver"},{"version":"2.31.0","status":"unaffected","versionType":"semver"}]}],"references":[{"url":"https://github.com/moment/moment/security/advisories/GHSA-4p3w-j4w9-5jqw"},{"url":"https://cna.openjsf.org/security-advisories.html"}],"metrics":[{"format":"CVSS","cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","baseScore":5.9,"baseSeverity":"MEDIUM"},"scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-27","lang":"en","description":"CWE-27: Path Traversal: 'dir/../../filename'","type":"CWE"}]}],"providerMetadata":{"shortName":"openjs","orgId":"ce714d77-add3-4f53-aff5-83d477b104bb","dateUpdated":"2026-09-15T05:40:55.263Z"},"credits":[{"lang":"en","type":"reporter","value":"zolbooo"},{"lang":"en","type":"remediation developer","value":"UlisesGascon"},{"lang":"en","type":"coordinator","value":"gilmoreorless"},{"lang":"en","type":"remediation developer","value":"mattjohnsonpint"}],"x_generator":{"engine":"cve-kit 1.0.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-09-15T17:49:29.629363Z","id":"CVE-2026-17495","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-09-15T17:49:57.391Z"}}]}}}