Read the docs
TI-2026-66569 Aliases GHSA-4p64-v8f5-r2gx

Multiple security fixes in justhtml

Priority LOW 38CWE-178Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
Cross-site scripting
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-79.

Summary

## Summary `justhtml` `1.16.0` fixes multiple security issues in sanitization, serialization, and programmatic DOM handling. Most of these issues affected one of these advanced paths rather than ordinary parsed HTML with the default safe settings: - programmatic DOM input to `sanitize()` or `sanitize_dom()` - reused or mutated sanitization policy objects - custom policies that preserve foreign namespaces such as SVG or MathML ## Affected versions - `justhtml` `<= 1.15.0` ## Fixed version - `justhtml` `1.16.0` released on April 12, 2026 ## Impact ### Policy reuse and mutation Nested mutation of sanitization policy internals could weaken later sanitization by leaving stale compiled sanitizers active, or by mutating exported default policy internals process-wide. ### In-memory sanitization gaps Programmatic DOM sanitization could miss dangerous mixed-case tag names such as `ScRiPt` or `StYlE`, and custom `drop_content_tags` values such as `{"SCRIPT"}` could silently fail to drop dangerous subtrees. ### Serialization injection Crafted programmatic doctype names could serialize into active markup before the document body. ### Foreign-namespace policy bypasses Custom policies that preserve SVG or MathML could allow active SVG features to survive sanitization, including: - animation elements such as `<set>` and `<animate>` that mutate already-sanitized attributes after sanitization - presentation attributes such as `fill`, `clip-path`, `mask`, `marker-start`, and `cursor` containing external `url(...)` references - programmatic DOM trees that claim `namespace="html"` but serialize as `<svg>` or `<math>`, bypassing foreign-content checks ### Rawtext hardening gap Mixed-case programmatic `style` or `script` nodes could bypass rawtext hardening and preserve active stylesheet content such as remote `@import` rules. ## Default configuration Most of these issues did **not** affect the normal `JustHTML(..., sanitize=True)` path for ordinary parsed HTML. The main exceptions were policy-mutation issues, which could weaken later sanitization if code mutated nested state on reused policy objects or exported defaults. ## Recommended action Upgrade to `justhtml` `1.16.0`. If you cannot upgrade immediately: - do not mutate `DEFAULT_POLICY`, `DEFAULT_DOCUMENT_POLICY`, or nested policy internals - avoid reusing policy objects after mutating nested state - avoid preserving SVG or MathML for untrusted input - avoid preserving `style` or `script` in custom policies for untrusted input - avoid serializing untrusted programmatic doctypes or DOM trees ## Credit Discovered during an internal security review of `justhtml`.

Why it matters now

Fix Fixed justhtml (PyPI): 1.16.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—justhtml (PyPI)before 1.16.01.16.0Patch availableGHSA-4p64-v8f5-r2gx
  • justhtml (PyPI) Vendor— Affected before 1.16.0 Fixed in 1.16.0 Patch available GHSA-4p64-v8f5-r2gx

Remediation

  • Fix · GHSA-4p64-v8f5-r2gx justhtml (PyPI) Fixed in 1.16.0 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-4p64-v8f5-r2gx

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences