CVE-2022-31129
Momentjs Moment vulnerability
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 products
Moment, Fedora, Debian Linux. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Momentjs Moment runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.
References
- huntr.dev/bounties/f0952b67-f2ff-44a9-a9cd-99e0a87cb633/ · Exploit
- security.netapp.com/advisory/ntap-20221014-0003/ · Third Party Advisory
- github.com/moment/moment/security/advisories/GHSA-wc69-rhjr-hc9g
- github.com/moment/moment/pull/6015#issuecomment-1152961973
- github.com/moment/moment/commit/9a3b5894f3d5d602948ac8a02e4ee528a49ca3a3
- nvd.nist.gov/vuln/detail/CVE-2022-31129
- lists.debian.org/debian-lts-announce/2023/01/msg00035.html
- github.com/moment/moment/pull/6015/commits/4bbb9f3ccbe231de40207503f344fe5ce97584f4
- nvd.nist.gov/vuln/detail/CVE-2022-31129
- cve.org/CVERecord?id=CVE-2022-31129
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.