VDB

CVE-2022-31129

CVE-2022-31129 PUBLISHED CVSS 7.5 HIGH

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

CVSS 3.1
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected products

VendorProductVersions
momentmoment >= 2.18.0, < 2.29.4
momentmoment2.18.0
chainguardwazuh-dashboard-fips0
chainguardwazuh-dashboard0
NuGetMoment.js2.18.0
npmmoment2.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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›