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.
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.
justhtml <= 1.13.01.14.0Until you upgrade:
drop_foreign_namespaces=True<style> in custom policiesThe default JustHTML(..., sanitize=True) behavior was not found to be vulnerable in this issue.
Discovered by JustHTML author during a LLM-based security review of justhtml.
{
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-08T00:06:17Z",
"nvd_published_at": null,
"severity": "LOW"
}