CVE-2026-6827: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in EmilStenstrom justhtml
Description
CVE-2026-6827 is a medium severity cross-site scripting (XSS) vulnerability in EmilStenstrom justhtml versions before 1.17.0. It involves improper input neutralization during web page generation, particularly when custom sanitization policies preserve foreign namespaces like SVG and MathML. This can allow dangerous content such as SVG <foreignObject> and MathML <annotation-xml> elements to bypass sanitization and become active HTML after reparsing. Additional issues include resource-loading CSS via SVG filters and preserved <style> tags, as well as serialization of script/style/Comment nodes into active markup. These issues mainly affect advanced or custom configurations rather than the default safe sanitization path.
CVSS v4.0
Score 5.1medium
Affected software
EmilStenstrom
justhtml
pkg:github/emilstenstrom/justhtmlRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
justhtml versions prior to 1.17.0 contain multiple security flaws related to sanitization, serialization, and DOM handling. When custom policies preserve foreign namespaces (SVG/MathML), dangerous HTML integration points and mutation-XSS payloads can survive sanitization and become active after reparsing. SVG filter attributes and preserved <style> elements can load external CSS resources. Programmatic creation of script, style, or Comment nodes may serialize into active markup. Additional fixes address sanitize-pipeline cache mutations and DOM parent/child cycles that could cause infinite loops. Most vulnerabilities impact advanced or custom configurations rather than the default safe mode.
Potential Impact
An attacker could exploit these sanitization weaknesses to inject malicious HTML or scripts, leading to cross-site scripting attacks. This could result in execution of arbitrary scripts in the context of the affected web application, potentially compromising user data or session integrity. However, the issues primarily affect non-default, advanced configurations, reducing the risk for typical users relying on default safe sanitization.
Mitigation Recommendations
Upgrade to justhtml version 1.17.0 or later, which includes fixes for these sanitization and serialization issues. Users employing default sanitization settings (JustHTML(..., sanitize=True)) are less likely to be affected. Review and avoid custom policies that preserve foreign namespaces unless necessary and ensure they are updated to the fixed version. Patch status is not explicitly confirmed in the input data; verify with the vendor advisory for the latest remediation guidance.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-04-21T20:44:33.519Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a8afb27acd9273b49f5f727
Added to database: 08/23/2026, 13:52:39 UTC
Last enriched: 09/10/2026, 23:19:16 UTC
Last updated: 10/06/2026, 06:48:19 UTC
Views: 72
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.