CVE-2025-15646: CWE-843 Access of Resource Using Incompatible Type (Type Confusion) in BPS HTML::Gumbo
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.
AI Analysis
Technical Summary
The vulnerability in HTML::Gumbo prior to version 0.19 arises from improper handling of the <template> element introduced in libgumbo 0.10.0. The walk_tree function in lib/HTML/Gumbo.xs does not support this element correctly and treats it as a text node. This causes strlen() to over-read beyond the intended memory boundary, disclosing heap contents. When parse() is called with format => 'string' or 'tree' on input containing a <template> element, the over-read bytes are serialized into the output, leading to information disclosure. The format => 'callback' mode triggers a croak error on the unhandled node type and is not vulnerable. There is no CVSS score or vendor advisory indicating a fix or mitigation.
Potential Impact
This vulnerability allows an attacker to cause bounded heap memory disclosure when parsing HTML input containing <template> elements using vulnerable versions of HTML::Gumbo. The disclosed memory may contain sensitive information from the heap, leading to potential information leakage. There is no indication of remote code execution or denial of service. No known exploits are reported in the wild.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid parsing untrusted HTML input containing <template> elements with format => 'string' or 'tree'. Using format => 'callback' avoids the vulnerability as it triggers an error on the unhandled node type. Monitor official BPS advisories or CPAN security announcements for updates and patches.
CVE-2025-15646: CWE-843 Access of Resource Using Incompatible Type (Type Confusion) in BPS HTML::Gumbo
Description
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.
CVSS v3.1
Score 9.8critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in HTML::Gumbo prior to version 0.19 arises from improper handling of the <template> element introduced in libgumbo 0.10.0. The walk_tree function in lib/HTML/Gumbo.xs does not support this element correctly and treats it as a text node. This causes strlen() to over-read beyond the intended memory boundary, disclosing heap contents. When parse() is called with format => 'string' or 'tree' on input containing a <template> element, the over-read bytes are serialized into the output, leading to information disclosure. The format => 'callback' mode triggers a croak error on the unhandled node type and is not vulnerable. There is no CVSS score or vendor advisory indicating a fix or mitigation.
Potential Impact
This vulnerability allows an attacker to cause bounded heap memory disclosure when parsing HTML input containing <template> elements using vulnerable versions of HTML::Gumbo. The disclosed memory may contain sensitive information from the heap, leading to potential information leakage. There is no indication of remote code execution or denial of service. No known exploits are reported in the wild.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid parsing untrusted HTML input containing <template> elements with format => 'string' or 'tree'. Using format => 'callback' avoids the vulnerability as it triggers an error on the unhandled node type. Monitor official BPS advisories or CPAN security announcements for updates and patches.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- CPANSec
- Date Reserved
- 2026-05-22T10:47:01.107Z
- Cvss Version
- null
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a45341527e9c79719b997ed
Added to database: 07/01/2026, 15:36:53 UTC
Last enriched: 07/01/2026, 16:07:30 UTC
Last updated: 07/01/2026, 21:24:16 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.