justhtml
Affected
- introduced
1.13.0, fixed1.14.0(ecosystem)
Fixed versions
1.14.0
Fix
- Fixed version
1.14.0pip install --upgrade justhtml==1.14.0
Advisory
Also known as: CVE-2026-5751
justhtml: Mutation XSS with custom foreign-namespace sanitization policies
Summary
A parser-differential / mutation XSS issue was found in justhtml when using a custom sanitization policy that preserves foreign namespaces such as SVG or MathML.
Under these custom settings, specially crafted input could sanitize into HTML that looked safe at first, but became unsafe when parsed again by a browser or another HTML parser.
Impact
This issue does not affect the default safe configuration.
You may be affected if you use a custom SanitizationPolicy with settings like:
drop_foreign_namespaces=False<style>In that case, an attacker could inject markup that survives sanitization and turns into active HTML after re-parsing.
Affected versions
justhtml <= 1.13.0Fixed version
1.14.0Workarounds
Until you upgrade:
drop_foreign_namespaces=True<style> in custom policiesNotes
The default JustHTML(..., sanitize=True) behavior was not found to be vulnerable in this issue.
Credit
Discovered by JustHTML author during a LLM-based security review of justhtml.
Low Basis: The source's own band: LOW
1.13.0, fixed 1.14.0 (ecosystem)1.14.0
1.14.0pip install --upgrade justhtml==1.14.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0