Insufficient policy enforcement in XML (CVE-2026-13954)
Blink's XSLT stylesheet parsing path could skip the security callbacks that normally restrict libxml2's external entity loading, and comment serialisation did not escape the comment terminator, so an injected DTD could be parsed. On Android this could let a malicious page read files accessible to the renderer process.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 47 days
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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential XML External Entity (XXE) vulnerability exists in Blink's XSLT implementation due to missing security callback initialization and unescaped comment serialization. This could allow a malicious website to read local files from the renderer process's filesystem on platforms like Android.
Affected files:
third_party/blink/renderer/core/xml/xsl_style_sheet_libxslt.ccthird_party/blink/renderer/core/editing/serializers/markup_formatter.ccthird_party/blink/renderer/core/xml/xslt_processor_libxslt.ccthird_party/blink/renderer/core/xml/parser/xml_document_parser.cc
Estimated timestamp from git blame: 2013-08-23
Summary
A potential vulnerability in Blink's XSLT implementation may allow for XML External Entity (XXE) attacks, enabling an attacker to read files from the renderer's local filesystem. The issue stems from a failure to initialize Blink's secure libxml2 IO callbacks before parsing a stylesheet, combined with a lack of escaping when serializing XML comments.
Root Cause Analysis
Blink typically protects against libxml2's default behavior of loading external entities by registering specialized IO callbacks (e.g., MatchFunc, OpenFunc) via EnsureLibXMLInitialized() in third_party/blink/renderer/core/xml/parser/xml_document_parser.cc. These callbacks enforce security policies like same-origin checks and prohibit direct filesystem access.
However, XSLStyleSheet::ParseString in third_party/blink/renderer/core/xml/xsl_style_sheet_libxslt.cc fails to call EnsureLibXMLInitialized(). If ParseString is invoked in a fresh renderer process before any other XML parsing has occurred, libxml2 will use its default, insecure IO handlers. On Android, the renderer's seccomp policy explicitly allows the openat syscall (see sandbox/linux/seccomp-bpf-helpers/baseline_policy_android.cc), allowing these default handlers to read local files.
Furthermore, the XSLTProcessor.importStylesheet() API uses CreateMarkup to serialize the provided DOM tree. In third_party/blink/renderer/core/editing/serializers/markup_formatter.cc, the AppendComment method (line 274) does not escape the comment closer -->, allowing an attacker to inject a malicious DTD directly into the serialized XML string that ParseString then parses.
Potential Attack Steps
An attacker could potentially trigger this vulnerability using the following steps:
- Create a malicious XML document containing a Comment node with a payload like:
--> <!DOCTYPE x [<!ENTITY f SYSTEM "file:///proc/self/status">]> <xsl:stylesheet ...> ... &f; ... </xsl:stylesheet> <!--. - Call
XSLTProcessor.importStylesheet(malicious_doc). This triggers the insecure serialization inAppendCommentand the subsequent vulnerable parse inParseString. - Call
transformToFragment()ortransformToDocument(). The XSLT engine will execute the injected stylesheet, resolving the&f;entity to the contents of/proc/self/statususing libxml2's default IO handlers. - Read the leaked data from the resulting fragment or document's text content.
Impact
This is an information disclosure vulnerability. On Android, an attacker can potentially read any file accessible to the renderer process (e.g., /proc/self/maps, /proc/self/status), which can be used to leak ASLR offsets and facilitate a full renderer exploit chain. On other platforms like Linux, while the logic flaw exists, seccomp typically blocks the open() syscall, mitigating direct file access.
Suggested Fix
- In
XSLStyleSheet::ParseString, ensureEnsureLibXMLInitialized()is called before any libxml2 parsing functions. - In
MarkupFormatter::AppendComment, implement proper escaping or validation to ensure that the comment data does not contain the-->sequence.
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.
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 the XSLT stylesheet parse path never initialised Blink's secure libxml2 IO callbacks, and comment serialisation failed to escape the comment terminator, letting an attacker inject a DTD into the parsed string.
Impact
On Android an attacker could potentially read files accessible to the renderer, leaking memory layout details useful for a fuller exploit chain, while on Linux seccomp typically blocks the file open and mitigates direct access.
What the attacker needed
Victim visits a malicious page; fresh renderer with no prior XML parse; Android renderer seccomp allows openat
The fix
The report suggests initialising the secure libxml2 callbacks before parsing a stylesheet and escaping or validating comment data so it cannot contain the comment terminator.
How it was found
- Build an XML document whose comment node contains a DTD declaring an external entity pointing at a local file, followed by a stylesheet that references it.
- Pass that document to the XSLTProcessor importStylesheet API, which serialises it and parses the result.
- Run a transform to a fragment or document so the entity is resolved.
- Read the leaked file contents from the resulting output.
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.
XML documents can declare 'entities', which are placeholders that get replaced by other content, and they can point at files on the machine. A parser that follows those pointers without checks will happily paste a local file into the output. Here the browser's usual guard against that was not switched on in one code path, so a crafted page might read files the browser process can see.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.