CVE-2026-97045 in net-htmlinfo

Summary

by MITRE • 10/27/2026

In childTextNodesAreLiteral, walking up the tree previously stopped at the nearest foreign ancestor once an HTML integration point was found. However, that integration point may itself be a descendant of an element that was foster-parented into a foreign namespace (such as <mglyph> or <malignmark> fostered under <mtext>), causing a parser to resolve the subtree in a different foreign namespace upon re-parsing the rendered output. Continue walking the full ancestor chain and verify that every transition from a non-empty namespace occurs at an HTML integration point before emitting literal text.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 10/27/2026

The vulnerability described involves a logic error within the childTextNodesAreLiteral function, which is responsible for determining whether text nodes in a document tree can be treated as literal content rather than being subject to further parsing or transformation rules. This determination is critical for maintaining consistency between how an HTML parser initially processes raw markup and how it handles rendered output when that output is re-parsed. The core flaw lies in the traversal logic used to identify namespace contexts during this evaluation process. Specifically, the algorithm previously halted its upward walk through the DOM tree as soon as it encountered a foreign ancestor associated with an HTML integration point. While this optimization might seem efficient, it fails to account for complex structural manipulations such as foster parenting, where elements are moved into different namespaces or parent structures than originally specified in the source markup.

Foster parenting is a mechanism used by HTML parsers to handle malformed content, particularly within MathML and SVG contexts embedded in HTML documents. For instance, an element like mglyph or malignmark may be foster-parented under mtext when encountered in certain invalid positions. This structural change alters the namespace context of those elements relative to their original position in the source tree. When the parser re-parses rendered output, it relies on accurate ancestry chains to determine whether text should be interpreted as literal data or parsed according to specific namespace rules. By stopping the ancestor walk prematurely at an integration point, the parser incorrectly assumes that no further namespace transitions occur above that point. This oversight leads to a scenario where the subtree is resolved in a different foreign namespace than intended during re-parsing, creating a discrepancy between initial parsing and subsequent processing phases.

This inconsistency can have significant operational impacts on web applications relying on dynamic content generation or server-side rendering of HTML fragments containing MathML or SVG elements. If text nodes are incorrectly classified as literal when they should be parsed, or vice versa, it may lead to incorrect rendering, security bypasses in sanitization logic, or unexpected behavior in client-side scripts that depend on precise DOM structure and namespace awareness. Such discrepancies can also affect accessibility features and data integrity checks that rely on consistent parsing outcomes across different stages of content processing. The issue highlights the importance of rigorous validation of ancestry chains when dealing with mixed-content documents where multiple namespaces interact through integration points defined by HTML specifications.

To mitigate this vulnerability, developers must ensure that the traversal logic in childTextNodesAreLiteral continues walking up the full ancestor chain rather than stopping at the first encountered foreign ancestor or integration point. It is essential to verify that every transition from a non-empty namespace occurs specifically at an HTML integration point before emitting literal text. This ensures that all potential namespace shifts due to foster parenting and other structural adjustments are correctly accounted for in the final classification of text nodes. Implementing this fix aligns with best practices outlined in CWE-841, which addresses improper enforcement of parsing rules leading to inconsistent behavior, and mitigates risks associated with ATT&CK technique T1059, where attackers might exploit parser inconsistencies to execute unintended code or bypass security controls embedded within dynamic content processing pipelines.

Responsible

Go

Reservation

09/24/2026

Disclosure

10/27/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you know our Splunk app?

Download it now for free!