Skip to content
XSS Advisory Advanced CVE-2026-95369

Inappropriate implementation in XML (CVE-2026-95369)

Blink's XSLT implementation unintentionally registers libxslt extension elements such as xalan:write, which allows dynamic XPath compilation and evaluation of attacker-controlled strings before security checks. An attacker could use this to exercise the XPath parser on arbitrary runtime strings, expanding the renderer's attack surface.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 4 months

Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: Blink's XSLT implementation unintentionally registers several process-global libxslt extension elements, such as xalan:write, during stylesheet initialization. This exposure provides an attacker with a dynamic XPath evaluation primitive that processes runtime-computed strings before security checks are applied.

Affected files:

  • third_party/libxslt/src/libxslt/transform.c
  • third_party/libxslt/src/libxslt/extra.c
  • third_party/libxslt/src/libxslt/xslt.c
  • third_party/blink/renderer/core/xml/xslt_extensions.cc
  • third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc
  • third_party/blink/renderer/core/xml/xsl_style_sheet_libxslt.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Root Cause Analysis

Blink's XSLT processing relies on the libxslt library. While Blink aims to expose only a highly restricted set of XSLT extensions (specifically exsl:node-set), the underlying library's initialization process leads to the unintended registration of additional extension elements.

When a stylesheet is compiled (e.g., via XSLTProcessor.importStylesheet or XSLStyleSheet::CompileStyleSheet), the libxslt function xsltNewStylesheetInternal is eventually called. This function unconditionally invokes xsltInit(), which in turn calls xsltRegisterAllExtras(). This latter function populates a process-global hash table (xsltElementsHash) with several extension elements from the Apache Xalan and Saxon namespaces.

The Vulnerability: Unintended Dynamic XPath Evaluation

Among the registered extensions is xalan:write (namespace org.apache.xalan.xslt.extensions.Redirect). The implementation of this element in third_party/libxslt/src/libxslt/transform.c within the xsltDocumentElem function contains a logic path that facilitates dynamic XPath evaluation.

When xsltDocumentElem processes a write element with a select attribute:

  1. It evaluates the select attribute as an Attribute Value Template (AVT). This can include runtime-computed strings derived from the source document or variables.
  2. The resulting string is passed to xmlXPathCtxtCompile to be compiled as a new XPath expression at runtime.
  3. This compiled expression is then evaluated against the current context using xsltEvalXPathString.

Critically, this dynamic compilation and evaluation happen before the security gate xsltCheckWrite is reached (found later in the same function). While Blink's security policy (xsltSecurityForbid) correctly prevents the final file write operation, the attacker has already successfully triggered runtime XPath compilation and execution of a string they control.

Impact

This issue represents a defense-in-depth failure and an unintended expansion of the renderer's attack surface:

  1. Dynamic Evaluation Primitive: Web content gains access to a dynamic evaluation primitive (functionally similar to dyn:evaluate()) that the Chrome threat model assumes is unreachable.
  2. Attack Surface Expansion: The XPath parser (xmlXPathCtxtCompile) is normally used on literal substrings of a stylesheet. This vulnerability allows it to be exercised on arbitrary runtime-computed strings of unbounded length, increasing the risk of exploiting potential parser vulnerabilities.
  3. Bypass of Security Sequencing: Complex URI processing and XPath evaluation are performed on attacker-derived data before the intended security checks are executed.

Potential Trigger Steps

An attacker might attempt to trigger this behavior using a stylesheet similar to the following:

XML
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xalan="org.apache.xalan.xslt.extensions.Redirect"
  extension-element-prefixes="xalan">
 <xsl:template match="/">
   <!-- The 'select' attribute here will be dynamically compiled and evaluated as XPath -->
   <xalan:write select="{concat('count(//', name(*), ')')}"/>
 </xsl:template>
</xsl:stylesheet>

When this is processed via XSLTProcessor.transformToDocument(), the select attribute logic will trigger the dynamic compilation and evaluation in the renderer process.

Suggested Fix

Blink should prevent the global registration of these unintended extension elements. Possible solutions include:

  1. Modifying libxslt to make the registration of "extras" in xsltInit optional.
  2. Explicitly unregistering the Xalan and Saxon extensions from the global hash after xsltInit has run.
  3. Re-ordering the logic in xsltDocumentElem to ensure that security checks are performed before any dynamic XPath compilation or evaluation occurs.

Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, libxslt's global initialisation unconditionally registers extra extension elements, including xalan:write, which performs dynamic XPath compilation before the write security check.

Impact

The issue is a defence-in-depth failure that expands the renderer's attack surface by allowing dynamic XPath evaluation on attacker-controlled strings, though the final file write is still blocked by Blink's security policy.

What the attacker needed

Victim loads a malicious XSLT stylesheet; browser uses libxslt with extras enabled

The fix

Blink should prevent the global registration of unintended extension elements, for example by making libxslt's extra registration optional, unregistering them after initialisation, or reordering security checks before dynamic XPath compilation.

How it was found

  1. Create an XSLT stylesheet that declares the xalan namespace and uses the xalan:write element with a select attribute containing an Attribute Value Template.
  2. Load the stylesheet into the browser using XSLTProcessor.importStylesheet or equivalent.
  3. Trigger transformation with XSLTProcessor.transformToDocument(), causing the select attribute to be evaluated as an Attribute Value Template and the resulting string to be compiled and evaluated as XPath.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

XSLT is a language for transforming XML documents, and libxslt is a library that implements it. The report says that when a stylesheet is loaded, the browser accidentally enables extra features that let a web page ask the browser to evaluate a string as an XPath expression at runtime. This is dangerous because it gives attackers a way to run code-like expressions that the browser normally tries to block.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.