CVE-2022-31129

NameCVE-2022-31129
Descriptionmoment 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDLA-3295-1
Debian Bugs1014845

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
node-moment (PTS)buster2.24.0+ds-1vulnerable
buster (security)2.24.0+ds-1+deb10u1fixed
bullseye2.29.1+ds-2+deb11u2fixed
trixie, sid, bookworm2.29.4+ds-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
node-momentsourcebuster2.24.0+ds-1+deb10u1DLA-3295-1
node-momentsourcebullseye2.29.1+ds-2+deb11u2
node-momentsource(unstable)2.29.4+ds-11014845

Notes

https://github.com/moment/moment/commit/9a3b5894f3d5d602948ac8a02e4ee528a49ca3a3 (2.29.4)
https://github.com/moment/moment/pull/6015#issuecomment-1152961973
https://github.com/moment/moment/security/advisories/GHSA-wc69-rhjr-hc9g

Search for package or bug name: Reporting problems