GHSA-r8cj-3554-33mr: Justhtml Justhtml Introduces Denial-of-service Hardening Vulnerability
LOWGHSA-r8cj-3554-33mr is a LOW justhtml introduces denial-of-service hardening vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Justhtml libraries in the PyPI ecosystem. The issue involves justhtml introduces denial-of-service hardening. Remediation is available by upgrading affected packages to version 1.18.0.
GHSA-r8cj-3554-33mr at a Glance
How to Fix GHSA-r8cj-3554-33mr
To remediate this vulnerability, upgrade all affected Justhtml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install justhtml>=1.18.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show justhtml
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-r8cj-3554-33mr, inspect your installed packages using pip:
pip show justhtml
Analyze the terminal output to locate any version of Justhtml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.18.0), your application is affected.
Note: The pip show justhtml command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Justhtml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-r8cj-3554-33mr Affected Justhtml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
justhtml
|
PyPI |
< 1.18.0
|
1.18.0
|
References
Frequently Asked Questions
What is GHSA-r8cj-3554-33mr?
Which Justhtml versions are affected?
What version fixes GHSA-r8cj-3554-33mr?
Is justhtml affected?
What CWE is associated with GHSA-r8cj-3554-33mr?
How can I check PyPI dependencies for GHSA-r8cj-3554-33mr?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r8cj-3554-33mr",
"modified" : "2026-05-08T18:19:30Z",
"published" : "2026-05-08T18:19:30Z",
"aliases" : [ ],
"summary" : "justhtml introduces denial-of-service hardening",
"details" : "## Summary\n\n`justhtml` `1.18.0` fixes multiple low-severity denial-of-service hardening issues in CSS selector handling and linkification.\n\nThese issues are availability concerns. They do not allow script execution, data disclosure, or sanitizer bypass by themselves.\n\n## Affected versions\n\n- `justhtml` `< 1.18.0`\n\n## Fixed version\n\n- `justhtml` `1.18.0` released on May 4, 2026\n\n## Impact\n\n### CSS selector handling\n\nApplications that evaluate attacker-controlled selector strings, or that run selector-based transform pipelines over attacker-controlled documents, could consume disproportionate CPU or memory.\n\nThe affected selector patterns included oversized selectors, large selector lists, oversized compound selectors, long combinator chains, deeply nested functional pseudo-classes such as `:not(...)`, repeated attribute/class token matching over large values, repeated sibling or ancestor scans, repeated positional pseudo-class work, and `:contains(...)` over large descendant text.\n\nProgrammatically constructed malformed DOM graphs could also trigger non-terminating or duplicate traversal in some selector paths, including cyclic/shared child graphs, cyclic parent chains, and cyclic text traversal for `:contains(...)`.\n\n### Linkification\n\nAttacker-controlled text containing punctuation-heavy input or URL candidates ending in long runs of unmatched closing brackets could cause repeated rescanning and consume disproportionate CPU when linkification was enabled.\n\n## Default configuration\n\nOrdinary sanitization of parsed HTML with the default `JustHTML(..., sanitize=True)` configuration is not expected to expose untrusted users to selector injection, because selectors are normally supplied by application code.\n\nThe main risk areas are:\n\n- applications that accept selector strings from untrusted users and pass them to `query(...)`, `matches(...)`, or selector-based transforms\n- custom transform or sanitization pipelines that run selector matching over very large untrusted documents\n- applications that construct or mutate DOM trees programmatically from untrusted structure\n- applications that enable `Linkify(...)` over attacker-controlled text\n\n## Fixes in 1.18.0\n\n`1.18.0` adds generalized selector resource controls and removes several repeated-work hot paths:\n\n- shared selector limits for parse and match operations\n- structural caps for selector length, selector lists, compound selectors, complex selectors, and parse depth\n- match-operation and string-byte budgets\n- per-query matcher state for caches and cycle guards\n- precomputed or cached ancestor, sibling, positional, attribute-token, text-content, `:not(...)`, `:empty`, and `:nth-child(...)` work\n- consistent enforcement across public parsing, `query(...)`, tag-only query fast paths, transform selector compilation, and sanitization transform matching\n- linkification hardening for punctuation-heavy inputs and trailing bracket trimming\n\n## CWE mapping\n\n- CWE-400: Uncontrolled Resource Consumption\n- CWE-407: Inefficient Algorithmic Complexity\n- CWE-835: Loop with Unreachable Exit Condition\n\n## Recommended action\n\nUpgrade to `justhtml` `1.18.0`.\n\nIf users cannot upgrade immediately:\n\n- do not pass untrusted selector strings to `query(...)`, `matches(...)`, or selector-based transforms\n- restrict the size of untrusted documents before selector matching or linkification\n- avoid constructing programmatic DOM graphs from untrusted structure\n- avoid enabling `Linkify(...)` on very large attacker-controlled text\n\n## Credit\n\nDiscovered during an internal security review of `justhtml`.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "justhtml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.18.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-r8cj-3554-33mr"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/EmilStenstrom/justhtml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-407", "CWE-835" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-08T18:19:30Z",
"nvd_published_at" : null
}
}