CVE-2022-31129
Inefficient Regular Expression Complexity in moment
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
Description
moment is a JavaScript date library for parsing, validating, manipulating, and formatting dates. Affected versions of moment were found to use an inefficient parsing algorithm. Specifically using string-to-date parsing in moment (more specifically rfc2822 parsing, which is tried by default) has quadratic (N^2) complexity on specific inputs. Users may notice a noticeable slowdown is observed with inputs above 10k characters. Users who pass user-provided strings without sanity length checks to moment constructor are vulnerable to (Re)DoS attacks. The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking. Users are advised to upgrade. Users unable to upgrade should consider limiting date lengths accepted from user input.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | High7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVDNVD · Modified | 3.1 | High7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
- EPSS (exploitation in 30 days)
- 5.6% · top 7.1% of all CVEs (6 Nov 2026)
- CISA SSVC
- Exploitation: poc · Automatable: yes · Technical impact: partial
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.5.
Weakness
Affected products
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- NuGetMoment.jsGHSA-wc69-rhjr-hc9g (opens in a new tab)
- npmmomentGHSA-wc69-rhjr-hc9g (opens in a new tab)
References (11)
- https://github.com/moment/moment/security/advisories/GHSA-wc69-rhjr-hc9g (opens in a new tab)x_transferred
- https://github.com/moment/moment/pull/6015#issuecomment-1152961973 (opens in a new tab)x_transferred
- https://github.com/moment/moment/commit/9a3b5894f3d5d602948ac8a02e4ee528a49ca3a3 (opens in a new tab)x_transferred
- https://huntr.dev/bounties/f0952b67-f2ff-44a9-a9cd-99e0a87cb633/ (opens in a new tab)x_transferred
- FEDORA-2022-85aa8e5706 (opens in a new tab)vendor-advisoryx_transferred
- FEDORA-2022-35b698150c (opens in a new tab)vendor-advisoryx_transferred
- FEDORA-2022-b9ef7c3c3c (opens in a new tab)vendor-advisoryx_transferred
- FEDORA-2022-798fd95813 (opens in a new tab)vendor-advisoryx_transferred
- https://security.netapp.com/advisory/ntap-20221014-0003/ (opens in a new tab)x_transferred
- [debian-lts-announce] 20230130 [SECURITY] [DLA 3295-1] node-moment security update (opens in a new tab)mailing-listx_transferred
- https://security.netapp.com/advisory/ntap-20241108-0002/ (opens in a new tab)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-wc69-rhjr-hc9g (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2022-31129)Record last updated .