postcss-selector-parser@6.1.5

Selector parser with built in methods for working with selector strings.

  • latest version

    7.1.7

  • latest non vulnerable version

  • first published

    11 years ago

  • latest version published

    8 hours ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the postcss-selector-parser 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
    Inefficient Algorithmic Complexity

    Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via the uniqs helper and index-membership checks in src/parser.js when parsing flat selectors (e.g. .a.a.a...) containing a large number of class or ID tokens. The original implementation uses Array.indexOf inside a filter callback and repeated linear scans of the hasClass/hasId arrays, producing quadratic time complexity proportional to the number of tokens. An attacker who can supply selector input to the parser can trigger CPU exhaustion by providing a long flat selector, pinning a CPU core and causing the process to become unresponsive.

    How to fix Inefficient Algorithmic Complexity?

    Upgrade postcss-selector-parser to version 7.1.6 or higher.

    <7.1.6