moment

Ecosystem: npm

Downloads: 171 Mln

Vulnerabilities from the last (months)
  • 0CriticalAffects 0 versions
  • 3HighAffects 3 versions
  • 0MediumAffects 0 versions
  • 3ModerateAffects 3 versions
  • 0LowAffects 0 versions
Severity distribution (all time)
6vulnerabilities
  • Critical0 (0.0%)
  • High3 (50.0%)
  • Medium0 (0.0%)
  • Moderate3 (50.0%)
  • Low0 (0.0%)

Monthly breakdown

  • Critical
  • High
  • Medium
  • Moderate
  • Low
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 1
    • Low: 0

Vulnerabilities (6)

Known vulnerabilities affecting moment, based on data from OSV.

Vulnerabilities affecting moment
IDSeveritySummaryAffected versionsPublishedSource
GHSA-4p3w-j4w9-5jqwModeratemoment vulnerable to Path Traversal via crafted non-string locale name### Impact moment before 2.31.0 is vulnerable to path traversal in `moment.locale()`. When an application passes a non-string, attacker-influenced value to `moment.locale()`, a specially crafted object can bypass the locale name validation and cause moment to load a file from an attacker-controlled path. This is a further bypass of the validation added in 2.29.2 for [CVE-2022-24785](https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4). This affects server-side (npm) users only. Plain string input is not affected: the existing validation correctly rejects strings that con
  • >= 2.29.2, < 2.31.0
GitHub (opens in a new tab)
GHSA-wc69-rhjr-hc9gHighMoment.js vulnerable to Inefficient Regular Expression Complexity### 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
  • >= 2.18.0, < 2.29.4
GitHub (opens in a new tab)
GHSA-8hfj-j24r-96c4HighPath Traversal: 'dir/../../filename' in moment.locale### Impact This vulnerability impacts npm (server) users of moment.js, especially if user provided locale string, eg `fr` is directly used to switch moment locale. ### Patches This problem is patched in 2.29.2, and the patch can be applied to all affected versions (from 1.0.1 up until 2.29.1, inclusive). ### Workarounds Sanitize user-provided locale name before passing it to moment.js. ### References _Are there any links users can visit to find out more?_ ### For more information If you have any questions or comments about this advisory: * Open an issue in [moment repo](https://github.com/
  • < 2.29.2
GitHub (opens in a new tab)
GHSA-hxf5-mg84-pj4mModerateModerate severity vulnerability that affects momentWithdrawn, accidental duplicate publish. The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption) via a long string, aka a "regular expression Denial of Service (ReDoS)."
  • < 2.11.2
GitHub (opens in a new tab)
GHSA-446m-mv8f-q348HighRegular Expression Denial of Service in momentAffected versions of `moment` are vulnerable to a low severity regular expression denial of service when parsing dates as strings. ## Recommendation Update to version 2.19.3 or later.
  • < 2.19.3
GitHub (opens in a new tab)
GHSA-87vv-r9j6-g5qvModerateRegular Expression Denial of Service in momentVersions of `moment` prior to 2.11.2 are affected by a regular expression denial of service vulnerability. The vulnerability is triggered when arbitrary user input is passed into `moment.duration()`. ## Proof of concept ``` var moment = require('moment'); var genstr = function (len, chr) { var result = ""; for (i=0; i<=len; i++) { result = result + chr; } return result; } for (i=20000;i<=10000000;i=i+10000) { console.log("COUNT: " + i); var str = '-' + genstr(i, '1') console.log("LENGTH: " + str.length); var start = process.hrtime(); moment.dur
  • < 2.11.2
GitHub (opens in a new tab)
  • GHSA-4p3w-j4w9-5jqwModerate
    moment vulnerable to Path Traversal via crafted non-string locale name
    • >= 2.29.2, < 2.31.0

    ### Impact moment before 2.31.0 is vulnerable to path traversal in `moment.locale()`. When an application passes a non-string, attacker-influenced value to `moment.locale()`, a specially crafted object can bypass the locale name validation and cause moment to load a file from an attacker-controlled path. This is a further bypass of the validation added in 2.29.2 for [CVE-2022-24785](https://github.com/moment/moment/security/advisories/GHSA-8hfj-j24r-96c4). This affects server-side (npm) users only. Plain string input is not affected: the existing validation correctly rejects strings that con

    CVE: CVE-2026-17495

  • GHSA-wc69-rhjr-hc9gHigh
    Moment.js vulnerable to Inefficient Regular Expression Complexity
    • >= 2.18.0, < 2.29.4

    ### 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

    CVE: CVE-2022-31129

  • GHSA-8hfj-j24r-96c4High
    Path Traversal: 'dir/../../filename' in moment.locale
    • < 2.29.2

    ### Impact This vulnerability impacts npm (server) users of moment.js, especially if user provided locale string, eg `fr` is directly used to switch moment locale. ### Patches This problem is patched in 2.29.2, and the patch can be applied to all affected versions (from 1.0.1 up until 2.29.1, inclusive). ### Workarounds Sanitize user-provided locale name before passing it to moment.js. ### References _Are there any links users can visit to find out more?_ ### For more information If you have any questions or comments about this advisory: * Open an issue in [moment repo](https://github.com/

    CVE: CVE-2022-24785

  • GHSA-hxf5-mg84-pj4mModerate
    Moderate severity vulnerability that affects moment
    • < 2.11.2

    Withdrawn, accidental duplicate publish. The duration function in the moment package before 2.11.2 for Node.js allows remote attackers to cause a denial of service (CPU consumption) via a long string, aka a "regular expression Denial of Service (ReDoS)."

  • GHSA-446m-mv8f-q348High
    Regular Expression Denial of Service in moment
    • < 2.19.3

    Affected versions of `moment` are vulnerable to a low severity regular expression denial of service when parsing dates as strings. ## Recommendation Update to version 2.19.3 or later.

    CVE: CVE-2017-18214

  • GHSA-87vv-r9j6-g5qvModerate
    Regular Expression Denial of Service in moment
    • < 2.11.2

    Versions of `moment` prior to 2.11.2 are affected by a regular expression denial of service vulnerability. The vulnerability is triggered when arbitrary user input is passed into `moment.duration()`. ## Proof of concept ``` var moment = require('moment'); var genstr = function (len, chr) { var result = ""; for (i=0; i<=len; i++) { result = result + chr; } return result; } for (i=20000;i<=10000000;i=i+10000) { console.log("COUNT: " + i); var str = '-' + genstr(i, '1') console.log("LENGTH: " + str.length); var start = process.hrtime(); moment.dur

    CVE: CVE-2016-4055

Showing 1-6 of 6 vulnerabilities