CVE-2026-9358: postcss-selector-parser allows denial of service through uncontrolled AST recursion

Low CVSS 4.3

OSV id
GHSA-w9m9-85wc-3x92
Also known as
CVE-2026-9358
Published
Last modified

Affected packages

PackageAffected versionsFixed in
postcss-selector-parser
npm
>= 6.1.0, < 6.1.3 6.1.3
postcss-selector-parser
npm
>= 7.1.0, < 7.1.3 7.1.3

Versions we track that it affects: postcss-selector-parser 6.1.0; postcss-selector-parser 6.1.0

How to fix it

postcss-selector-parser (npm)

Upgrade postcss-selector-parser to 6.1.3 or later.

npm install postcss-selector-parser@6.1.3
# if it is an indirect dependency: npm update postcss-selector-parser (or npm audit fix)
  • If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

postcss-selector-parser (npm)

Upgrade postcss-selector-parser to 7.1.3 or later.

npm install postcss-selector-parser@7.1.3
# if it is an indirect dependency: npm update postcss-selector-parser (or npm audit fix)
  • If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

Not sure whether your project uses an affected version? Check your lockfile below for free.

Details

A vulnerability was determined in postcss-selector-parser before 6.1.3 and 7.1.1. Affected is the function toString of the file src/selectors/container.js of the component AST Serialization. Executing a manipulation can lead to uncontrolled recursion. It is possible to launch the attack remotely. The exploit has been publicly disclosed and may be utilized. The vendor explains, that according to his definition "DoS on server-side on user-generated CSS is low risk for us (since most users compile own CSS with PostCSS)."

References

Am I affected?

Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.

or paste its content

Needed when you paste. package.json and pyproject.toml only have version ranges: use the lockfile next to them.

Only package names and versions are checked; the file itself is not kept. We use your email to send this report and nothing else unless you tick the box above. Privacy policy.

About this data

Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.