Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft encoded javascript: URL or markup-breaking input
-
DeliverySubmit to app using affected justhtml helper/passthrough/custom policy
-
ExploitSanitizer accepts malformed value as safe
-
ExecutionActive HTML/JS reintroduced into output
-
PersistVictim renders page, script executes in browser
-
ImpactSession or credential theft
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Exploitation requires the consuming application to use one of the affected code paths - specifically: the URL helper APIs JustHTML.clean_url_value()/clean_url_in_js_string(); programmatic DOM/element/attribute construction; Markdown rendering with to_markdown(html_passthrough=True); or custom sanitization policies / transform pipelines (e.g. those preserving <style>, <meta http-equiv=refresh>, <base href>, or using DropAttrs/DropUrlAttrs/AllowStyleAttrs/MergeAttrs). The key limiting factor: the default sanitize=True configuration is largely NOT affected, so applications using justhtml's standard sanitizer with default policy are mostly out of scope. Additional limits: successful XSS requires a victim to render the attacker-controlled content, and impact is scoped to the browser/DOM context of the target application. Authentication requirements are not independently confirmable from the description; the CVSS vector lists PR:N (unauthenticated attacker input), but real exposure depends on where untrusted input reaches an affected code path. |
| Impact | The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H) yields 9.3 (critical), but this appears to be a worst-case rating that assumes an application exercising the vulnerable code paths; it materially overstates risk for the common case. The description and GHSA advisory are explicit that most issues do NOT affect the default sanitize=True configuration and primarily impact helper APIs, programmatic DOM construction, html_passthrough=True, and custom policies/transform pipelines - a strong mitigating factor the raw score ignores. This is a genuine sanitizer-bypass/XSS class issue rather than direct server compromise, so VC/VI/VA:H (high confidentiality/integrity/availability of the vulnerable system) is optimistic for what is functionally client-side script injection; UI:N is also questionable since XSS typically requires a victim to render the content. There is no KEV listing and no EPSS score in the provided data, and no POC was supplied, so there is no evidence of active or widespread exploitation. Net assessment: a real bug worth patching promptly for anyone using the affected non-default paths, but not a drop-everything internet-wide emergency for default-configuration users; prioritize based on whether your application actually calls the affected helpers or custom policies. |
| Exploit ScenarioDerived | A web application uses justhtml's clean_url_value helper (or html_passthrough=True Markdown rendering) to sanitize user-submitted profile bios. An attacker submits a bio containing an entity-encoded 'javascript:...' URL or a raw </textarea> break; the sanitizer accepts it as safe, and when another user views the profile the injected script executes in their browser, enabling session theft or actions on their behalf. No public exploit code is currently identified, but the bypass techniques are described in detail in the advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 23, 2026
Sanitization bypass in justhtml (a Python HTML/Markdown sanitization library) before 1.15.0 lets attacker-controlled input reintroduce active HTML and JavaScript, resulting in cross-site scripting in consuming web applications. The flaws span URL-sanitization helpers, HTML serialization, Markdown passthrough, and custom policies - most do NOT affect the default sanitize=True path but do affect helper APIs, programmatic DOM construction, html_passthrough=True, and custom policies. No public exploit identified at time of analysis; the issue was reported by VulnCheck and fixed in 1.15.0.
RemediationAI
Vendor-released patch: upgrade justhtml to 1.15.0 (or later) via pip; this is the primary and complete fix per GHSA-c9vm-hv86-f23r. If immediate upgrade is not possible, apply targeted compensating controls matched to the code paths you use: avoid to_markdown(html_passthrough=True) on untrusted input (side effect: loses raw-HTML passthrough for trusted content); rely on the default sanitize=True path rather than custom policies or the clean_url_value/clean_url_in_js_string helpers where feasible (side effect: less flexibility in transform pipelines); if using custom policies, explicitly strip or disallow <style>, <meta http-equiv=refresh>, and <base href> tags and enforce URL policy on a[ping], attributionsrc, and link[imagesrcset] (side effect: may break legitimate styling or attribution features); and normalize/lowercase attribute names before your DropAttrs/DropUrlAttrs/AllowStyleAttrs/MergeAttrs transforms. Add a strict Content-Security-Policy as defense-in-depth to blunt injected script execution. Advisory URLs: https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-c9vm-hv86-f23r and https://www.vulncheck.com/advisories/justhtml-before-multiple-security-issues.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
justhtml is a Python library for sanitizing untrusted HTML and rendering Markdown safely, comparable in role to bleach or nh3. The root cause is CWE-20 (Improper Input Validation): sanitization helpers fail to normalize or reject dangerous inputs before deciding they are safe. Concrete examples include clean_url_value/clean_url_in_js_string accepting HTML-entity-encoded schemes (e.g. 'javascript:...') that become live 'javascript:' URLs after HTML attribute parsing; backslash-based paths like '\evil.example/x' treated as safe relative URLs though browsers resolve them to remote hosts; programmatic element/attribute names or HTML comments containing markup-breaking characters ('-->') that break out into live markup; and, in custom policies, preserved <style> (@import/url()/image-set()), <meta http-equiv=refresh>, and <base href> tags plus mishandled URL-bearing attributes (a[ping], attributionsrc, link[imagesrcset]) and case-sensitivity gaps in transform pipelines (DropAttrs/DropUrlAttrs/AllowStyleAttrs/MergeAttrs). The affected CPE is cpe:2.3:a:emilstenstrom:justhtml.
Know when Justhtml gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Sanitizer-bypass XSS: attacker-supplied input (PR:N) but exploitation depends on non-default helpers/policies (AC:H) and a victim rendering content (UI:R); injected script crosses into the browser context (S:C) with limited C/I impact and no direct availability effect.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
justhtml before 1.15.0 contains multiple security issues in URL sanitization helpers (clean_url_value/clean_url_in_js_string), HTML serialization, Markdown passthrough (html_passthrough=True), and several custom sanitization-policy edge cases. Depending on configuration, an attacker can bypass sanitization to inject active HTML and JavaScript - for example via encoded javascript: URLs, backslash-based relative URLs resolved as remote hosts, markup-breaking programmatic element/attribute names or HTML comments, raw </textarea> reintroduction through Markdown passthrough, or preserved <style>/<meta http-equiv=refresh>/<base href> tags in custom policies. Most custom-policy issues do not affect the default sanitize=True configuration; they primarily affect helper APIs, programmatic DOM construction, html_passthrough=True, and custom policies/transform pipelines.
Executive ViewAI
justhtml, a widely-used Python sanitization library, contains a critical flaw that allows attackers to bypass HTML and JavaScript filtering, creating cross-site scripting vulnerabilities in dependent web applications. This affects organizations whose applications rely on justhtml versions prior to 1.15.0 for protecting user-supplied content, potentially exposing end users to credential theft, session hijacking, and malware delivery through application interfaces.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Uncontrolled recursion in the justhtml Python HTML parsing library (all versions through 1.9.1) allows any remote unauth
Sanitizer bypass in the justhtml Python library (versions <= 1.11.0) allows attacker-controlled input to survive as raw
Cross-site scripting via HTML sanitization bypass affects justhtml (a Python HTML parsing/sanitization library by EmilSt
Uncontrolled resource consumption in justhtml before 1.18.0 enables denial-of-service conditions through CPU and memory
Cross-site scripting in justhtml 0.9.0-1.21.0 allows an attacker who can control the text content of HTML code or pre el
Cross-site scripting in justhtml before 3.11.0 allows remote unauthenticated attackers to execute arbitrary JavaScript i
Mutation XSS in justhtml (versions ≤1.11.0) allows injection of arbitrary HTML into serialized output when applications
Mutation XSS (mXSS) in justhtml 1.13.0 and earlier enables markup injection bypass against applications using non-defaul
Cross-site scripting in justhtml versions before 1.13.0 allows attackers who control `<pre>` element content to break ou
Sanitization bypass in justhtml (Python HTML sanitization library) before version 1.17.0 enables cross-site scripting in
EUVD-2026-64652
GHSA-9ph2-9r4x-rhjp
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB