Skip to content

← Actionable
High, CVSS 7.5amended

Moment.js vulnerable to Inefficient Regular Expression Complexity

CVE-2022-31129GHSA-wc69-rhjr-hc9g

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (moment.js 2.29.4; moment 2.29.4), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • NuGet moment.js

    Affected
    >= 2.18.0, < 2.29.4
    Fixed in
    2.29.4
  • npm moment

    Affected
    >= 2.18.0, < 2.29.4
    Fixed in
    2.29.4

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
7.5 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
  • CVE-2022-31129: 5.55% estimated exploitation activity in the next 30 days; percentile 92.86 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Impact using string-to-date parsing in moment (more specifically rfc2822 parsing, which is tried by default) has quadratic (N^2) complexity on specific inputs 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 Patches The problem is patched in 2.29.4, the patch can be applied to all affected versions with minimal tweaking. Workarounds In general, given the proliferation of ReDoS attacks, it makes sense to limit the length of the user input to something sane, like 200 characters or less. I haven't seen legitimate cases of date-time strings longer than that, so all moment users who do pass a user-originating string to constructor are encouraged to apply such a rudimentary filter, that would help with this but also most future ReDoS vulnerabilities. References There is an excellent writeup of the issue here:…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-wc69-rhjr-hc9g

  2. Revision 1 · created ·

    Published from osv record GHSA-wc69-rhjr-hc9g

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2022-31129

Advisory: Moment.js vulnerable to Inefficient Regular Expression Complexity
IDs: CVE-2022-31129, GHSA-wc69-rhjr-hc9g
Record: https://patchnext.com/advisories/cve-2022-31129 (revision 2, source checked 26 Oct 2026, 12:38 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 7.5)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: moment.js 2.29.4; moment 2.29.4. A vendor fix does not mean a deployment is fixed.

## Affected components
- NuGet moment.js: affected >= 2.18.0, < 2.29.4; fixed in 2.29.4
- npm moment: affected >= 2.18.0, < 2.29.4; fixed in 2.29.4

## Suggested inspection (read-only)
- NuGet moment.js: check the installed version with your package manager.
- `npm ls moment --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on moment.js, moment.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-wc69-rhjr-hc9g (OSV record GHSA-wc69-rhjr-hc9g lists affected ranges: npm moment >=2.18.0 =2.18.0 <2.29.4 (fixed))
- Verified: https://github.com/advisories/GHSA-wc69-rhjr-hc9g (GitHub-reviewed advisory GHSA-wc69-rhjr-hc9g lists affected ranges: npm moment >=2.18.0 =2.18.0 <2.29.4)

Commands are suggestions: review each one before running it.

Loading voting…