Skip to main content

justhtml EUVDEUVD-2026-64653

| CVE-2026-5389 MEDIUM
Basic XSS (CWE-80)
2026-08-23 VulnCheck GHSA-q3jf-9wv7-p29w
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Craft HTML with backtick-laden pre element
  2. Delivery
    Application calls to_markdown() on user input
  3. Exploit
    Fixed three-backtick fence broken by backtick run
  4. Execution
    Decoded HTML entities escape code fence as raw HTML
  5. Persist
    Victim views page rendered by CommonMark/GFM renderer
  6. Impact
    XSS payload executes in victim browser

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization HTML tag escaping
MITRE ATT&CK

1 technique across 1 tactic: Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three chained conditions: (1) the application passes attacker-controlled HTML that includes <pre> elements to JustHTML(..., sanitize=True).to_markdown() - applications that only call to_html() are unaffected; (2) the attacker can embed a backtick run of three or more characters and HTML-entity-encoded tags inside the <pre> element; and (3) the resulting Markdown output is rendered by a CommonMark- or GFM-compatible renderer that permits raw HTML passthrough (e.g., GitHub Flavored Markdown in permissive mode, marked.js with sanitize: false). What limits exploitation: the CVSS UI:A metric confirms a victim must actively render the Markdown; renderers configured to strip raw HTML block the payload at the final step; and only the <pre> serialization path is affected - regular text node content was already hardened in v1.12.0.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N, score 5.1) accurately reflects the multi-hop nature of this vulnerability: impact is limited to the subsequent system (browser/renderer) and requires active user interaction to render the crafted Markdown. No EPSS data is available, and the vulnerability is not listed in CISA KEV, indicating no confirmed widespread active exploitation. However, a detailed PoC with working Python code is embedded in the public GHSA advisory, lowering the bar for exploitation. The realistic risk is constrained to applications that (1) accept attacker-controlled HTML containing <pre> elements, (2) call to_markdown() on that input, and (3) feed the result to a raw-HTML-permitting Markdown renderer. Applications using only to_html() are unaffected. This is a medium-priority finding for affected deployment patterns - real risk exists but only within a specific pipeline.

Exploit ScenarioDerived

An attacker submits a comment or document containing <pre>&#96;&#96;&#96; &lt;img src=x onerror=alert(document.cookie)&gt;</pre> to an application that processes user HTML through JustHTML(..., sanitize=True).to_markdown() and then displays the result in a web page via a CommonMark renderer. The fixed ` delimiter is broken by the backtick run, placing the decoded <img> tag outside the code fence; when a victim views the page, the onerror handler fires and the attacker's script executes. The PoC in the GHSA advisory demonstrates this end-to-end.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Aug 23, 2026

Cross-site scripting in justhtml versions before 1.13.0 allows attackers who control <pre> element content to break out of fixed-length Markdown code fences and inject raw HTML into the serialized output. When an application passes attacker-supplied HTML through JustHTML(..., sanitize=True).to_markdown() and a downstream CommonMark or GFM renderer processes the result with raw-HTML enabled, the injected script executes in the victim's browser. A proof-of-concept with full reproduction steps is publicly available in the GHSA advisory; no public exploit identified at time of analysis beyond that PoC.

RemediationAI

Upgrade justhtml to version 1.13.0 or later via pip install --upgrade justhtml; the fix is confirmed in patch commit f35f8f723c713bd8f912d86e9ec6881275ff5af9 (https://github.com/EmilStenstrom/justhtml/commit/f35f8f723c713bd8f912d86e9ec6881275ff5af9). The vendor advisory is at https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-5vp3-3cg6-2rq3. If an immediate upgrade is not possible, the most effective compensating control is to sanitize or strip <pre> element content before passing it to to_markdown(), or to disable raw HTML in the downstream Markdown renderer (e.g., set unsafe: false in marked.js or use html_blocks extension disabled in Python-Markdown). Disabling raw HTML in the renderer breaks the exploit chain regardless of fence escaping, but may break legitimate formatting in the application. Alternatively, avoid calling to_markdown() on attacker-controlled input until the patch is applied.

Affected VersionsENISA

justhtml 0 <1.13.0

Affected Packages

pypi justhtml fix: 1.13.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 (pip/justhtml, CPE: cpe:2.3:a:emilstenstrom:justhtml:*:*:*:*:*:*:*:*) is a Python library that parses HTML and serializes it to safe Markdown. The root cause is CWE-80 (Improper Neutralization of Script-Related HTML Tags) in the to_markdown() <pre> serialization path. That path extracts decoded text from a <pre> subtree, wraps it with a hardcoded three-backtick fence delimiter, and writes it directly to output. Because the fence length is fixed rather than dynamically chosen to exceed the longest backtick run in the content, an attacker-supplied run of three or more backticks terminates the fence prematurely. Any decoded HTML-like entities (e.g., &lt;img src=x onerror=alert(1)&gt;) that follow appear outside the code block as raw HTML. The v1.12.0 hardening applied HTML escaping to regular text nodes but left the <pre> path unprotected, making this a targeted bypass of that prior fix.

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 5.1 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
vuln.today AI 6.1 MEDIUM

Network-delivered payload requires victim to render Markdown (UI:R); scope changes to browser context (S:C); XSS yields limited confidentiality and integrity impact only.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/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
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 23, 2026 - 14:01 EUVD

DescriptionCVE.org

justhtml versions before 1.13.0 contain a cross-site scripting vulnerability in the to_markdown() function when serializing attacker-controlled pre content. Attackers can place backticks inside sanitized pre elements to break out of fixed-length code fences, allowing raw HTML to execute when the generated Markdown is rendered by CommonMark or GFM-style renderers.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 1 pypi packages depend on justhtml (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 1.13.0.

Threat Intelligence Overview

EPSS Score
0.2%
Top 92% exploitable
Prevalence
Low
niche Python HTML-to-Markdown library, limited enterprise footprint
Data Quality
6 sources
Confidence: High

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
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· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

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-5388 CRITICAL
9.3 Aug 23

Sanitization bypass in justhtml (a Python HTML/Markdown sanitization library) before 1.15.0 lets attacker-controlled inp

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