Skip to content
XSS Advisory Advanced CVE-2026-11150

Inappropriate implementation in XML (CVE-2026-11150)

A logic error in Chromium's XML fragment parser causes nested null-namespace declarations to be tracked with a single pointer instead of a stack, so closing an inner element clears the state for outer elements. This can make subsequent sibling elements inherit the context's default namespace, turning inert XML elements into live HTML elements and enabling mutation XSS that bypasses XML-aware sanitizers.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 53 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: A logic error in Chromium's XML fragment parser fails to correctly track nested null-namespace declarations (xmlns="") because it uses a single pointer instead of a stack. When an inner element with a null namespace is closed, the parser erroneously clears the namespace reset state, causing subsequent sibling elements to incorrectly inherit the context's default namespace (e.g., XHTML). This namespace confusion provides a potential mutation XSS (mXSS) primitive that can bypass XML-aware HTML sanitizers.

Affected files:

  • third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
  • third_party/blink/renderer/core/xml/parser/xml_document_parser_rs.cc
  • third_party/blink/renderer/core/xml/parser/xml_document_parser.h
  • third_party/blink/renderer/core/xml/parser/xml_document_parser_rs.h

Estimated timestamp from git blame: 2025-12-02

Description

There is a potential namespace confusion vulnerability in Blink's XML fragment parsing logic (XMLDocumentParser and its Rust equivalent XMLDocumentParserRs). When injecting markup via fragment APIs like innerHTML, Blink attempts to fix up namespace URIs that libxml2 leaves blank.

To prevent the context's default namespace (e.g., the XHTML namespace) from incorrectly applying to elements that explicitly reset the namespace to null via xmlns="", the parser tracks the ancestor element that triggered the reset using a member variable: ancestor_resetting_namespace_.

However, this member is implemented as a single pointer rather than a stack. If an attacker nests elements that declare xmlns="", the inner element overwrites ancestor_resetting_namespace_. When the inner element is closed, EndElementNs clears the pointer to nullptr. This permanently loses the state of the outer namespace-resetting element. As a result, subsequent sibling elements that should be in the null namespace are erroneously promoted to the context's default namespace (e.g., http://www.w3.org/1999/xhtml), instantiating them as live HTML elements rather than inert XML elements.

Affected Code

  • third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
  • third_party/blink/renderer/core/xml/parser/xml_document_parser_rs.cc

In both files, StartElementNs overwrites the pointer without saving the previous state:

C++
if (parsing_fragment_ && encountered_namespace_reset) {
  ancestor_resetting_namespace_ = new_element;
}

And EndElementNs blindly clears it:

C++
if (ancestor_resetting_namespace_ == n) {
  ancestor_resetting_namespace_ = nullptr;
}

Potential Attacker Steps

Note: These are suggested steps based on static code analysis. Our tooling agent does not currently possess the ability to execute code or run a live proof-of-concept.

  1. An attacker crafts a payload containing nested xmlns="" declarations, for example: <a xmlns=""><b xmlns="">x</b><iframe srcdoc="&lt;script&gt;alert(document.domain)&lt;/script&gt;"></iframe></a>
  2. The payload is supplied to a web application that sanitizes input using an XML-aware sanitizer (like DOMPurify).
  3. The sanitizer parses the payload as a full document. Full document parsing relies on libxml2's robust namespace tracking (bypassing Blink's fragment fixup logic). The sanitizer correctly observes the <iframe> as an inert XML element in the null namespace and permits the srcdoc attribute to pass through unmodified.
  4. The application takes the sanitized string and injects it into an active XML/XHTML document using a fragment parsing API, such as document.getElementById('target').innerHTML = sanitized_string;, where the target element possesses an XHTML default namespace.
  5. During fragment parsing, <b> overwrites ancestor_resetting_namespace_ and subsequently clears it upon closing.
  6. When the parser reaches the <iframe>, ancestor_resetting_namespace_ is nullptr. The parser incorrectly falls back to the target's default XHTML namespace, instantiating an executable HTMLIFrameElement.
  7. The srcdoc script executes in the context of the application's domain, resulting in Mutation XSS (mXSS).

Suggested Fix

Replace the single Member<ContainerNode> ancestor_resetting_namespace_ pointer with a stack (e.g., HeapVector<Member<ContainerNode>>), or track the depth/count of namespace resets.

  • In StartElementNs, if a namespace reset is encountered, push the new element onto the stack.
  • When checking for namespace resets during URI fixup, evaluate if the stack is non-empty.
  • In EndElementNs, if the closing element matches the top of the stack, pop it off, thereby restoring the previous namespace-resetting context.

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.

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 the parser stores the ancestor that reset the namespace in a single pointer instead of a stack, so nested resets overwrite and then clear the state needed for outer elements.

Impact

This could allow mutation XSS, executing a script in the application's domain, but the report is based on static analysis and no live proof-of-concept was run.

What the attacker needed

Application uses an XML-aware sanitizer; sanitizer parses payload as a full document; sanitized string injected via fragment API; target element has XHTML default namespace

The fix

The single pointer should be replaced with a stack that pushes on namespace reset and pops when the matching element closes.

How it was found

  1. Craft a payload with nested elements that reset the namespace to null and an iframe with a srcdoc script.
  2. Pass the payload to an application that sanitizes it with an XML-aware sanitizer.
  3. The sanitizer parses it as a full document and treats the iframe as an inert XML element, allowing the srcdoc attribute.
  4. The application injects the sanitized string into an XHTML document using a fragment parsing API such as innerHTML.
  5. During fragment parsing, the inner namespace-resetting element clears the parser's state.
  6. The parser then treats the iframe as an HTML element in the XHTML namespace, and the srcdoc script executes.

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.

When a web page inserts HTML from a string, the browser has to decide which namespace each element belongs to. A namespace is a label that tells the browser whether an element is real HTML (which can run scripts) or just inert XML. The parser used one variable to remember a namespace reset, so nested resets confused it and made an inert element become active HTML, which could run a script.

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.