CVE-2022-31129: Inefficient Regular Expression Complexity in moment
Vulnerability summary
CVE-2022-31129 is a high (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in debian debian_linux. EPSS estimates a 5.55% chance of exploitation in the next 30 days, higher than 92.8% of scored vulnerabilities. 2 public exploits are recorded.
Public exploit (GitHub, Date unknown)
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 17 · Related 8Timeline
- 06-07-2022PublishedVulnerability first disclosed.
- 03-11-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
9 scores · 8 sources · 2 versions- OSV · Red hatEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · UbuntuEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · DebianEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · NpmEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · ChainguardEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · NugetEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- NVDNIST7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS trend
Probability
5.55%
Chance of exploitation in the next 30 days
Percentile
93%
Versus all other CVEs
30-day change
No change 0.00 pp
From 5.55% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
2 foundMoment
Maturity: poc
Exploit Reference (huntr.dev)
Maturity: unknown
Weaknesses
CWE · root cause- CWE-400Uncontrolled Resource ConsumptionThe product does not properly control the allocation and maintenance of a limited resource.
- CWE-1333Inefficient Regular Expression ComplexityThe product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
Affected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Ubuntu11 products
- gnucashAll versions (No fix recorded)
- mediawikiAll versions (No fix recorded)
- node-momentAll versions (No fix recorded) | < 2.20.1+ds-1ubuntu0.1 | < 2.24.0+ds-2ubuntu0.1 | < 2.29.1+ds-3ubuntu0.2
- ntopngAll versions (No fix recorded)
- odooAll versions (No fix recorded)
Chainguard2 products
- wazuh-dashboard-security-plugin< 4.14.6-r5
- wazuh-dashboard-security-plugin-fips< 4.14.6-r2
Debian2 products
- node-moment< 2.29.4+ds-1
- debian_linuxEOL10.0
Redhat2 products
- cockpit-ovirt< 0:0.16.2-1.el8ev
- cockpit-ovirt-dashboard< 0:0.16.2-1.el8ev
Fedoraproject1 product
- fedoraEOL35 | 36 | 37
Moment1 product
- moment≥ 2.18.0, < 2.29.4
Momentjs1 product
- moment≥ 2.18.0, < 2.29.4
Npm1 product
- moment≥ 2.18.0, < 2.29.4
NuGet1 product
- Moment.js≥ 2.18.0, < 2.29.4
9 vendors · 22 products
References
41 links- github.com/moment/moment/security/advisories/GHSA-wc69-rhjr-hc9gARTICLEREPORTWEBAdvisoryIssue TrackingThird Party Advisory
- github.com/moment/moment/commit/9a3b5894f3d5d602948ac8a02e4ee528a49ca3a3WEBFIXPatchThird Party Advisory
- huntr.dev/bounties/f0952b67-f2ff-44a9-a9cd-99e0a87cb633/WEBExploitIssue TrackingPatchThird Party Advisory
- lists.debian.org/debian-lts-announce/2023/01/msg00035.htmlMailing ListWEBARTICLEThird Party Advisory
Show all 41 references
- github.com/moment/momentPACKAGE