# CVE-2026-74793: justhtml cross-site scripting in selectedcontent projection

Source: https://junglewise.ai/threats/cve-2026-74793-justhtml-cross-site-scripting-in-selectedcontent-projection  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-23. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-74793 · Severity: medium · CVSS 6.1 · Published 2026-08-23

justhtml is a Python library for safely sanitizing and parsing HTML. The default sanitizer fails to remove event handlers from SVG and MathML elements that are cloned during selectedcontent projections, allowing attackers to inject malicious code that executes in users' browsers. Any application using the library's documented safe default mode is vulnerable to stored or reflected XSS attacks.

## Quick answers

**Is CVE-2026-74793 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-74793 being exploited in the wild.

**How severe is CVE-2026-74793?** Medium severity, with a CVSS score of 6.1, published 23 August 2026.

**Which products and versions are affected?** Emil Stenstrom justhtml before 3.11.0.

**Is there a fix for CVE-2026-74793?** A patch was published on 2026-08-23: Fixed in version 3.11.0 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-74793 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-74793?** Check whether anything you run is named in the advisory. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A cross-site scripting (CWE-79) vulnerability exists in the HTML parser's selectedcontent projection mechanism. When processing &lt;selectedcontent&gt; elements, the parser clones child nodes and reinserts them without passing them through sanitization passes. Specifically, SVG and MathML elements with event handler attributes (onload, onclick, animate attributeName, etc.) bypass the deferred sanitization that normally removes such handlers. The vulnerability is in the default safe engine configuration (use_compiled_safe_engine), where _project_selectedcontent() executes before _drop_recorded_nodes() and _unwrap_recorded_nodes(), causing cloned nodes to evade recorded-node removal lists. An attacker can inject malicious payloads like &lt;svg onload=X&gt; into untrusted HTML and trigger XSS when JustHTML(input).to_html() is called. The issue was fixed in version 3.11.0 by reordering the projection pass to occur after sanitization.

## Affected products

- Emil Stenstrom justhtml before 3.11.0

## Timeline

- 2026-08-23: disclosed
- 2026-08-23: patched: Fixed in version 3.11.0

## References

- [https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-gjf2-f4jc-69xf](https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-gjf2-f4jc-69xf)
- [https://www.vulncheck.com/advisories/justhtml-before-xss-via-selectedcontent-projection](https://www.vulncheck.com/advisories/justhtml-before-xss-via-selectedcontent-projection)
