CVE-2026-6827: justhtml before 1.17.0 Multiple Cross-Site Scripting Vulnerabilities

Published Aug 23, 2026
·
Updated

justhtml before 1.17.0 contains multiple security issues in sanitization, serialization, and programmatic DOM handling. When custom policies preserve foreign namespaces (SVG/MathML), dangerous content such as HTML integration points (SVG <foreignObject>, MathML <annotation-xml encoding="text/html">) and mutation-XSS parser-differential payloads could survive sanitization and become active HTML after reparse; SVG filter="url(...)" and preserved <style> could leave resource-loading CSS (@import, background-image:url()). Programmatic script/style/Comment nodes could serialize into active markup. Additional hardening fixes address sanitize-pipeline cache mutation and DOM parent/child cycles that could cause infinite loops. Most issues affect advanced or custom configurations rather than the default JustHTML(..., sanitize=True) safe path.

Affected Software

1 affected component
justhtml<1.17.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade justhtml to a version that resolves this vulnerability.

    Fixed in 1.17.0
  2. Compensating control

    If you rely on custom sanitize policies, avoid preserving foreign namespaces (SVG/MathML). Specifically prevent/disable dangerous HTML integration points such as SVG <foreignObject> and MathML <annotation-xml encoding="text/html">, and avoid payloads that rely on mutation-XSS parser differentials surviving sanitization/reparse.

  3. Compensating control

    If you rely on custom sanitizer policy that preserves SVG/MathML content, also block SVG resource-loading vectors such as filter attributes using URL syntax (e.g., filter="url(...)") and preserved <style> contents that could include CSS resource-loading like @import and background-image:url().

  4. Compensating control

    For advanced/custom configurations that use programmatic DOM nodes (e.g., script/style/Comment nodes), ensure those node types are not allowed to serialize into active markup; otherwise reject/strip these nodes before any serialization/reparse that could activate previously sanitized content.

Event History

Aug 23, 2026
CVE Published
via MITRE·01:34 PM
Data Sourced
via MITRE·01:34 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Is the default sanitization path affected?

Most of the issues affect advanced or custom configurations rather than the default JustHTML(..., sanitize=True) safe path.

2

Which configurations are most exposed?

Configurations that preserve foreign namespaces such as SVG or MathML are exposed to dangerous integration points and mutation-XSS parser differentials. Policies that preserve SVG filter attributes or style elements may also allow resource-loading CSS, including @import and background-image:url().

3

What conditions can make sanitized content become active markup?

Dangerous content can survive sanitization when SVG foreignObject or MathML annotation-xml with encoding="text/html" is preserved, then become active HTML after reparsing. Programmatically created script, style, or Comment nodes can also serialize into active markup.

4

What other effects should be considered besides XSS?

The affected versions also have sanitize-pipeline cache mutation and DOM parent/child cycle issues. DOM cycles can cause infinite loops.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203