CVE-2022-31129
Inefficient Regular Expression Complexity in moment
Reported by github_m · Published July 6, 2022
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.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| moment | moment | >= 2.18.0, < 2.29.4 |
| moment | moment | 2.18.0 |
| chainguard | wazuh-dashboard-fips | 0 |
| chainguard | wazuh-dashboard | 0 |
| NuGet | Moment.js | 2.18.0 |
| npm | moment | 2.18.0 |
Timeline
- Jul 6, 2022 CVE Published
- Jul 7, 2022 EPSS Score (30 in total, the first dated here)
- Dec 9, 2022 PoC Published (2 in total, the first dated here)
- Mar 9, 2026 Security Advisory (85 in total, the first dated here)
- Jun 25, 2026 Coalition ESS Score
- Jul 2, 2026 Distribution Patch (81 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-31129
vulnetix vdb fixes CVE-2022-31129
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-31129/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- FEDORA-2022-85aa8e5706 vendor-advisory
- FEDORA-2022-35b698150c vendor-advisory
- FEDORA-2022-b9ef7c3c3c vendor-advisory
- FEDORA-2022-798fd95813 vendor-advisory
- [debian-lts-announce] 20230130 [SECURITY] [DLA 3295-1] node-moment security update mailing-list
- https://nvd.nist.gov/vuln/detail/CVE-2022-31129 advisory
- https://github.com/advisories/GHSA-wc69-rhjr-hc9g advisory
- https://github.com/moment/moment/pull/6015/commits/4bbb9f3ccbe231de40207503f344fe5ce97584f4 patch
- https://github.com/moment/moment/pull/6015/commits/bfd4f2375d5c1a2106246721d693a9611dddfbfe patch
- https://github.com/moment/moment/pull/6015/commits/dc0d180e90d8a84f7ff13572363330a22b3ea504 patch
- https://security.netapp.com/advisory/ntap-20241108-0002 advisory
- https://security.netapp.com/advisory/ntap-20221014-0003 advisory
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZMX5YHELQVCGKKQVFXIYOTBMN23YYSRO url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ORJX2LF6KMPIHP6B2P6KZIVKMLE3LVJ5 url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IWY24RJA3SBJGA5N4CU4VBPHJPPPJL5O url
…and 8 more