CVE-2022-31129
Inefficient Regular Expression Complexity in moment
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
2Exploited in Wild
-Decision
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.
CVSS Scores
SSVC
- Decision:-
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
References (12)
URL | Tag | Source |
---|---|---|
https://github.com/moment/moment/security/advisories/GHSA-wc69-rhjr-hc9g | Issue Tracking | |
https://lists.debian.org/debian-lts-announce/2023/01/msg00035.html | Mailing List | |
https://security.netapp.com/advisory/ntap-20221014-0003 | Third Party Advisory |
URL | Date | SRC |
---|---|---|
https://github.com/moment/moment/pull/6015#issuecomment-1152961973 | 2024-08-03 | |
https://huntr.dev/bounties/f0952b67-f2ff-44a9-a9cd-99e0a87cb633 | 2024-08-03 |
URL | Date | SRC |
---|---|---|
https://github.com/moment/moment/commit/9a3b5894f3d5d602948ac8a02e4ee528a49ca3a3 | 2023-11-07 |
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
|