Skip to main content

HTML::Bare CVE-2026-13397

| EUVDEUVD-2026-44963 HIGH
Loop with Unreachable Exit Condition (Infinite Loop) (CWE-835)
2026-07-16 CPANSec GHSA-xfxg-9rjg-hqrw
7.5
CVSS 3.1 · Vendor: CPANSec
Share

Severity by source

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

A single crafted string reliably triggers an infinite loop with no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is availability-only CPU exhaustion, so C:N/I:N/A:H.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/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
None
Integrity
None
Availability
High

Lifecycle Timeline

5
Source Code Evidence Fetched
Jul 17, 2026 - 16:31 vuln.today
Analysis Generated
Jul 17, 2026 - 16:31 vuln.today
CVSS changed
Jul 17, 2026 - 14:22 NVD
7.5 (HIGH)
CVE Published
Jul 16, 2026 - 16:14 cve.org
UNKNOWN (no severity yet)
CVE Published
Jul 16, 2026 - 16:14 cve.org
HIGH 7.5

DescriptionCVE.org

HTML::Bare versions through 0.04 for Perl will hang in an infinite loop when parsing malformed attributes.

The parserc_parse function never advances the attribute-parse state cursor on certain malformed attribute forms, looping forever.

Nameless attributes such as "<a ='c'>" or unbalanced quotes "<a b='''''''c'>" can trigger this condition.

Note that the latest version available on CPAN is version 0.02. Newer versions are available on the git repository.

AnalysisAI

Denial of service in HTML::Bare through version 0.04, a Perl XML/HTML parsing module, allows remote unauthenticated attackers to hang the parsing process in an infinite loop by supplying malformed markup. The parserc_parse function fails to advance its attribute-parse cursor on certain malformed attribute forms - such as nameless attributes ("<a ='c'>") or unbalanced quotes ("<a b='''''''c'>") - causing the CPU to spin indefinitely. There is no public exploit identified at time of analysis, and EPSS exploitation probability is low (0.19%, 8th percentile), consistent with a resource-exhaustion bug rather than a high-value target.

Technical ContextAI

HTML::Bare is a lightweight Perl module (CPE cpe:2.3:a:codechild:html::bare) that parses XML/HTML into a Perl data structure, using a C backend (parser.c) for speed. The root cause is CWE-835 (Loop with Unreachable Exit Condition, i.e. an infinite loop): the C function parserc_parse contains an attribute-parsing state machine whose cursor (cpos) is never incremented on specific malformed attribute forms - notably when a quoted attribute name is not followed by an '=' sign. Because the exit condition of the loop depends on the cursor advancing past the input, the loop can never terminate. The upstream fix (PR #1) is a single line, cpos++, that forces the cursor forward so malformed input cannot spin forever.

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - apply the one-line cursor-advance fix from https://github.com/nanoscopic/perl-HTML-Bare/pull/1 or the MetaCPAN security patch at https://security.metacpan.org/patches/H/HTML-Bare/0.02/CVE-2026-13397-r1.patch (note this patch is issued against 0.02, the current CPAN release). Because no tagged, fixed CPAN release is confirmed, teams relying on CPAN cannot simply bump a version and should either apply the patch to their vendored copy or pin to the fixed git commit. As a compensating control until patched, wrap parser calls with a hard timeout (e.g. Perl's alarm()/SIGALRM or Sys::SigAction around the parse call) so a hung parse is killed rather than pinning a worker indefinitely - trade-off: legitimately large documents may be aborted, so tune the timeout. Additionally, size-limit and validate untrusted markup before parsing and run parsing in a separate worker/process that can be reaped, to contain the CPU/resource impact of a single request.

Share

CVE-2026-13397 vulnerability details – vuln.today

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