Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft HTML with quote in xmlns:x value
-
DeliverySubmit to app parsing untrusted HTML
-
ExploitDOM-walking sanitizer misses namespace node
-
ExecutionsaveHTML re-serializes value unescaped
-
ImpactInjected script executes in victim browser
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires a host application that (1) parses attacker-supplied HTML with masterminds/html5-php <= 2.11.0, (2) sanitizes the result by walking the DOM's exposed attributes, and (3) re-serializes the DOM back to HTML with saveHTML(). The attack specifically abuses an xmlns:* namespace-declaration value containing a double quote (e.g. xmlns:x='a"><img src=x onerror=alert(1)>'), because namespace declarations are not visible in DOMElement::attributes and so escape DOM-walking sanitizers, while OutputRules::namespaceAttrs emits the value into a double-quoted attribute without escaping. Limiting factors: it is inert in applications that do not re-serialize sanitized untrusted markup or that apply a final HTML-aware sanitizer pass after serialization; the CVSS high attack complexity, present attack requirement, and passive user interaction reflect that a victim must subsequently render the serialized output and that the specific sanitize-then-serialize pipeline must be in place. The only complete fix per the vendor is updating to 2.12.0; the stated workaround is to not re-serialize untrusted markup after DOM sanitization without a final HTML-aware sanitizer pass. |
| Impact | All signals point to low real-world urgency despite this being a genuine XSS escaping defect. The CVSS 4.0 score is 2.3 and the vendor-aligned priority decision is 'monitor' (not act_now/emergency). The vector (AV:N/AC:H/AT:P/PR:N/UI:P) combines network reach and no authentication with high complexity, a present attack requirement, and passive user interaction - meaning exploitation is remote and unauthenticated in principle but gated by conditions the attacker does not control. Crucially, the vendor advisory states exploitation requires a very specific host-application pattern: an app that parses untrusted HTML, sanitizes by walking the DOM, and then re-serializes with saveHTML(); namespace declarations are invisible to DOMElement::attributes, so attribute-walking sanitizers never inspect them. No CISA KEV listing and no EPSS score are present in the input, so there is no signal of active or probable widespread exploitation. The GHSA advisory includes a demonstration payload but no standalone exploit-code artifact is confirmed. Impact is bounded to low (VC:L/VI:L) because this is a markup-injection/attribute-breakout escaping bug in a serializer, not a parser-level RCE. Net: a real but low-priority, conditional issue - patch in normal cycles rather than treat as an emergency. |
| Exploit ScenarioDerived | An application accepts untrusted HTML, sanitizes it by walking the DOM (dropping dangerous attributes), then re-serializes the cleaned tree with saveHTML(). An attacker submits markup such as <p xmlns:x='a"><img src=x onerror=alert(1)>'>x</p>; because namespace declarations are not exposed as DOM attributes, the sanitizer never sees them, and OutputRules::namespaceAttrs writes the xmlns:x value unescaped, breaking out of the double-quoted attribute and emitting an injected element that executes script when the output is rendered in a victim's browser. A public PoC reference (the advisory's demonstration payload) exists; it is not verified as working exploit code. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Dec 04, 2026
Cross-site scripting in Masterminds html5-php through 2.11.0 allows an unauthenticated remote attacker to break out of an xmlns:* attribute during DOM re-serialization, but only inside a host application that parses untrusted markup, sanitizes it by walking DOMElement::attributes, and then re-serializes with saveHTML(). Because namespace declarations are not exposed in DOMElement::attributes, a crafted value such as xmlns:x='a"><img src=x onerror=alert(1)>' passes attribute-walking sanitizers and is emitted unescaped by OutputRules::namespaceAttrs, so the injected script executes when a victim later renders the saved output. The vendor fixed this in 2.12.0; no public exploit code was identified at time of analysis and the assessed priority is monitor, with the vulnerability inert in applications that do not re-serialize sanitized untrusted markup or that apply a final HTML-aware sanitizer pass after serialization.
RemediationAI
Vendor-released patch: 2.12.0. Upgrade the masterminds/html5 Composer dependency to 2.12.0 or later, which escapes xmlns:* namespace declaration values like ordinary attributes in OutputRules::namespaceAttrs, and also carries the companion fixes for the quadratic parse-error bookkeeping, the xmlNamespaces TypeError, and the invalid UTF-8 substitution; consult https://github.com/Masterminds/html5-php/security/advisories/GHSA-pj59-fvjc-74pp and the release at https://github.com/Masterminds/html5-php/releases/tag/2.12.0, and verify the change against https://github.com/Masterminds/html5-php/commit/c99252152ca8b1bdc821181d17a1f2c98e9fba1b. The vendor states that updating is the only complete fix; its stated workaround for this specific defect is to not re-serialize untrusted markup after DOM-based sanitization unless a final HTML-aware sanitizer pass is applied to the serialized output, accepting the added processing cost and the risk that a partially HTML-aware filter misses context-dependent payloads. For the accompanying namespace TypeError issue the vendor suggests avoiding xmlNamespaces=true on untrusted input or catching Throwable, and for the parse-error complexity issue it suggests capping input size before parsing.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
masterminds/html5 is a pure-PHP HTML5 parser and serializer used as a drop-in for DOMDocument::loadHTML, and the defect sits in the serializer rather than the parser: OutputRules::namespaceAttrs (lines 295-306 of OutputRules.php in 2.11.0) writes namespace declaration names and values into double-quoted attributes with no escaping, while ordinary attributes go through the escaping path. Namespace declarations are a special node type that PHP's DOMElement::attributes does not surface, so a sanitizer that enumerates element attributes during a DOM walk never inspects them, and a double quote inside the xmlns value therefore escapes the attribute context on output and injects arbitrary markup. The root cause maps to CWE-79 (improper neutralization of input during web page generation), with the important nuance that the library is explicitly a parser/serializer and not a sanitizer, so exploitation is conditional on the surrounding application's sanitize-then-serialize pipeline; the CVSS v3.1 assessment (AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N) reflects that a victim must subsequently render the serialized output and that the specific pipeline must be present. The upstream advisory GHSA-pj59-fvjc-74pp bundles this escaping defect with three other issues fixed in the same commit: quadratic parse-error bookkeeping in Scanner::currentLine/columnOffset (CWE-407), an uncaught TypeError when the non-default xmlNamespaces option encounters a malformed declaration (CWE-248), and invalid UTF-8 bytes being deleted rather than replaced with U+FFFD (CWE-176), which can join tokens across a raw-byte filter. The fix escapes xmlns values with ENT_QUOTES | ENT_XML1, advances line/column position incrementally, throws a DOMException instead of calling importNode(null), and sets mb_substitute_character(0xFFFD).
Know when PHP gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
Stored/reflected XSS reachable remotely without auth (AV:N/PR:N) but only via a specific sanitize-then-re-serialize pipeline and victim rendering (AC:H, UI:R), with scope change and low confidentiality/integrity impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
Masterminds html5-php before 2.12.0 contains a cross-site scripting vulnerability in OutputRules::namespaceAttrs, which writes xmlns:* namespace declaration values into double-quoted attributes without escaping. Attackers can supply HTML with an xmlns:x value containing a double quote to bypass DOM-walking sanitizers and inject script into output re-serialized with saveHTML.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
EUVD-2026-144255
GHSA-jr98-39q2-935f
NVD
CVE.org
Exploit-DB