CVE-2026-6827Medium▾ Sunlitjusthtml has sanitization bypass in custom policies and programmatic DOM
▾ Sunlit zone — Low / medium · no exploitation signal
impact 27.5 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Aug 24.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
0.2%
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 policiessanitize() / sanitize_dom()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.
justhtml < 1.17.0Upgrade to a patched release:
justhtml 1.17.0Connected by shared product, vendor, weakness, or advisory.
CVE-2026-9769HighUncontrolled recursion DoS in JustHTML() via deeply nested HTML
CVE-2026-4671Lowjusthtml introduces denial-of-service hardening
CVE-2026-5751Lowjusthtml: Mutation XSS with custom foreign-namespace sanitization policies
CVE-2026-8630MediumJustHTML Affected by Mutation XSS via Literal Text Serialization in Raw Text Elements (style/script)
CVE-2026-77088Medium· 6.1justhtml: to_markdown() code-span blank-line breakout enables XSS
CVE-2026-5388Mediumjusthtml includes multiple security fixes