---
id: CVE-2026-5751
title: >-
  justhtml versions 1.13.0 and earlier contain a parser-differential / mutation
  cross-site scripting (mXSS) vulnerability when using a custom
  SanitizationPolicy that preserves foreign namespaces (e.g.,
  drop_foreign_namespaces=False with al…
summary: >-
  justhtml versions 1.13.0 and earlier contain a parser-differential / mutation
  cross-site scripting (mXSS) vulnerability when using a custom
  SanitizationPolicy that preserves foreign namespaces (e.g.,
  drop_foreign_namespaces=False with al…
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.13.0, < 1.14.0'
patched:
  - justhtml 1.14.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-5751'
references:
  - url: >-
      https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-r758-8hxw-4845
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/justhtml-before-mutation-xss-via-custom-sanitization-policies
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/EmilStenstrom/justhtml/commit/8adc4dfe31723dc522f44338f9bd98381c92b076
  - url: 'https://github.com/EmilStenstrom/justhtml'
  - url: 'https://github.com/EmilStenstrom/justhtml/releases/tag/v1.14.0'
tags:
  - nvd
  - osv
  - pip
epss: 0.00263
epssPercentile: 0.17997
aliases:
  - GHSA-r758-8hxw-4845
ecosystem: pip
ingestedAt: '2026-08-24T19:25:44.289Z'
---

## Overview

justhtml versions 1.13.0 and earlier contain a parser-differential / mutation cross-site scripting (mXSS) vulnerability when using a custom SanitizationPolicy that preserves foreign namespaces (e.g., drop_foreign_namespaces=False with allowlisted SVG/MathML elements or raw-text containers such as <style>). Specially crafted input can sanitize into markup that appears safe but becomes unsafe when re-parsed by a browser or another HTML parser, allowing markup injection. The default safe configuration (sanitize=True) is not affected. Fixed in 1.14.0.

## Remediation

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

## Package advisory (CVE-2026-5751)

Affected packages:

- `justhtml >= 1.13.0, < 1.14.0`

Patched in:

- `justhtml 1.14.0`

Source: https://osv.dev/vulnerability/GHSA-r758-8hxw-4845
