GHSA-4P3W-J4W9-5JQW
Vulnerability from github – Published: 2026-09-29 23:46 – Updated: 2026-09-29 23:46Impact
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": [
{
"package": {
"ecosystem": "npm",
"name": "moment"
},
"ranges": [
{
"events": [
{
"introduced": "2.29.2"
},
{
"fixed": "2.31.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-17495"
],
"database_specific": {
"cwe_ids": [
"CWE-27"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-29T23:46:02Z",
"nvd_published_at": "2026-09-15T06:16:57Z",
"severity": "MODERATE"
},
"details": "### Impact\n\nmoment 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).\n\nThis affects server-side (npm) users only. Plain string input is not affected: the existing validation correctly rejects strings that contain path separators.\n\n### Patches\n\nThis issue is patched in moment 2.31.0.\n\n### Workarounds\n\nValidate that any user-supplied input is a string before passing it to `moment.locale()`.",
"id": "GHSA-4p3w-j4w9-5jqw",
"modified": "2026-09-29T23:46:02Z",
"published": "2026-09-29T23:46:02Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/moment/moment/security/advisories/GHSA-4p3w-j4w9-5jqw"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-17495"
},
{
"type": "WEB",
"url": "https://github.com/moment/moment/pull/6386"
},
{
"type": "WEB",
"url": "https://github.com/moment/moment/commit/5f7d983c9881e65e07574de9dda3190d99520c07"
},
{
"type": "WEB",
"url": "https://cna.openjsf.org/security-advisories.html"
},
{
"type": "PACKAGE",
"url": "https://github.com/moment/moment"
},
{
"type": "WEB",
"url": "https://github.com/moment/moment/releases/tag/2.31.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "moment vulnerable to Path Traversal via crafted non-string locale name"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.