CVE-2026-137513 in justhtmlinfo

Summary

by MITRE • 11/26/2026

justhtml before 3.17.0 contains a denial of service vulnerability in decode_entities_in_text that allows unauthenticated attackers to crash parsing via non-ASCII Unicode digits in numeric character references. Attackers can submit a payload like &#² in HTML text or attributes, causing an uncaught ValueError from int() that aborts JustHTML() and stream() parsing.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/27/2026

The vulnerability identified in justhtml versions prior to 3.17.0 represents a significant denial of service risk stemming from improper input validation within the library's HTML entity decoding logic. Specifically, the flaw resides in the decode_entities_in_text function, which is responsible for processing numeric character references found within HTML text nodes and attributes. When an unauthenticated attacker submits malformed input containing non-ASCII Unicode digits embedded within a numeric character reference structure, such as the payload &#², the parser attempts to convert this sequence into an integer value using Python's built-in int() function. Because the standard int() implementation does not accept certain Unicode digit characters that are visually similar or semantically related but technically distinct from ASCII digits in this specific context, it raises an uncaught ValueError exception. This abrupt termination of execution flow prevents the JustHTML constructor and subsequent stream parsing operations from completing their tasks effectively.

From a technical perspective, this issue is classified under CWE-20 as Improper Input Validation because the application fails to adequately sanitize or validate user-supplied data before processing it through critical system functions. The lack of robust error handling around the integer conversion process allows external actors to trigger internal exceptions that crash the parsing routine. This behavior aligns with ATT&CK technique T1498, Network Denial of Service, as an attacker can exploit this flaw to disrupt service availability by causing repeated crashes or hangs in applications relying on justhtml for HTML processing. The vulnerability is particularly dangerous because it requires no authentication and leverages standard web input vectors like form submissions or HTTP request bodies containing HTML content.

The operational impact of this vulnerability extends beyond simple application errors, potentially leading to resource exhaustion if the crashing behavior triggers automatic restarts without proper cleanup mechanisms. In high-throughput environments where justhtml is used for real-time parsing of user-generated content, such as comment sections or message boards, an attacker could flood the system with these malformed entities to degrade performance or cause complete service unavailability. This denial of service condition affects both synchronous and asynchronous processing paths within the library, impacting any downstream services that depend on successful HTML parsing results.

To mitigate this risk, organizations must upgrade justhtml to version 3.17.0 or later, where developers have implemented stricter validation checks for numeric character references before attempting integer conversion. Additionally, defensive coding practices should be adopted by wrapping entity decoding operations in try-except blocks that gracefully handle ValueError exceptions rather than allowing them to propagate and crash the application. Input sanitization layers at the network perimeter can also filter out suspicious Unicode sequences known to trigger this specific parsing failure, providing an additional layer of defense against exploitation attempts targeting older or unpatched instances of the library.

Responsible

VulnCheck

Reservation

11/26/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00646

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!