Overview
CVE-2026-6827 is a vulnerability in the justhtml library, specifically affecting versions before 1.17.0. This library is used for parsing and sanitizing HTML, and the vulnerability involves multiple security issues in its sanitization, serialization, and programmatic DOM handling processes. These issues could potentially allow for cross-site scripting (XSS) attacks, which are a type of security vulnerability that occurs when an attacker is able to inject malicious code into a website, affecting its users.
Understanding the Vulnerability / Threat
Root Cause Analysis
The root cause of CVE-2026-6827 is related to how justhtml handles custom policies that preserve foreign namespaces, such as SVG and MathML. Specifically, the library does not adequately sanitize dangerous content, including HTML integration points like SVG
and MathML . Additionally, issues with mutation-XSS parser-differential payloads, SVG filter="url(...)" , and preserved