CVE-2022-31129
published high CVSS 3.1 · 7.5Inefficient Regular Expression Complexity in moment
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| moment | — | moment >= 2.18.0, < 2.29.4 | Affected | Not stated | GitHub_M |
| Debian | buster | node-moment | Advisory build | 2.24.0+ds-1+deb10u1 | DLA-3295-1 |
| Ubuntu | bionic | libjs-moment | Advisory build | 2.20.1+ds-1ubuntu0.1 | USN-5559-1 |
| Ubuntu | bionic | node-moment | Advisory build | 2.20.1+ds-1ubuntu0.1 | USN-5559-1 |
| Ubuntu | focal | libjs-moment | Advisory build | 2.24.0+ds-2ubuntu0.1 | USN-5559-1 |
| Ubuntu | focal | node-moment | Advisory build | 2.24.0+ds-2ubuntu0.1 | USN-5559-1 |
| Ubuntu | jammy | libjs-moment | Advisory build | 2.29.1+ds-3ubuntu0.2 | USN-5559-1 |
| Ubuntu | jammy | node-moment | Advisory build | 2.29.1+ds-3ubuntu0.2 | USN-5559-1 |
Show 1 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | jammy | postfixadmin | Advisory build | 3.3.10-2ubuntu0.1~esm1 | USN-6550-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.5 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| moment | moment | >= 2.18.0, < 2.29.4 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-400 CWE-400: Uncontrolled Resource Consumption
References
11- https://github.com/moment/moment/commit/9a3b5894f3d5d602948ac8a02e4ee528a49ca3a3
- https://github.com/moment/moment/pull/6015#issuecomment-1152961973
- https://github.com/moment/moment/security/advisories/GHSA-wc69-rhjr-hc9g
- https://huntr.dev/bounties/f0952b67-f2ff-44a9-a9cd-99e0a87cb633/
- [debian-lts-announce] 20230130 [SECURITY] [DLA 3295-1] node-moment security update https://lists.debian.org/debian-lts-announce/2023/01/msg00035.html
- FEDORA-2022-85aa8e5706 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6QIO6YNLTK2T7SPKDS4JEL45FANLNC2Q/
- FEDORA-2022-b9ef7c3c3c https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IWY24RJA3SBJGA5N4CU4VBPHJPPPJL5O/
- FEDORA-2022-35b698150c https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5/
- FEDORA-2022-798fd95813 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZMX5YHELQVCGKKQVFXIYOTBMN23YYSRO/
- https://security.netapp.com/advisory/ntap-20221014-0003/
- https://security.netapp.com/advisory/ntap-20241108-0002/
Provider assertions
3GitHub_M · cna
Inefficient Regular Expression Complexity in moment
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- d5370fab0857050f997171ca773a8b31a1a7b85cb745fe83df94feda2d4ed789
- Ingested
- 23 Sep 2026, 08:00:25 UTC
- Source record
- Official CVE record