CVE-2026-5751: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in EmilStenstrom justhtml
Description
justhtml versions 1.13.0 and earlier have a mutation cross-site scripting (mXSS) vulnerability when using a custom SanitizationPolicy that preserves foreign namespaces. This vulnerability allows specially crafted input to be sanitized into markup that appears safe but becomes unsafe when re-parsed by a browser or another HTML parser, enabling markup injection. The default safe configuration is not affected. The issue is fixed in version 1.14.0.
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
CVE-2026-5751 is a mutation cross-site scripting (mXSS) vulnerability in justhtml up to version 1.13.0. It occurs when a custom SanitizationPolicy is used that preserves foreign namespaces (e.g., drop_foreign_namespaces=False with allowlisted SVG/MathML elements or raw-text containers like <style>). The vulnerability arises because input sanitized under these conditions can be transformed into markup that appears safe but becomes unsafe upon re-parsing by browsers or other HTML parsers, allowing markup injection. The default configuration with sanitize=True is not vulnerable. The vulnerability is fixed in version 1.14.0.
Potential Impact
An attacker can inject unsafe markup through specially crafted input when a vulnerable version of justhtml is used with a custom SanitizationPolicy preserving foreign namespaces. This can lead to cross-site scripting attacks, potentially allowing execution of malicious scripts in the context of affected web pages. The default safe configuration is not affected, limiting exposure to configurations that explicitly enable the vulnerable sanitization policy.
Mitigation Recommendations
Upgrade justhtml to version 1.14.0 or later, where this vulnerability is fixed. Avoid using custom SanitizationPolicy configurations that preserve foreign namespaces unless necessary and ensure they are updated to the fixed version. The default configuration (sanitize=True) is not affected and does not require changes.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-04-07T15:54:18.686Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a8afb27acd9273b49f5f725
Added to database: 08/23/2026, 13:52:39 UTC
Last enriched: 09/10/2026, 23:32:42 UTC
Last updated: 10/07/2026, 06:48:17 UTC
Views: 86
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.