Skip to main content

justhtml CVE-2026-5388

| EUVDEUVD-2026-64652 CRITICAL
Improper Input Validation (CWE-20)
2026-08-23 VulnCheck GHSA-9ph2-9r4x-rhjp
9.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft encoded javascript: URL or markup-breaking input
  2. Delivery
    Submit to app using affected justhtml helper/passthrough/custom policy
  3. Exploit
    Sanitizer accepts malformed value as safe
  4. Execution
    Active HTML/JS reintroduced into output
  5. Persist
    Victim renders page, script executes in browser
  6. Impact
    Session 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&#58...' 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

justhtml 0 <1.15.0

Affected Packages

pypi justhtml fix: 1.15.0

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&#58...') 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

Vendor (VulnCheck) PRIMARY 9.3 CRITICAL
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
vuln.today AI 4.7 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 23, 2026 - 14:01 EUVD
CVE Published
Aug 23, 2026 - 13:34 cve.org
CRITICAL 9.3

DescriptionCVE.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

Why It Matters

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.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Prevalence
Low
niche Python HTML-sanitization library, limited adoption versus bleach/nh3
Social Media
4
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

CVE-2026-9769 HIGH POC
8.7 Aug 23

Uncontrolled recursion in the justhtml Python HTML parsing library (all versions through 1.9.1) allows any remote unauth

CVE-2026-8445 CRITICAL
9.3 Aug 23

Sanitizer bypass in the justhtml Python library (versions <= 1.11.0) allows attacker-controlled input to survive as raw

CVE-2026-7808 CRITICAL
9.3 Aug 23

Cross-site scripting via HTML sanitization bypass affects justhtml (a Python HTML parsing/sanitization library by EmilSt

CVE-2026-4671 HIGH
8.7 Aug 23

Uncontrolled resource consumption in justhtml before 1.18.0 enables denial-of-service conditions through CPU and memory

CVE-2026-77088 MEDIUM
5.3 Aug 23

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

CVE-2026-74793 MEDIUM
5.1 Aug 23

Cross-site scripting in justhtml before 3.11.0 allows remote unauthenticated attackers to execute arbitrary JavaScript i

CVE-2026-8630 MEDIUM
5.1 Aug 23

Mutation XSS in justhtml (versions ≤1.11.0) allows injection of arbitrary HTML into serialized output when applications

CVE-2026-5751 MEDIUM
5.1 Aug 23

Mutation XSS (mXSS) in justhtml 1.13.0 and earlier enables markup injection bypass against applications using non-defaul

CVE-2026-5389 MEDIUM
5.1 Aug 23

Cross-site scripting in justhtml versions before 1.13.0 allows attackers who control `<pre>` element content to break ou

CVE-2026-6827 MEDIUM
5.1 Aug 23

Sanitization bypass in justhtml (Python HTML sanitization library) before version 1.17.0 enables cross-site scripting in

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy