Description
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.
Published: 2026-04-24
Score: 6.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Cross‑Site Scripting
Action: Patch
AI Analysis

Impact

PostCSS versions older than 8.5.10 omit escaping the literal sequence </style> when converting an abstract syntax tree back into CSS text. When user‑supplied CSS is parsed and then re‑stringified for inclusion inside an HTML <style> element, the unescaped sequence ends the style block and allows embedding of arbitrary HTML or JavaScript, thereby creating a classic cross‑site scripting flaw. The weakness is a classic input validation failure (CWE‑79).

Affected Systems

The vulnerability affects the PostCSS library (postcss:postcss). All releases prior to 8.5.10 are impacted, as the remediation was introduced in 8.5.10. Systems that parse user CSS with PostCSS and subsequently embed it in page <style> tags are at risk.

Risk and Exploitability

The CVSS score of 6.1 places the flaw in the medium severity range. EPSS indicates an exploitation probability of less than 1 percent, and the vulnerability is not listed in the CISA KEV catalog, suggesting limited public exploitation. The likely attack vector is local or remote injection of CSS content that is processed by PostCSS and rendered into a web page; therefore, secure channels that allow arbitrary CSS to be processed by PostCSS and rendered into a web page pose a risk.

Generated by OpenCVE AI on April 28, 2026 at 14:26 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade PostCSS to version 8.5.10 or newer.
  • Validate or sanitize all user‑supplied CSS before parsing and avoid embedding raw CSS into <style> tags.
  • If untrusted CSS must be accepted, implement server‑side escaping of </style> sequences or use a rendering method that does not rewrite CSS from an AST back into a string.

Generated by OpenCVE AI on April 28, 2026 at 14:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-qx2v-qp2m-jg93 PostCSS has XSS via Unescaped </style> in its CSS Stringify Output
History

Mon, 27 Apr 2026 19:30:00 +0000

Type Values Removed Values Added
First Time appeared Postcss
Postcss postcss
Vendors & Products Postcss
Postcss postcss

Sun, 26 Apr 2026 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


Fri, 24 Apr 2026 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 24 Apr 2026 02:45:00 +0000

Type Values Removed Values Added
Description 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.
Title PostCSS has XSS via Unescaped </style> in its CSS Stringify Output
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-04-24T16:23:41.198Z

Reserved: 2026-04-20T14:01:46.670Z

Link: CVE-2026-41305

cve-icon Vulnrichment

Updated: 2026-04-24T16:23:25.257Z

cve-icon NVD

Status : Deferred

Published: 2026-04-24T03:16:11.547

Modified: 2026-04-24T17:16:21.500

Link: CVE-2026-41305

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-04-24T02:27:47Z

Links: CVE-2026-41305 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-04-28T14:30:33Z

Weaknesses