Vulnerability · Published Jul 6, 2022 · Assigned by GitHub_M
CVE-2022-31129Inefficient Regular Expression Complexity in moment
High 7.5
In plain English
A high-severity uncontrolled resource consumption in moment from moment. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 5.6% (higher than 93% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-moment | 2.29.4+ds-1 | DEBIAN-CVE-2022-31129 |
| Debian:13 | node-moment | 2.29.4+ds-1 | DEBIAN-CVE-2022-31129 |
| Debian:14 | node-moment | 2.29.4+ds-1 | DEBIAN-CVE-2022-31129 |
| NuGet | moment.js | 2.29.4 | GHSA-wc69-rhjr-hc9g |
| Ubuntu:22.04:LTS | gnucash | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:24.04:LTS | gnucash | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | gnucash | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.04:LTS | gnucash | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.10 | gnucash | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | mediawiki | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.04:LTS | mediawiki | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.10 | mediawiki | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:22.04:LTS | node-moment | 2.29.1+ds-3ubuntu0.2 | UBUNTU-CVE-2022-31129 |
| Ubuntu:22.04:LTS | node-moment | 2.29.1+ds-3ubuntu0.2 | USN-5559-1 |
| Ubuntu:22.04:LTS | ntopng | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:24.04:LTS | ntopng | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | ntopng | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:22.04:LTS | odoo | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:24.04:LTS | odoo | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | odoo | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.04:LTS | odoo | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.10 | odoo | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:22.04:LTS | omnidb | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:24.04:LTS | omnidb | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | omnidb | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | postfixadmin | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.04:LTS | postfixadmin | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.10 | postfixadmin | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:22.04:LTS | ruby-momentjs-rails | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:24.04:LTS | ruby-momentjs-rails | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:22.04:LTS | sabnzbdplus | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:24.04:LTS | sabnzbdplus | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | sabnzbdplus | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.04:LTS | sabnzbdplus | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.10 | sabnzbdplus | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | syncthing | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.10 | syncthing | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:22.04:LTS | wordpress | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:24.04:LTS | wordpress | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:25.10 | wordpress | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.04:LTS | wordpress | no fix listed | UBUNTU-CVE-2022-31129 |
| Ubuntu:26.10 | wordpress | no fix listed | UBUNTU-CVE-2022-31129 |
| npm | moment | 2.29.4 | GHSA-wc69-rhjr-hc9g |
Affected products (as reported)
Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/moment/moment/security/advisories/GHSA-wc69-rhjr-hc9g
- https://github.com/moment/moment/pull/6015#issuecomment-1152961973
- https://github.com/moment/moment/commit/9a3b5894f3d5d602948ac8a02e4ee528a49ca3a3
- https://huntr.dev/bounties/f0952b67-f2ff-44a9-a9cd-99e0a87cb633/
- FEDORA-2022-85aa8e5706 vendor-advisory
- FEDORA-2022-35b698150c vendor-advisory
- FEDORA-2022-b9ef7c3c3c vendor-advisory
- FEDORA-2022-798fd95813 vendor-advisory
- https://security.netapp.com/advisory/ntap-20221014-0003/
- [debian-lts-announce] 20230130 [SECURITY] [DLA 3295-1] node-moment security update mailing-list
- https://security.netapp.com/advisory/ntap-20241108-0002/