CVE-2026-8829

HTML::Entities versions before 3.84 for Perl read freed heap memory in _decode_entities

Published Jun 4, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
HTML::Entities versions before 3.84 for Perl read freed heap memory in _decode_entities.

The XS routine backing HTML::Entities::_decode_entities cached a pointer (repl) into the entity-value SV returned by hv_fetch on the entity2char hash. When the input SV was identical to a value SV in that hash, and that value contained its own key as an entity reference, a later call to grow_gap() reallocated the SV's PV buffer and freed the backing allocation that repl still pointed into. The subsequent copy loop read repl_len bytes from the freed allocation.

The read may disclose adjacent heap contents into the destination SV.

Analysis

AI-generated

Technical impact

HTML::Entities versions prior to 3.84 contain a use‑after‑free bug in the _decode_entities routine. The routine caches a pointer into a string that may be freed later, so that a subsequent copy operation reads data from a reclaimed heap region. This flaw can lead to disclosure of adjacent heap contents when copying from the freed buffer, potentially exposing sensitive data. The weakness is a classic use‑after‑free issue as classified by CWE‑416.

Affected Systems

The vulnerability impacts the HTML::Entities Perl module, distributed by OALDERS. All released versions before 3.84 are affected. Systems that load this library, such as Perl applications that parse or render user‑supplied HTML using HTML::Entities, are at risk unless they have upgraded to version 3.84 or later.

Risk and Exploitability

The flaw permits arbitrary read of freed memory. The CVSS score of 7.5 indicates high severity. The EPSS score is 0.00017, indicating a very low exploitation probability, and the vulnerability is not listed in CISA’s KEV catalog. The exploit requires local execution of code that uses the vulnerable library; an attacker would need to supply crafted entity references that trigger the freed memory copy path. Thus the attack surface is limited to environments where untrusted input can be processed by the module.

Remediation

Vendor Solution

Upgrade to HTML-Parser 3.84 or later.


OpenCVE Recommended Actions

  • Upgrade to HTML-Parser 3.84 or later, which contains the fix for the use‑after‑free issue.
  • Implement strict input validation to prevent entity references that map an entity key to its own value, thereby blocking the reallocated buffer read path.
  • If an immediate upgrade is not feasible, limit the usage of HTML::Entities to trusted input sources only, and consider isolating the parsing logic in a sandboxed environment to contain potential memory disclosure.

Generated by OpenCVE AI on June 4, 2026 at 15:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4655-1 libhtml-parser-perl security update
Ubuntu USN Ubuntu USN USN-8587-1 HTML-Parser vulnerability
History
Type Values Removed Values Added
First Time appeared Oalders html\
CPEs cpe:2.3:a:oalders:html\:\:entities:*:*:*:*:*:perl:*:*
Vendors & Products Oalders html\
Type Values Removed Values Added
First Time appeared Oalders
Oalders html::entities
Vendors & Products Oalders
Oalders html::entities
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description HTML::Entities versions before 3.84 for Perl read freed heap memory in _decode_entities. The XS routine backing HTML::Entities::_decode_entities cached a pointer (repl) into the entity-value SV returned by hv_fetch on the entity2char hash. When the input SV was identical to a value SV in that hash, and that value contained its own key as an entity reference, a later call to grow_gap() reallocated the SV's PV buffer and freed the backing allocation that repl still pointed into. The subsequent copy loop read repl_len bytes from the freed allocation. The read may disclose adjacent heap contents into the destination SV.
Title HTML::Entities versions before 3.84 for Perl read freed heap memory in _decode_entities
Weaknesses CWE-416
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
CPANSec
Published
Updated
Jun 28, 2026, 11:34 AM
Reserved
May 18, 2026, 1:24 PM
Status
Modified
Published
Jun 4, 2026, 3:16 AM
Modified
Jul 22, 2026, 8:10 PM