moment@2.29.0

Parse, validate, manipulate, and display dates

  • latest version

    2.31.0

  • latest non vulnerable version

  • first published

    14 years ago

  • latest version published

    26 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the moment package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Directory Traversal

    moment is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.

    Affected versions of this package are vulnerable to Directory Traversal in the locale() function, whose locale name validation is circumvented by a non-string value, so an object can direct the load to an attacker-specified path. An attacker can cause a file to be loaded from a path of their choosing by supplying a non-string value that the application passes to moment.locale(). This requires the application to hand user-supplied non-string input directly to moment.locale(), plain strings are unaffected because the existing validation rejects those containing path separators, and only server-side npm consumers are in scope.

    Note: This is a bypass of the fix for the vulnerability described in CVE-2022-24785.

    How to fix Directory Traversal?

    Upgrade moment to version 2.31.0 or higher.

    <2.31.0
    • H
    Regular Expression Denial of Service (ReDoS)

    moment is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the preprocessRFC2822() function in from-string.js, when processing a very long crafted string (over 10k characters).

    How to fix Regular Expression Denial of Service (ReDoS)?

    Upgrade moment to version 2.29.4 or higher.

    >=2.18.0 <2.29.4
    • H
    Directory Traversal

    moment is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.

    Affected versions of this package are vulnerable to Directory Traversal when a user provides a locale string which is directly used to switch moment locale.

    How to fix Directory Traversal?

    Upgrade moment to version 2.29.2 or higher.

    <2.29.2