CVE-2022-31129

Aliases:GHSA-wc69-rhjr-hc9g
Advisory lineage Upstream: 0 Downstream: 20
Modified
Published: 06 Jul 2022, 00:00
Last modified:03 Nov 2025, 21:46

Vulnerability Summary

Overall Risk (default)
medium
41/100
CVSS Score
7.5 HIGH
v3.1 (cve.org)
EPSS Score
3.11% LOW
3% probability -0.32%
KEV
Not listed
Ransomware
No reports
Public exploits
2 found
Dark Web
Not detected

Timeline

06 Jul 2022, 00:00
Published
Vulnerability first disclosed
03 Nov 2025, 21:46
Last Modified
Vulnerability information updated

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.

CVSS Metrics

  • v3.1HIGHScore: 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • v2.0MEDIUMScore: 5AV:N/AC:L/Au:N/C:N/I:N/A:P

EPSS Trends

Current EPSS score: 3.11% Percentile: 87%

Techniques & Countermeasures

  • CWE-400Uncontrolled Resource Consumption

    The product does not properly control the allocation and maintenance of a limited resource.

  • CWE-1333Inefficient Regular Expression Complexity

    The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.

Affected Systems

  • debiandebian_linux

    10.0

  • fedoraprojectfedora

    35 | 36 | 37

  • momentmoment

    ≥ 2.18.0, < 2.29.4

  • momentjsmoment

    ≥ 2.18.0, < 2.29.4

  • Npmmoment

    ≥ 2.18.0, < 2.29.4

  • NuGetMoment.js

    ≥ 2.18.0, < 2.29.4

References (27)