npm package report

Is moment safe?

5 known vulnerabilities, worst severity HIGH.

// reach

0 direct dependencies

none carry a known advisory

    538 packages depend on it

    an advisory here reaches each of them

    Create a free accountfor every dependency path, dependent and what to upgrade
    // ai model usage

    Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.


    cvss
    7.5
    high

    CVSS v3.1 base score out of 10

    epss
    5.6%
    medium

    chance of exploitation in 30 days, 93rd percentile of all CVEs

    xyz score
    5.1
    medium

    CyberXYZ composite out of 10

    fig. 01 — GHSA-wc69-rhjr-hc9g, the advisory selected below

    // 5 advisories

    GHSA-wc69-rhjr-hc9g

    HIGHGitHub ratingCVE-2022-31129
    // 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: https://github.com/moment/moment/pull/6015#issuecomment-1152961973=

    // details

    The issue is rooted in the code that removes legacy comments (stuff inside parenthesis) from strings during rfc2822 parsing. moment("(".repeat(500000)) will take a few minutes to process, which is unacceptable.

    // cvss v3.1 vector

    CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

    Attack vector
    Network
    Attack complexity
    Low
    Privileges required
    None
    User interaction
    None
    Scope
    Unchanged
    Confidentiality
    None
    Integrity
    None
    Availability
    High

    Checked 2026-11-07 at 23:11 UTC. The most recent advisory here was published 2026-09-29. Updated continuously from NVD, GHSA, OSV and CNA feeds.

    Think a verdict here is wrong? Tell us — we respond within 2 business days.