CVE-2026-41305
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-41305 is a Cross-Site Scripting (XSS) vulnerability in PostCSS, a widely used CSS transformation tool, caused by failure to escape </style> sequences when stringifying CSS Abstract Syntax Trees (ASTs). Versions prior to 8.5.10 are affected. When user-submitted CSS containing </style> in CSS values is parsed and re-stringified for embedding in HTML <style> tags, the sequence breaks out of the style context and enables script injection. The vulnerability was published on April 24, 2026, with a fix released in PostCSS 8.5.10. It carries a CVSS v3.1 base score of 6.1 (Medium) (Github Advisory, PostCSS Release).

Technical details

The root cause is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation — Cross-Site Scripting). PostCSS's CSS stringifier does not sanitize or escape </style> sequences present in CSS property values when converting the AST back to a CSS string. If an application accepts user-supplied CSS, processes it through PostCSS, and embeds the output directly into an HTML <style> block, a malicious value such as body { content: "</style><script>alert(1)</script><style>"; } will cause the browser to prematurely close the <style> tag and execute the injected script. Exploitation requires no privileges but does require user interaction (the victim must load the page containing the injected CSS), and the scope is changed since the injected script executes in the browser context of the victim (Github Advisory). A public proof-of-concept is included in the security advisory (Github Advisory).

Impact

Successful exploitation allows an attacker to inject and execute arbitrary JavaScript in the context of a victim's browser session, leading to low-level confidentiality and integrity impacts such as session token theft, credential harvesting, or unauthorized actions on behalf of the user. The vulnerability primarily affects non-bundler use cases where PostCSS processes user-submitted CSS that is then embedded in server-rendered HTML pages; bundler pipelines are generally not affected. Availability is not impacted, but the changed scope means the attack can affect resources beyond the vulnerable component itself (Github Advisory).

Exploitability

A public proof-of-concept is included in the GitHub Security Advisory, demonstrating the issue with PostCSS v8.5.5 on Node.js v22 (Github Advisory). There is no evidence of in-the-wild exploitation or threat actor attribution at this time. The EPSS score is approximately 0.029% (0.000290), indicating a low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires that a PostCSS plugin or application pipeline accepts and re-embeds user-controlled CSS in HTML without additional sanitization.

Exploitation steps

  1. Identify a target application: Find a web application that accepts user-submitted CSS input, processes it through PostCSS (version < 8.5.10), and embeds the stringified output directly into an HTML <style> tag in a server-rendered page.
  2. Craft a malicious CSS payload: Construct a CSS value containing a </style> sequence followed by a script tag, for example:
    body { content: "</style><script>alert(document.cookie)</script><style>"; }
  3. Submit the payload: Provide the malicious CSS as user input through whatever mechanism the application exposes (e.g., a theme customizer, CSS editor, or API endpoint).
  4. Trigger PostCSS processing: The application parses the CSS with PostCSS and calls .toResult().css or equivalent to re-stringify the AST. The </style> sequence is passed through unescaped.
  5. Deliver to victim: The server embeds the stringified CSS into an HTML page: <style>body { content: "</style><script>alert(document.cookie)</script><style>"; }</style>. When a victim loads the page, the browser closes the <style> tag at the injected </style>, and the <script> block executes arbitrary JavaScript in the victim's browser context (Github Advisory).

Indicators of compromise

  • Network: HTTP requests to CSS submission endpoints containing URL-encoded or raw </style> sequences (e.g., %3C%2Fstyle%3E) in CSS-related parameters or request bodies.
  • Logs: Server-side access logs showing POST requests to CSS processing or theme customization endpoints with payloads containing </style> or <script> strings; application logs showing PostCSS processing of inputs with these sequences.
  • File System: Cached or stored CSS files on the server containing unescaped </style> sequences within CSS property values.
  • Browser/Client: Unexpected JavaScript execution (e.g., alert dialogs, outbound requests to attacker-controlled domains) triggered when loading pages with embedded <style> blocks; browser developer tools showing prematurely closed <style> tags in page source.

Mitigation and workarounds

The primary remediation is to upgrade PostCSS to version 8.5.10 or later, which escapes </style> sequences during CSS stringification (PostCSS Release). If an immediate upgrade is not possible, applications should sanitize or escape </style> sequences in CSS output before embedding it in HTML <style> tags. Additionally, implementing a Content Security Policy (CSP) can reduce the impact of XSS exploitation. IBM has issued advisories for affected products including watsonx.data, watsonx Orchestrate, App Connect Enterprise, IBM Quantum Safe Remediator, and Maximo Application Suite, and users of those products should apply the relevant IBM security bulletins (IBM watsonx.data, IBM Maximo).

Community reactions

IBM issued multiple security bulletins acknowledging the impact of CVE-2026-41305 on several of its enterprise products, including watsonx.data, watsonx Orchestrate, App Connect Enterprise, IBM Quantum Safe Remediator, and Maximo Application Suite (IBM watsonx.data, IBM Maximo). Red Hat also tracked the vulnerability via Bugzilla. The fix was contributed by community researcher @TharVid and merged into the PostCSS 8.5.10 release (PostCSS Release). No significant broader media coverage or notable social media discussion has been identified beyond standard vulnerability tracking.

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-77415CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NoYesAug 21, 2026
CVE-2026-77414CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NoYesAug 21, 2026
CVE-2026-77413CRITICAL9.3
  • JavaScript logoJavaScript
  • jsonata
NoYesAug 21, 2026
CVE-2026-63421HIGH7.5
  • JavaScript logoJavaScript
  • @keystone-6/core
NoYesAug 21, 2026
CVE-2026-53509MEDIUM5.7
  • JavaScript logoJavaScript
  • @aborruso/ckan-mcp-server
NoYesAug 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management