Inappropriate implementation in XML (CVE-2026-11169)
The experimental Rust XML lexer fails to reset its internal state when a stream ends immediately after certain characters such as a slash. An attacker could align network chunk boundaries to cause a duplicate character, creating a parsing differential that may bypass server-side sanitizers and lead to XSS or SSRF.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 51 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 without the Chrome Security team.
Overview: The experimental Rust XML lexer (xml-v1 crate) fails to reset its internal state when reaching the end of a stream immediately after certain characters, such as /. When parsing resumes with the next network chunk, this stale state causes the lexer to emit a duplicate character token. An attacker can exploit this parsing differential by aligning network chunk boundaries to bypass server-side sanitizers.
Affected files:
third_party/rust/chromium_crates_io/vendor/xml-v1/src/reader/lexer.rsthird_party/rust/chromium_crates_io/vendor/xml-v1/src/reader/parser.rsthird_party/blink/renderer/core/xml/parser/xml_ffi.rs
Estimated timestamp from git blame: 2025-10-07
Description
A state machine logic flaw exists in the xml-v1 Rust crate, which is used by Chrome's experimental Rust XML parser (enabled via the XMLRustForNonXslt feature). The lexer improperly handles end-of-stream (EOF) scenarios when the stream abruptly ends in specific intermediate states, such as immediately after a / character.
In third_party/rust/chromium_crates_io/vendor/xml-v1/src/reader/lexer.rs, when the lexer reads a /, it transitions to State::EmptyTagClosing. If the stream ends at this exact point (e.g., at a network chunk boundary), the end_of_stream() method is invoked:
fn end_of_stream(&mut self) -> Result<Token> {
// ...
match self.st {
// ...
State::EmptyTagClosing =>
Ok(Token::Character('/')),
// ...
The lexer correctly returns Token::Character('/'), but it fails to reset its internal state self.st to State::Normal.
Chrome configures the parser with ignore_end_of_stream(true) to support streaming data (in third_party/blink/renderer/core/xml/parser/xml_ffi.rs). This means EOF is treated as a temporary pause, allowing parsing to resume when more data arrives.
When the next chunk of data arrives, the lexer resumes, but it is still trapped in State::EmptyTagClosing. It reads the next character (e.g., y). Because it is not >, the empty_element_closing() method pushes the y back onto the unread queue and returns a second Token::Character('/'). The parser then reads the unread y, resulting in the characters //y instead of /y.
Potential Security Impact
This flaw creates a parsing differential between Chrome's streaming XML parser and atomic server-side parsers or sanitizers. An attacker can craft a malicious XML/SVG payload to bypass security filters.
For example, if an application validates that an href attribute is a safe relative URL (e.g., x/y.com), an attacker can split the payload using HTTP chunked transfer encoding right after the /. The sanitizer, seeing the full stream, validates x/y.com. Chrome, processing in chunks, duplicates the slash and parses the attribute as x//y.com—a protocol-relative absolute URL. This can lead to Cross-Site Scripting (XSS) or Server-Side Request Forgery (SSRF) bypasses.
Potential Steps to Trigger
(Note: These are suggested steps to trigger the vulnerability based on code analysis; our tooling agent does not run live exploit code.)
- Ensure the
XMLRustForNonXsltBlink feature is enabled in Chrome. - An attacker sets up an HTTP server that serves an
image/svg+xmldocument using chunked transfer encoding. - The attacker sends the first chunk, splitting the payload precisely after a forward slash:
- Chunk 1:
<svg xmlns="http://www.w3.org/2000/svg"><a href="x/
- Chunk 1:
- Chrome receives the chunk, the lexer reads
/, moves toEmptyTagClosing, hits EOF, emits the first/, and pauses. - The attacker sends the second chunk:
- Chunk 2:
evil.com"></a></svg>
- Chunk 2:
- Chrome resumes parsing. Being stuck in
EmptyTagClosing, the lexer readse, emits a second/, unreadse, and then continues normally. - The resulting DOM contains an anchor tag with
href="x//evil.com".
Suggested Fix
In third_party/rust/chromium_crates_io/vendor/xml-v1/src/reader/lexer.rs, update the end_of_stream() method to ensure the lexer state is properly reset to State::Normal when flushing intermediate character tokens.
fn end_of_stream(&mut self) -> Result<Token> {
// ...
match self.st {
// ...
State::EmptyTagClosing => {
self.st = State::Normal;
Ok(Token::Character('/'))
},
State::CommentClosing(ClosingSubstate::First) => {
self.st = State::Normal;
Ok(Token::Character('-'))
},
State::InvalidCDataClosing(ClosingSubstate::First) => {
self.st = State::Normal;
Ok(Token::Character(']'))
},
// ...
Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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
The lexer's end-of-stream handler returns a character token without resetting the internal state to Normal, so parsing resumes in the wrong state and emits a duplicate character.
Impact
This could allow an attacker to bypass server-side sanitizers and achieve XSS or SSRF, but only when the experimental XMLRustForNonXslt feature is enabled.
What the attacker needed
XMLRustForNonXslt feature enabled; attacker controls HTTP server; victim loads crafted SVG
The fix
The end_of_stream method should reset the lexer state to Normal when flushing intermediate character tokens.
How it was found
- Enable the XMLRustForNonXslt Blink feature in Chrome.
- Set up an HTTP server that serves an SVG document using chunked transfer encoding.
- Send the first chunk, splitting the payload right after a forward slash.
- Chrome reads the slash, enters EmptyTagClosing, hits end of stream, emits the first slash, and pauses.
- Send the second chunk containing the rest of the payload.
- Chrome resumes, emits a second slash, and the resulting DOM contains a protocol-relative URL.
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.
A parser reads XML in pieces as data arrives over the network. This parser had a bug where, if a piece ended right after a slash, it forgot to reset its internal state and later produced an extra slash. That difference between what a server checks and what the browser sees could let a malicious link slip past a filter.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.