Skip to main content

HTML::Gumbo CVE-2025-15646

| EUVDEUVD-2025-210396 CRITICAL
Access of Resource Using Incompatible Type (Type Confusion) (CWE-843)
2026-07-01 CPANSec GHSA-754r-h5mg-r795
9.8
CVSS 3.1 · Vendor: CPANSec
Share

Severity by source

Vendor (CPANSec) PRIMARY
9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI
7.5 HIGH

Unauthenticated attacker-controlled HTML triggers the over-read (AV:N/AC:L/PR:N/UI:N), but the effect is a bounded read-only heap disclosure, so C:H with no integrity or availability impact.

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

Primary rating from Vendor (CPANSec).

CVSS VectorVendor: CPANSec

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Source Code Evidence Fetched
Jul 22, 2026 - 18:45 vuln.today
Analysis Generated
Jul 22, 2026 - 18:45 vuln.today
CVE Published
Jul 01, 2026 - 14:38 cve.org
UNKNOWN (no severity yet)
CVE Published
Jul 01, 2026 - 14:38 cve.org
CRITICAL 9.8

DescriptionCVE.org

HTML::Gumbo versions before 0.19 for Perl disclose heap memory via type confusion.

Support for the <template> element was added to libgumbo 0.10.0 in 2015, but the walk_tree function in lib/HTML/Gumbo.xs was not updated to support it. The element was treated as a text-node, where strlen() over-reads the heap block that the pointer addresses.

Any caller that runs parse() with the default format => 'string', or with format => 'tree', on input containing a <template> element serializes the over-read bytes into the returned result, disclosing bounded heap contents. format => 'callback' reaches a croak on the unhandled node type and is unaffected.

AnalysisAI

Heap memory disclosure in the Perl HTML::Gumbo module before 0.19 lets remote attackers leak bounded chunks of process heap by submitting HTML containing a <template> element. The XS binding's walk_tree function misclassifies the template node as a text node and runs strlen() past the intended buffer, serializing the over-read bytes into parse() output. No public exploit is identified at time of analysis, and EPSS is low (0.66%), but exploitation is automatable and the flaw is trivially triggerable against any service that parses untrusted HTML with the default settings.

Technical ContextAI

HTML::Gumbo is a Perl XS wrapper around Google's libgumbo HTML5 parsing library. libgumbo 0.10.0 (2015) introduced a dedicated GUMBO_NODE_TEMPLATE node type for the HTML <template> element, but the wrapper's walk_tree function in lib/HTML/Gumbo.xs only recognized GUMBO_NODE_DOCUMENT and GUMBO_NODE_ELEMENT, so template nodes fell through to the text-node handling path. That path calls strlen() on a pointer that does not address a NUL-terminated text buffer, causing a heap over-read. This is the classic CWE-843 (Type Confusion / Access of Resource Using Incompatible Type) pattern: an object of one type is interpreted with the semantics of another, and the resulting length mis-computation leaks adjacent heap contents. The single affected component is cpe:2.3:a:bps:html::gumbo, the Best Practical Solutions (BPS) Perl distribution.

RemediationAI

Vendor-released patch: 0.19 - upgrade HTML::Gumbo to 0.19 or later (e.g. cpan HTML::Gumbo / cpanm HTML::Gumbo@0.19), which adds GUMBO_NODE_TEMPLATE handling to walk_tree per commit 15c0598909d4a64f47ef0a1abc5051f4e113c186 (https://github.com/bestpractical/HTML-Gumbo/commit/15c0598909d4a64f47ef0a1abc5051f4e113c186.patch); Debian users should track https://bugs.debian.org/1104789 for the distribution package. If immediate upgrade is impossible, a targeted workaround is to switch callers to format => 'callback', which croaks on the unhandled template node type and is not affected - with the trade-off that callers must implement their own node-walking logic and lose the convenience of the 'string'/'tree' serializers. Alternatively, pre-strip or reject <template> elements from untrusted input before parsing, accepting that this changes parser semantics and may drop legitimate markup. Advisory details are in the oss-security post at https://seclists.org/oss-sec/2026/q3/6 and http://www.openwall.com/lists/oss-security/2026/07/01/7.

Share

CVE-2025-15646 vulnerability details – vuln.today

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