org.webjars.npm:qs@4.0.0 vulnerabilities

  • latest version

    6.13.0

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    3 months ago

  • licenses detected

  • package manager

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm:qs 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
    • H
    Prototype Poisoning

    org.webjars.npm:qs is a querystring parser that supports nesting and arrays, with a depth limit.

    Affected versions of this package are vulnerable to Prototype Poisoning which allows attackers to cause a Node process to hang, processing an Array object whose prototype has been replaced by one with an excessive length value.

    Note: In many typical Express use cases, an unauthenticated remote attacker can place the attack payload in the query string of the URL that is used to visit the application, such as a[__proto__]=b&a[__proto__]&a[length]=100000000.

    How to fix Prototype Poisoning?

    Upgrade org.webjars.npm:qs to version 6.11.0 or higher.

    [,6.11.0)
    • H
    Prototype Override Protection Bypass

    org.webjars.npm:qs is a querystring parser that supports nesting and arrays, with a depth limit.

    Affected versions of this package are vulnerable to Prototype Override Protection Bypass. By default qs protects against attacks that attempt to overwrite an object's existing prototype properties, such as toString(), hasOwnProperty(),etc.

    From qs documentation:

    By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use plainObjects as mentioned above, or set allowPrototypes to true which will allow user input to overwrite those properties. WARNING It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.

    Overwriting these properties can impact application logic, potentially allowing attackers to work around security controls, modify data, make the application unstable and more.

    In versions of the package affected by this vulnerability, it is possible to circumvent this protection and overwrite prototype properties and functions by prefixing the name of the parameter with [ or ]. e.g. qs.parse("]=toString") will return {toString = true}, as a result, calling toString() on the object will throw an exception.

    Example:

    qs.parse('toString=foo', { allowPrototypes: false })
    // {}
    
    qs.parse("]=toString", { allowPrototypes: false })
    // {toString = true} <== prototype overwritten
    

    For more information, you can check out our blog.

    How to fix Prototype Override Protection Bypass?

    Upgrade org.webjars.npm:qs to version 6.0.4, 6.1.2, 6.2.3, 6.3.2 or higher.

    [,6.0.4)[6.1.0,6.1.2)[6.2.0,6.2.3)[6.3.0,6.3.2)