CVE-2026-8630Medium▾ SunlitJustHTML Affected by Mutation XSS via Literal Text Serialization in Raw Text Elements (style/script)
▾ 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%
Sanitized DOM trees can be unsafe to serialize when a custom policy allows raw-text elements such as <style> or <script>.
The issue affects DOM trees that are constructed or modified programmatically and then passed through sanitize_dom() with a policy that keeps these elements. Text nodes inside <style> and <script> are serialized literally, so attacker-controlled text containing the matching closing tag sequence can break out of the raw-text context and inject HTML into the serialized output.
The default sanitization policy is not affected because it drops the contents of style and script.
The root cause is in HTML serialization of raw-text elements. In serialize.py, text children of script and style are emitted verbatim:
_LITERAL_TEXT_SERIALIZATION_ELEMENTS = frozenset({"script", "style"})
def _serialize_text_for_parent(text: str | None, parent_name: str | None) -> str:
if not text:
return ""
if parent_name in _LITERAL_TEXT_SERIALIZATION_ELEMENTS:
return text
return _escape_text(text)
## Affected packages
- `justhtml < 1.12.0`
## Remediation
Upgrade to a patched release:
- `justhtml 1.12.0`
Connected by shared product, vendor, weakness, or advisory.
CVE-2026-6827Mediumjusthtml has sanitization bypass in custom policies and programmatic DOM
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-77088Medium· 6.1justhtml: to_markdown() code-span blank-line breakout enables XSS
CVE-2026-5388Mediumjusthtml includes multiple security fixes