CVE-2026-9358: postcss-selector-parser Denial of Service via Uncontrolled AST Recursion

postcss-selector-parser Updated 01 Sep 2026

Summary

26/05/2026
Yes i
Low
4.3

CVE-2026-9358: postcss-selector-parser allows denial of service through uncontrolled AST recursion. Affects postcss-selector-parser across 2 version ranges.

>= 6.1.0, < 6.1.3 >= 7.1.0, < 7.1.3

Fixed in 6.1.3 or 7.1.3, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

postcss-selector-parser is a widely used npm package that facilitates the parsing and manipulation of CSS selectors. It is integral to many CSS processing workflows, allowing developers to work with selectors in a structured manner. However, prior versions of this package are susceptible to a vulnerability that can lead to denial of service (DoS) attacks, particularly when handling user-generated CSS.

Vulnerability Detail

The vulnerability identified as CVE-2026-9358 exists in the toString function of the src/selectors/container.js file within postcss-selector-parser versions prior to 6.1.3 and 7.1.3. This flaw allows for uncontrolled recursion when processing certain inputs, which can be exploited to cause a denial of service. An attacker can remotely trigger this vulnerability by sending specially crafted CSS selectors, leading to potential server crashes or resource exhaustion.

How To Fix

Latest published version: 7.1.7 as of 23 Oct 2026

npm install postcss-selector-parser@7.1.7

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 6.1.0, < 6.1.3 6.1.3
    npm install postcss-selector-parser@6.1.3
  • >= 7.1.0, < 7.1.3 7.1.3
    npm install postcss-selector-parser@7.1.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary measure, you can implement input validation to sanitize CSS selectors before they are processed by postcss-selector-parser. This can help prevent malicious inputs from triggering the vulnerability. For example:

function sanitizeCSSSelector(selector) {
    // Implement validation logic here
    return selector;
}

const safeSelector = sanitizeCSSSelector(userInput);
const parsedSelector = postcssSelectorParser.parse(safeSelector);

Conclusion

CVE-2026-9358 poses a significant risk to applications using vulnerable versions of postcss-selector-parser, allowing for denial of service through uncontrolled recursion. It is crucial to update to the latest patched versions to mitigate this risk and ensure the stability of your application.

See every vulnerability recorded for postcss-selector-parser →

Share this vulnerability

FAQ

CVE-2026-9358 is a vulnerability in postcss-selector-parser that allows for denial of service through uncontrolled recursion in the AST serialization process.

Versions of postcss-selector-parser prior to 6.1.3 and 7.1.3 are affected by this vulnerability.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software by analyzing your package-lock.json file. You can also check your application using the Vulert playground without any signup.

Exploiting this vulnerability can lead to denial of service, causing your application to crash or become unresponsive when processing malicious CSS selectors.

If immediate updates are not possible, implement input validation to sanitize CSS selectors before processing them with postcss-selector-parser.

Related vulnerabilities

Recent vulnerabilities recorded for postcss-selector-parser.

How To Fix

Latest published version: 7.1.7 as of 23 Oct 2026

npm install postcss-selector-parser@7.1.7

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 6.1.0, < 6.1.3 6.1.3
    npm install postcss-selector-parser@6.1.3
  • >= 7.1.0, < 7.1.3 7.1.3
    npm install postcss-selector-parser@7.1.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback