org.webjars.npm:ms@0.7.2 vulnerabilities

  • latest version

    3.0.0-canary.1

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    3 years ago

  • licenses detected

  • package manager

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm:ms package. This does not include vulnerabilities belonging to this package’s dependencies.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable Version
    • L
    Regular Expression Denial of Service (ReDoS)

    ms is a tiny millisecond conversion utility.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to an incomplete fix for previously reported vulnerability npm:ms:20151024. The fix limited the length of accepted input string to 10,000 characters, and turned to be insufficient making it possible to block the event loop for 0.3 seconds (on a typical laptop) with a specially crafted string passed to ms() function.

    Proof of concept

    ms = require('ms');
    ms('1'.repeat(9998) + 'Q') // Takes about ~0.3s
    

    Note: Snyk's patch for this vulnerability limits input length to 100 characters. This new limit was deemed to be a breaking change by the author. Based on user feedback, we believe the risk of breakage is very low, while the value to your security is much greater, and therefore opted to still capture this change in a patch for earlier versions as well. Whenever patching security issues, we always suggest to run tests on your code to validate that nothing has been broken.

    For more information on Regular Expression Denial of Service (ReDoS) attacks, go to our blog.

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

    Upgrade ms to version 2.0.0 or higher.

    [,2.0.0)