Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-15147

Moment vulnerability

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 13.4.18, 14.7.8, 15.1.0, 15.0.1
    • 13.4.19, 14.7.9, 15.1.1, 15.2.0
    • None
    • None
    • Quasar
    • Team Quasar Sprint 294

    Description

      This issue also affects SaaS.

      NPM-1081761  suppress

       

          1. 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.

      Unscored:

      • Severity: high

      References:

       

      Vulnerable Software & Versions (NPM):

      • cpe:2.3:a::moment:\>\=2.18.0\<2.29.4:::::::

       

      CVE-2022-31129 (OSSINDEX)  suppress

       

      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.

      CWE-400 Uncontrolled Resource Consumption ('Resource Exhaustion')

      CVSSv2:

      • Base Score: HIGH (7.5)
      • Vector: /AV:N/AC:L/Au:/C:N/I:N/A:H

      References:

       

      Vulnerable Software & Versions (OSSINDEX):

      • cpe:2.3:a::moment:2.29.3:::::::

      NPM-1070447  suppress

       

          1. 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/moment/moment)

      Unscored:

      • Severity: high

      References:

       

      Vulnerable Software & Versions (NPM):

      • cpe:2.3:a::moment:\<2.29.2:::::::

       

      CVE-2022-24785 (OSSINDEX)  suppress

       

      Moment.js is a JavaScript date library for parsing, validating, manipulating, and formatting dates. A path traversal vulnerability impacts npm (server) users of Moment.js between versions 1.0.1 and 2.29.1, especially if a user-provided locale string is directly used to switch moment locale. This problem is patched in 2.29.2, and the patch can be applied to all affected versions. As a workaround, sanitize the user-provided locale name before passing it to Moment.js.

      CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

      CVSSv2:

      • Base Score: HIGH (7.5)
      • Vector: /AV:N/AC:L/Au:/C:N/I:H/A:N

      References:

       

      Vulnerable Software & Versions (OSSINDEX):

      • cpe:2.3:a::moment:2.29.1:::::::

      Attachments

        Activity

          People

            dhachok Dmytro Hachok
            ntrajkovski Nikola Trajkovski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: