CVE-2026-4671: justhtml before 1.18.0 Denial of Service via CSS Selector

Published Aug 23, 2026
·
Updated

justhtml before 1.18.0 contains multiple low-severity denial-of-service issues in CSS selector handling and linkification. Applications that evaluate attacker-controlled selector strings (via query(), matches(), or selector-based transforms), run selector matching over very large untrusted documents, construct DOM trees from untrusted structure, or enable linkification over attacker-controlled text may consume disproportionate CPU or memory. Triggers include oversized selectors, large selector lists, oversized compound selectors, long combinator chains, deeply nested functional pseudo-classes, repeated token/positional matching, cyclic DOM graphs causing non-terminating traversal, and punctuation-heavy or trailing-bracket linkification input. These are availability-only concerns and do not by themselves allow script execution, data disclosure, or sanitizer bypass. Default JustHTML(sanitize=True) usage is not expected to be exposed, since selectors are normally supplied by application code.

Affected Software

1 affected component
justhtml<1.18.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade justhtml to a version that resolves this vulnerability.

    Fixed in 1.18.0

Event History

Aug 23, 2026
CVE Published
via MITRE·01:34 PM
Data Sourced
via MITRE·01:34 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are most likely to be exposed?

Applications are most likely to be exposed when they evaluate attacker-controlled selectors through query(), matches(), or selector-based transforms; run matching against very large untrusted documents; build DOM trees from untrusted structure; or linkify attacker-controlled text. Default JustHTML(sanitize=True) use is not expected to be exposed because selectors are normally application-supplied.

2

What can an unauthenticated attacker achieve?

An attacker can cause disproportionate CPU or memory consumption, resulting in denial of service. The issue is availability-only and does not itself provide script execution, data disclosure, or a sanitizer bypass.

3

What inputs or structures can trigger the resource exhaustion?

Relevant triggers include oversized selectors or selector lists, large compound selectors, long combinator chains, deeply nested functional pseudo-classes, repeated token or positional matching, and cyclic DOM graphs that do not terminate traversal. Linkification can also be stressed with punctuation-heavy input or text ending in trailing brackets.

4

What should be prioritized if immediate upgrade is not possible?

Prioritize preventing untrusted selector strings from reaching query(), matches(), or selector-based transforms, and limit the size and complexity of untrusted documents and DOM structures. Avoid linkifying unrestricted attacker-controlled text, especially punctuation-heavy input, until the affected component can be updated.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203