justhtml 1.17.0 fixes multiple security issues in sanitization, serialization, and programmatic DOM handling.
Most of these issues affected advanced or custom configurations rather than the default safe path.
justhtml <= 1.16.0justhtml 1.17.0 released on April 19, 2026Custom policies that preserved foreign namespaces could allow dangerous content to survive sanitization, including:
<foreignObject>, MathML <annotation-xml encoding="text/html">, SVG <title> / <desc>, and MathML text integration pointsfilter="url(...)" attributes that could trigger external fetchesThese issues affected:
- JustHTML(..., sanitize=True) with custom foreign-namespace policies
- sanitize() / sanitize_dom()
- low-level terminal Sanitize(...) transform execution
<style> handlingConstructor-time sanitization and explicit Sanitize(...) transforms did not fully match sanitize() / sanitize_dom() when custom policies preserved <style>.
That could leave resource-loading CSS such as @import or background-image:url(...) in sanitized output from HTML string input.
Programmatic script, style, and Comment(...) nodes could still serialize into active markup in some edge cases.
This could affect applications that build or mutate DOM trees directly before calling to_html() or to_markdown(html_passthrough=True).
Two lower-severity hardening fixes were included:
to_html() and sanitize_dom()Most of the issues above did not affect ordinary parsed HTML with the default JustHTML(..., sanitize=True) configuration.
The main risk areas were:
<style>Upgrade to justhtml 1.17.0.
If users cannot upgrade immediately:
<style> for untrusted inputscript, style, or comment contentDiscovered during an internal security review of justhtml.
{
"github_reviewed": true,
"nvd_published_at": null,
"cwe_ids": [
"CWE-436",
"CWE-471",
"CWE-79",
"CWE-835"
],
"github_reviewed_at": "2026-04-22T21:25:46Z",
"severity": "MODERATE"
}