# CVE-2025-15646: HTML::Gumbo versions before 0.19 for Perl disclose heap memory via type confusion

> Attackers can disclose bounded heap memory by providing HTML containing a template element to the HTML::Gumbo Perl library.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2026
- **Updated:** 1 Jul 2026
- **Also known as:** DEBIAN-CVE-2025-15646, GHSA-754r-h5mg-r795, UBUNTU-CVE-2025-15646

## What is CVE-2025-15646?

CVE-2025-15646 is a critical vulnerability in BPS HTML::Gumbo, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-843 (Access of Resource Using Incompatible Type), CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2025-15646?


## How do I fix CVE-2025-15646?

Upgrade to a fixed version.

## Is CVE-2025-15646 being exploited?

There is no known exploitation of CVE-2025-15646 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-15646 and fix it if it is affected.

What it is: CVE-2025-15646 is a critical vulnerability in BPS HTML::Gumbo, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-15646 in the wild and no public exploit code.

Affected product: BPS HTML::Gumbo. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-15646/ (Markdown: https://insights.sbomify.com/CVE-2025-15646/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-15646
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-15646
- OSV: https://osv.dev/vulnerability/CVE-2025-15646

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-15646/
Summaries are generated and may contain mistakes; the official description above is the record.
