Skip to main content

PostCSS CVE-2026-41305

| EUVDEUVD-2026-25383 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-04-24 GitHub_M GHSA-qx2v-qp2m-jg93
6.1
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Recon
    Attacker submits CSS with `</style>`
  2. Delivery
    Application parses with vulnerable PostCSS
  3. Exploit
    PostCSS stringifies without escaping `</style>`
  4. Install
    Application embeds unescaped string in HTML `<style>` tag
  5. C2
    Browser exits style context at `</style>`
  6. Execute
    Attacker-controlled HTML/JS executes
  7. Impact
    XSS payload activates

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

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

Exploitation Conditions

The vulnerability requires that user-submitted or untrusted CSS be parsed by PostCSS and re-stringified for direct embedding in HTML <style> tags without additional escaping or sanitization. Exploitation specifically depends on the application treating PostCSS-stringified output as safe for direct insertion into HTML. If the application already performs HTML entity encoding on stringified CSS output, or restricts CSS parsing to trusted sources, the vulnerability is effectively mitigated. The </style> sequence must appear in a CSS value context (property value, URL, string literal, etc.) rather than as a selector, as that is where parsing leaves it unescaped. Applications that use PostCSS solely for analysis or transformation without re-embedding stringified output in HTML are not at risk. The vulnerability exists in versions before 8.5.10; version 8.5.10 and later properly escape the closing tag sequence.

Impact

CVSS 6.1 (AV:N/AC:L/PR:N/UI:R/S:C) indicates network-accessible XSS with low attack complexity, no authentication, and cross-site scope, but requires user interaction (UI:R). The user interaction requirement significantly reduces real-world risk compared to a direct CVSS score might suggest - exploitation requires either a user to submit CSS through an application feature or social engineering to visit a malicious site. No EPSS score, CVSS variant data, or exploitation confirmation (KEV, POC) was provided in the input, so exploitation probability cannot be quantified. However, the attack vector is straightforward: any web application accepting user-submitted CSS and using PostCSS to process it for re-embedding in HTML is vulnerable. The XSS scope is cross-site (S:C), meaning the attacker can affect resources beyond the vulnerable application's immediate context. The fix is available and straightforward (version 8.5.10), reducing exploitation likelihood in patched environments. In unpatched deployments processing untrusted CSS, this represents a real XSS risk, though the UI:R requirement limits it to targeted or social-engineering attacks rather than broad automated exploitation.

Exploit ScenarioDerived

A web application allows users to customize website styling by uploading or pasting CSS. An attacker submits CSS containing background-image: url('</style><script>alert("XSS")</script>') or similar payload in a CSS declaration. When the application parses this with PostCSS and re-stringifies it for embedding in an HTML <style> tag, the </style> sequence breaks out of the style context, causing the injected <script> tag to execute in the victim's browser.

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

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

Alert me

AnalysisAIv1 – Apr 24, 2026

PostCSS versions prior to 8.5.10 fail to escape </style> sequences when stringifying CSS Abstract Syntax Trees, allowing cross-site scripting (XSS) attacks when user-submitted CSS is embedded in HTML <style> tags. An attacker can inject CSS containing </style> sequences in property values to break out of the style context and execute arbitrary JavaScript in the victim's browser. This requires user interaction (UI:R) and affects applications that parse untrusted CSS and re-stringify it for embedding in HTML documents.

RemediationAI

Upgrade PostCSS to version 8.5.10 or later immediately. For applications that cannot upgrade immediately, implement input validation by rejecting CSS containing the literal string </style> before passing to PostCSS, or implement output encoding by HTML-escaping the stringified CSS before embedding in <style> tags (replacing < with &lt;, > with &gt;). Note that output encoding adds a minor performance cost and modifies the stringified output, potentially affecting CSS parsing if not applied correctly. The recommended fix is upgrading to 8.5.10, which addresses the root cause by properly escaping </style> sequences during stringification. Consult https://github.com/postcss/postcss/security/advisories/GHSA-qx2v-qp2m-jg93 and https://github.com/postcss/postcss/releases/tag/8.5.10 for official remediation guidance.

Affected VersionsENISA

postcss < 8.5.10

Affected Packages

npm postcss fix: 8.5.10

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 is a JavaScript tool that parses CSS into an Abstract Syntax Tree (AST), allowing programmatic analysis and transformation of CSS rules. The vulnerability resides in the AST stringification process, which converts the parsed AST back into CSS text for embedding in HTML documents. When CSS containing </style> sequences in property values (e.g., background-image URLs, content properties, or other string-valued declarations) is re-stringified without proper escaping, the closing tag breaks out of the HTML <style> context, allowing subsequent HTML or JavaScript to be interpreted. This is a classic context-escape vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation) where the tool fails to account for the embedding context's special characters. The issue affects any application using PostCSS versions before 8.5.10 to process untrusted CSS.

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

GitHub Advisory PRIMARY 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Red Hat 6.1 MEDIUM

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

3
Patch released
Apr 24, 2026 - 17:16 nvd
Patch available
Patch available
Apr 24, 2026 - 05:31 EUVD
CVE Published
Apr 24, 2026 - 02:27 nvd
MEDIUM 6.1

DescriptionGitHub Advisory

PostCSS takes a CSS file and provides an API to analyze and modify its rules by transforming the rules into an Abstract Syntax Tree. Versions prior to 8.5.10 do not escape </style> sequences when stringifying CSS ASTs. When user-submitted CSS is parsed and re-stringified for embedding in HTML <style> tags, </style> in CSS values breaks out of the style context, enabling XSS. Version 8.5.10 fixes the issue.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.0%
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
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
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

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Vendor StatusVendor

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