CVE-2026-7808
9.8EmilStenstrom · justhtml
EmilStenstrom justhtml contains multiple HTML sanitization bypass vulnerabilities in versions before 1.16.0 that can lead to cross-site scripting when processing malicious input.
Executive summary
A critical sanitization bypass vulnerability in the EmilStenstrom justhtml library allows attackers to inject malicious scripts into applications, leading to potential cross-site scripting.
Vulnerability
This vulnerability involves improper input validation (CWE-20) where the sanitizer fails to properly neutralize dangerous content like mixed-case tags or crafted doctype names. The vulnerability is exploitable by an unauthenticated attacker providing malicious input to an application using the library.
Business impact
The CVSS score of 9.8 highlights the severe risk posed to applications relying on this library for content sanitization. Successful exploitation allows for the execution of arbitrary scripts in the context of a user session, potentially leading to session hijacking, data theft, or malicious redirection.
Remediation
Immediate Action: Update the PyPI package justhtml to version 1.16.0 or higher.
Proactive Monitoring: Inspect web application logs for suspicious patterns in user-submitted content, particularly those attempting to inject script or style tags.
Compensating Controls: Implement a robust Content Security Policy (CSP) to restrict the execution of unauthorized scripts, which can serve as a secondary defense against cross-site scripting attacks.
Exploitation status
Public Exploit Available: Unknown.
Analyst recommendation
Organizations utilizing the justhtml library must update to version 1.16.0 immediately to remediate these sanitization bypasses. Developers should verify that their implementation does not rely on deprecated or mutated sanitization policies that could reintroduce these risks.