CVE-2022-31129

Inefficient Regular Expression Complexity in moment

HIGH
7.5
CVSS Score
Published: July 6, 2022 at 12:00 AM UTC
Updated: June 17, 2026 at 04:44 AM UTC
4 products affected across 4 vendorsDebian LinuxFedoraMoment

Using moment by moment?

Get instant alerts when new vulnerabilities affect moment - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.5
Exploit prediction
EPSS 6%
SSVC
PoC

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

2.18.0 ≤ v < 2.29.4
Affected range stops below 2.29.4, so it looks safe — our inference, not a vendor statement
v < 2.29.4
Affected range stops below 2.29.4, so it looks safe — our inference, not a vendor statement

SSVC — Action Prioritization

SSVCPoCAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.5HIGHGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-400CWE-1333

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card