GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CVE-2026-104844 - GitHub Advisory Database

PostCSS: Quadratic complexity in flat selector parsing allows CPU exhaustion

Moderate severity GitHub Reviewed Published Sep 3, 2026 in postcss/postcss-selector-parser • Updated Oct 26, 2026

Package

postcss-selector-parser (npm)

Affected versions

>= 7.0.0, < 7.1.6
< 6.1.5

Patched versions

7.1.6
6.1.5

Description

Impact

. and # are not word delimiters in the tokenizer, so a flat selector such as
.a.a.a... reaches splitWord() as a single word token carrying n class or id
indexes. Three passes scanned those index arrays linearly for every index,
making the parse O(n^2) in the number of indexes rather than in input length:
uniqs(), the indices.forEach loop, and the Sass-interpolation filter.
Parsing a 400 KB flat selector took ~34 s on a modern laptop, fully occupying a
single thread. A benign selector of identical byte size parses in tens of
milliseconds, so the cost is driven by the index count, not the input size.
The nesting depth of such a selector is 0, so the maxNestingDepth guard added
in 7.1.3 offers no protection.

Reachability is deployment dependent. Only consumers that parse untrusted,
attacker-supplied selectors synchronously in a request path are exposed, for
example CSS sanitizers, CSS-in-JS services and online playgrounds. Ordinary
build-time use on trusted sources is not affected.

Patches

Fixed in 7.1.6. The three passes now use Set membership tests, making parsing
linear in the number of indexes. There is no behaviour change: parsing is
byte-identical on a differential corpus of 8413 selectors.

Workarounds

Cap the size of selectors accepted from untrusted sources before parsing.

References

  • GHSA-rj75-hqrm-r3gf
  • https://nvd.nist.gov/vuln/detail/CVE-2026-104844
  • postcss/postcss-selector-parser@62b1917
  • https://github.com/postcss/postcss-selector-parser/releases/tag/7.1.6
  • postcss/postcss-selector-parser#346
  • postcss/postcss-selector-parser@70b0779
  • https://github.com/postcss/postcss-selector-parser/releases/tag/6.1.5
@MoOx MoOx published to postcss/postcss-selector-parser Sep 3, 2026
Published by the National Vulnerability Database Oct 2, 2026
Published to the GitHub Advisory Database Oct 5, 2026
Reviewed Oct 5, 2026
Last updated Oct 26, 2026

Severity

Moderate
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

EPSS score

(34th percentile)

Weaknesses

Weakness CWE-400

Uncontrolled Resource Consumption

The product does not properly control the allocation and maintenance of a limited resource. Learn more on MITRE.
Weakness CWE-407

Inefficient Algorithmic Complexity

An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached. Learn more on MITRE.

CVE ID

CVE-2026-104844

GHSA ID

GHSA-rj75-hqrm-r3gf

Source code

postcss/postcss-selector-parser

Credits

  • @MoOx MoOx Analyst
  • @mikael-mattsson mikael-mattsson Analyst
  • @markscott-ms markscott-ms Analyst
  • @whataboutpereira whataboutpereira Analyst
Loading Checking history

Uh oh!

There was an error while loading. Please reload this page.

See something to contribute? Suggest improvements for this vulnerability.
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.