Skip to main content

Masterminds html5-php EUVDEUVD-2026-144255

| CVE-2026-144958 LOW
Cross-site Scripting (XSS) (CWE-79)
2026-12-04 VulnCheck GHSA-jr98-39q2-935f
2.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft HTML with quote in xmlns:x value
  2. Delivery
    Submit to app parsing untrusted HTML
  3. Exploit
    DOM-walking sanitizer misses namespace node
  4. Execution
    saveHTML re-serializes value unescaped
  5. Impact
    Injected 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.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

html5-php 0 <2.12.0

Affected Packages

euvd html5_php fix: 2.12.0

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

Vendor (VulnCheck) PRIMARY 2.3 LOW
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
vuln.today AI 4.7 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

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

Prevalence
Medium
popular PHP HTML5 parser library, bundled by Drupal and others
Social Media
1
Sightings
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Low

Priority Score

12
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

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

CVE-2012-1823 CRITICAL POC
9.8 May 11

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

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

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

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

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

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy