Moment.js vulnerabilitiesMoment.js: known vulnerabilities and safe versions
npm: moment
Moment.js has 7 known vulnerability records: 6 in the npm advisory data (GitHub Advisory Database via OSV, the same source npm audit uses) and 1 only in Retire.js (CDN builds and advisories without a CVE).
By branch: 2.x is safe from 2.31.0.
Vulnerabilities and safe version by branch
Safe version: on that branch, this release and every later one (up to the branch's latest release, where known) fall outside every known record's range. Candidates are only the records' own fixed versions and the branch's latest release; "No fix" means moving off the branch.
| Branch | Support | Latest on branch | Records | Safe version |
|---|---|---|---|---|
| 2.x | — | — | 7high | 2.31.0 |
Support dates appear only for libraries that endoflife.date tracks.
Records
Newest first. Ranges are the record's own data; several ranges mean separate fixes per branch.
CVE-2026-174952026-09-15
moment vulnerable to Path Traversal via crafted non-string locale name
Affected versions: >= 2.29.2, < 2.31.0
medium 5.9
Fixed in: 2.31.0
CVE-2023-224672023-01-04
luxon.js inefficient regular expression complexity vulnerability
Affected versions: >= 2.18.0, < 2.29.4
high 7.5
Fixed in: 2.29.4
EPSS 1.7%
CVE-2022-311292022-07-06
Inefficient Regular Expression Complexity in moment
Affected versions: >= 2.18.0, < 2.29.4
high 7.5
Fixed in: 2.29.4
EPSS 5.5%
high 7.5
Fixed in: 2.29.2
EPSS 13.9%
CVE-2017-182142018-03-04
The moment module before 2.19.3 for Node.js is prone to a regular expression denial of service via a crafted date string, a different vulner
Affected versions: < 2.19.3
high 7.5
Fixed in: 2.19.3
EPSS 3.6%
CVE-2016-40552017-01-23
The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption)
Affected versions: < 2.11.2
medium 6.5
Fixed in: 2.11.2
EPSS 9.9%
no CVE
Regular Expression Denial of Service (ReDoS)
Affected versions: < 2.15.2
medium
Fixed in: 2.15.2
Sources and method
Ranges: GitHub Advisory Database (OSV npm export, daily) and Retire.js (Apache-2.0). Exploitation: CISA KEV, FIRST EPSS and exploit maturity from the Noroxi CVE database. Support dates: endoflife.date.
This page and the JavaScript library scan use the same matching rule: a row without bounds is not evidence, and versions are compared in one place. A record without a version range never counts as "affected" in the version check.
Data as of October 21, 2026.