---
id: CVE-2026-6827
title: >-
  justhtml before 1.17.0 contains multiple security issues in sanitization,
  serialization, and programmatic DOM handling
summary: >-
  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…
severity: medium
cvss: 6.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'
cwe:
  - CWE-79
vendor: justhtml
product: justhtml
affected:
  - justhtml < 1.17.0
patched:
  - justhtml 1.17.0
published: '2026-08-23'
updated: '2026-10-12'
sourceUpdated: '2026-10-12T16:10:00.220'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-6827'
references:
  - url: >-
      https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-vrx2-77f2-ww34
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/justhtml-before-multiple-cross-site-scripting-vulnerabilities
    label: disclosure@vulncheck.com
  - url: 'https://github.com/EmilStenstrom/justhtml'
tags:
  - nvd
  - osv
  - pip
epss: 0.00261
epssPercentile: 0.17801
aliases:
  - GHSA-vrx2-77f2-ww34
ecosystem: pip
ingestedAt: '2026-08-24T19:25:44.456Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-6827)

Affected packages:

- `justhtml < 1.17.0`

Patched in:

- `justhtml 1.17.0`

Source: https://osv.dev/vulnerability/GHSA-vrx2-77f2-ww34
