Skip to main content

PostCSS Selector Parser CVE-2026-104844

| EUVDEUVD-2026-91741 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-10-02 GitHub_M GHSA-rj75-hqrm-r3gf
5.9
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach endpoint parsing untrusted selectors
  2. Delivery
    Send crafted flat selector payload
  3. Exploit
    Trigger quadratic scan in splitWord/uniqs
  4. Execution
    Pin synchronous parser thread
  5. Impact
    Deny service to legitimate users

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the consuming application synchronously parse attacker-controlled CSS selectors on an exposed/reachable request path (e.g., a runtime endpoint that feeds untrusted selector strings into parser().astSync or equivalent); the vendor states ordinary build-time parsing of trusted sources is NOT affected. The limiting factors are substantial: untrusted-input parsing at runtime is a non-default, developer-chosen integration pattern, exploitation is availability-only (no data exposure or integrity impact), and the maxNestingDepth guard provides no mitigation because the hostile selector has zero nesting depth. Authentication is not required (CVSS PR:N), so where the precondition holds, remote unauthenticated attackers can trigger it.

Impact

This is a moderate, conditional risk rather than a top-tier priority. The CVSS vector (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H, base 5.9) correctly captures the nature of the flaw: a network-reachable, unauthenticated availability-only CPU-exhaustion bug (CWE-400) with high attack complexity, because exploitation depends on an application choosing to synchronously parse attacker-controlled CSS selectors in an exposed request path - explicitly NOT the ordinary build-time, trusted-source usage that dominates deployments. There is no EPSS score, no KEV listing, and no weaponized exploit in the provided data (exploitation status: no public exploit identified at time of analysis); the GitHub commit ships regression/complexity tests, not a drop-in attack tool, so POC availability should not be treated as confirmed. The quadratic-parsing mechanism is well-documented and the payload is trivial to construct ('.a.a.a...'), which argues the bug is genuinely reproducible, but the narrow precondition (runtime parsing of untrusted selectors) sharply limits the real-world exploitable population. Net: a credible single-core DoS for the small subset of services that expose selector parsing to untrusted input, and effectively a non-issue for the large majority of consumers that parse only trusted CSS at build time. No key signals are directly conflicting, but the absence of EPSS/KEV/SSVC data means exploitation likelihood cannot be quantified from the input.

Exploit ScenarioDerived

An application exposes an HTTP endpoint that accepts user-supplied CSS selectors and parses them synchronously with postcss-selector-parser (for example a theming, CSS-sanitization, or query-builder feature). An unauthenticated attacker submits a single long flat selector such as '.a' repeated tens of thousands of times, triggering quadratic scanning in splitWord()/uniqs() and pinning a parser thread, degrading or denying service for other users. No public weaponized exploit is provided, but the fix's own complexity tests demonstrate the payload shape (a repeated atom as one word token).

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 02, 2026

A crafted flat CSS selector can stall a synchronous parser thread in postcss-selector-parser versions prior to 7.1.6, because class and ID index lists are scanned repeatedly inside parsing passes that should be linear, producing quadratic (O(n^2)) parse cost. Only consumers that synchronously parse untrusted selector strings on an exposed request path are affected; the vendor explicitly notes ordinary build-time parsing of trusted sources is not affected. The issue is remotely triggerable by unauthenticated attackers where that precondition holds (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H, 5.9), is availability-only with no confidentiality or integrity impact, and there is no public exploit code and no confirmed active exploitation (no KEV listing) at time of analysis. A vendor-released patch, version 7.1.6, is available.

RemediationAI

Upgrade to postcss-selector-parser 7.1.6, which is the vendor-released patch (release https://github.com/postcss/postcss-selector-parser/releases/tag/7.1.6); the fix is contained in commit 62b191792df0a0bc56062e5a875bc74aae2a51cd and replaces all linear index lookups with Set membership, so no API change is required. If an immediate upgrade is not possible, the most effective compensating control is to stop calling the parser synchronously on untrusted input: move selector parsing to a worker thread or child process with a hard CPU/wall-clock timeout, accepting the added operational complexity and the risk that a stalled worker still consumes a core unless the timeout terminates it. Where selectors must be parsed inline, add a pre-validation bottleneck before the parser - reject or truncate any single flat selector token exceeding a small length threshold (for example a few hundred characters or a bounded number of '.'/'#' indexes), or reject inputs whose class/ID index count is disproportionate to the number of whitespace-separated tokens - with the trade-off that legitimate very large generated selectors may be refused and thresholds must be tuned per application. Restricting the endpoint that accepts selector input to authenticated or trusted callers reduces the attack surface but does not remove the flaw, since CVSS records PR:N. Note that maxNestingDepth tuning is explicitly ineffective here because the hostile selector has zero nesting depth, and generic WAF signature blocking is likely unreliable against a payload that is syntactically valid CSS.

Affected VersionsENISA

postcss-selector-parser < 7.1.6

Affected Packages

npm postcss-selector-parser fix: 6.1.5, 7.1.6

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PostCSS Selector Parser is a standalone JavaScript CSS selector parser that integrates with PostCSS but does not depend on it. The defect is an uncontrolled resource consumption condition (CWE-400) rooted in the tokenizer: '.' and '#' are not treated as word delimiters, so a flat selector such as '.a.a.a.a...' or '#a#a#a...' arrives at Parser.splitWord() as a single word token that carries n class or ID indexes rather than n separate tokens. Three passes inside the parser then perform repeated linear scans over those index arrays: uniqs(), which deduplicated with Array.prototype.filter combined with indexOf; the indices.forEach loop, which called hasClass.indexOf and hasId.indexOf per index; and a separate Sass-interpolation filtering pass that called interpolations.indexOf per index. Each of these makes total work grow with the square of the number of indexes, so a sufficiently long hostile selector pins a CPU core for an attacker-chosen duration. The maxNestingDepth guard does not mitigate the issue because a flat selector has zero nesting depth. The upstream fix (commit 62b191792df0a0bc56062e5a875bc74aae2a51cd) replaces each linear lookup with Set-based membership (classIndexes, idIndexes, interpolationIndexes, and a Set-based uniqs()), restoring linear-time behavior while preserving first-occurrence ordering; regression tests assert that parsing one huge flat token costs less than roughly twice parsing the same atoms space-separated.

Know when Postcss gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 5.9 MEDIUM

AV:N and PR:N since an unauthenticated remote selector reaches the parser; AC:H because the victim app must synchronously parse untrusted selectors (non-default); impact is availability-only, so C:N/I:N/A:H.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 5.9 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch available
Oct 02, 2026 - 17:02 EUVD
CVE Published
Oct 02, 2026 - 15:43 cve.org
MEDIUM 5.9

DescriptionCVE.org

PostCSS Selector Parser is a CSS selector parser that integrates with PostCSS but does not require it. Prior to 7.1.6, src/parser.js splitWord() can receive a flat selector as one word token carrying many class or ID indexes because period and hash characters are not tokenizer word delimiters. The uniqs() deduplication and per-index class and ID membership checks repeatedly scan the class and ID index arrays, while a separate Sass-interpolation filtering pass also performs repeated linear scanning. Together, these passes make parsing quadratic in the number of indexes and allow a crafted selector to occupy a synchronous parser thread. The maxNestingDepth guard does not mitigate the issue because the hostile selector can have zero nesting depth. Only consumers that synchronously parse untrusted selectors in an exposed request path are affected; ordinary build-time parsing of trusted sources is not affected. This issue is fixed in version 7.1.6.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 25 npm packages depend on postcss-selector-parser (8 direct, 18 indirect)

Ecosystem-wide dependent count for version 7.0.0.

Threat Intelligence Overview

EPSS Score
0.4%
Top 69% exploitable
Prevalence
High
core PostCSS-ecosystem npm library, pulled into most JS frontend build chains
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy