CVE-2026-5388: Improper Input Validation in EmilStenstrom justhtml
CVE-2026-5388 affects EmilStenstrom justhtml versions before 1.15.0 and involves multiple security issues in URL sanitization helpers, HTML serialization, Markdown passthrough, and custom sanitization policies. These issues can allow attackers to bypass sanitization and inject active HTML and JavaScript under certain configurations. The vulnerability is critical with a CVSS score of 9.3. Most issues do not affect the default sanitize=true setting but impact helper APIs, programmatic DOM construction, html_passthrough=true, and custom policies.
AI Analysis
Technical Summary
justhtml before version 1.15.0 contains multiple security flaws related to improper input validation in URL sanitization helpers (clean_url_value, clean_url_in_js_string), HTML serialization, Markdown passthrough when html_passthrough=True, and several edge cases in custom sanitization policies. These flaws allow attackers to bypass sanitization mechanisms and inject active HTML and JavaScript code. Examples include encoded javascript: URLs, backslash-based relative URLs resolved as remote hosts, markup-breaking element or attribute names, HTML comments, raw </textarea> tags reintroduced via Markdown passthrough, and preservation of <style>, <meta http-equiv=refresh>, and <base href> tags in custom policies. The default sanitize=true configuration is mostly unaffected; the issues primarily impact advanced usage scenarios involving helper APIs, programmatic DOM construction, html_passthrough=True, and custom sanitization policies or transformation pipelines.
Potential Impact
An attacker can bypass input sanitization to inject active HTML and JavaScript code, potentially leading to cross-site scripting (XSS) or other injection-based attacks. This can compromise the security of applications using vulnerable justhtml versions with certain configurations, especially those using html_passthrough=True or custom sanitization policies. The vulnerability is critical, indicating a high potential impact on confidentiality, integrity, and availability if exploited.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using html_passthrough=True and custom sanitization policies that may be vulnerable. Prefer the default sanitize=true configuration, which is mostly unaffected by these issues. Monitor the vendor's communications for updates and apply patches promptly once released.
CVE-2026-5388: Improper Input Validation in EmilStenstrom justhtml
Description
CVE-2026-5388 affects EmilStenstrom justhtml versions before 1.15.0 and involves multiple security issues in URL sanitization helpers, HTML serialization, Markdown passthrough, and custom sanitization policies. These issues can allow attackers to bypass sanitization and inject active HTML and JavaScript under certain configurations. The vulnerability is critical with a CVSS score of 9.3. Most issues do not affect the default sanitize=true setting but impact helper APIs, programmatic DOM construction, html_passthrough=true, and custom policies.
CVSS v4.0
Score 9.3critical
Affected software
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 before version 1.15.0 contains multiple security flaws related to improper input validation in URL sanitization helpers (clean_url_value, clean_url_in_js_string), HTML serialization, Markdown passthrough when html_passthrough=True, and several edge cases in custom sanitization policies. These flaws allow attackers to bypass sanitization mechanisms and inject active HTML and JavaScript code. Examples include encoded javascript: URLs, backslash-based relative URLs resolved as remote hosts, markup-breaking element or attribute names, HTML comments, raw </textarea> tags reintroduced via Markdown passthrough, and preservation of <style>, <meta http-equiv=refresh>, and <base href> tags in custom policies. The default sanitize=true configuration is mostly unaffected; the issues primarily impact advanced usage scenarios involving helper APIs, programmatic DOM construction, html_passthrough=True, and custom sanitization policies or transformation pipelines.
Potential Impact
An attacker can bypass input sanitization to inject active HTML and JavaScript code, potentially leading to cross-site scripting (XSS) or other injection-based attacks. This can compromise the security of applications using vulnerable justhtml versions with certain configurations, especially those using html_passthrough=True or custom sanitization policies. The vulnerability is critical, indicating a high potential impact on confidentiality, integrity, and availability if exploited.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using html_passthrough=True and custom sanitization policies that may be vulnerable. Prefer the default sanitize=true configuration, which is mostly unaffected by these issues. Monitor the vendor's communications for updates and apply patches promptly once released.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-04-01T21:11:10.753Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a8afb27acd9273b49f5f721
Added to database: 08/23/2026, 13:52:39 UTC
Last enriched: 08/23/2026, 14:07:25 UTC
Last updated: 08/23/2026, 16:14:02 UTC
Views: 6
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.