// For flags

CVE-2022-31129

Inefficient Regular Expression Complexity in moment

Severity Score

7.5
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

2
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

moment es una biblioteca de fechas en JavaScript para analizar, comprobar, manipular y formatear fechas. Se ha detectado que las versiones afectadas de moment usan un algoritmo de análisis sintáctico ineficiente. Concretamente, el análisis sintáctico de cadena a fecha en moment (más concretamente el análisis sintáctico rfc2822, que es intentado por defecto) presenta una complejidad cuadrática (N^2) en entradas específicas. Los usuarios pueden notar una notable ralentización con entradas de más de 10k caracteres. Los usuarios que pasan cadenas proporcionadas por el usuario sin comprobaciones de longitud de cordura al constructor del momento son vulnerables a ataques (Re)DoS. El problema está parcheado en versión 2.29.4, el parche puede aplicarse a todas las versiones afectadas con un mínimo ajuste. Es recomendado a usuarios actualicen. Los usuarios que no puedan actualizar deberían considerar la posibilidad de limitar la longitud de las fechas aceptadas por el usuario

A flaw was found in the Moment.js package. Users who pass user-provided strings without sanity length checks to the moment constructor are vulnerable to regular expression denial of service (ReDoS) attacks.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
Attack Vector
Network
Attack Complexity
Low
Authentication
None
Confidentiality
None
Integrity
None
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2022-05-18 CVE Reserved
  • 2022-07-06 CVE Published
  • 2024-08-03 CVE Updated
  • 2024-08-03 First Exploit
  • 2024-09-27 EPSS Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-400: Uncontrolled Resource Consumption
  • CWE-1333: Inefficient Regular Expression Complexity
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Momentjs
Search vendor "Momentjs"
Moment
Search vendor "Momentjs" for product "Moment"
>= 2.18.0 < 2.29.4
Search vendor "Momentjs" for product "Moment" and version " >= 2.18.0 < 2.29.4"
node.js
Affected
Momentjs
Search vendor "Momentjs"
Moment
Search vendor "Momentjs" for product "Moment"
>= 2.18.0 < 2.29.4
Search vendor "Momentjs" for product "Moment" and version " >= 2.18.0 < 2.29.4"
nuget
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
35
Search vendor "Fedoraproject" for product "Fedora" and version "35"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
36
Search vendor "Fedoraproject" for product "Fedora" and version "36"
-
Affected
Fedoraproject
Search vendor "Fedoraproject"
Fedora
Search vendor "Fedoraproject" for product "Fedora"
37
Search vendor "Fedoraproject" for product "Fedora" and version "37"
-
Affected
Debian
Search vendor "Debian"
Debian Linux
Search vendor "Debian" for product "Debian Linux"
10.0
Search vendor "Debian" for product "Debian Linux" and version "10.0"
-
Affected