Skip to main content

justhtml EUVDEUVD-2026-64660

| CVE-2026-8630 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-08-23 VulnCheck GHSA-rc3v-3cc7-h7h5
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Supply malicious text node with closing tag sequence
  2. Delivery
    Application processes DOM with permissive custom policy
  3. Exploit
    sanitize_dom() serializes text literally without escaping
  4. Execution
    Serialized output contains injected HTML markup
  5. Persist
    Victim browser renders serialized page
  6. Impact
    Injected script executes in victim browser context

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

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

Exploitation Conditions

Exploitation requires that the target application uses justhtml with a custom sanitization policy that explicitly permits retention of <style> or <script> elements, overriding the default policy which discards their contents. The application must additionally accept attacker-controlled input that ends up as a text node inside one of these permitted elements, and the serialized HTML output must subsequently be rendered in a victim's browser (UI:A - user interaction required). Applications using only the built-in default policy are completely unaffected regardless of version. Limiting factors include: the non-default custom policy requirement, the need for downstream browser rendering of the serialized output, and required user interaction to trigger execution.

Impact

The CVSS 4.0 score of 5.1 (Medium) with SC:L/SI:L and UI:A accurately reflects the constrained impact: only the subsequent system (the victim's browser) is affected, with low confidentiality and integrity impact, and user interaction is required to trigger rendering. The critical limiting factor is the non-default configuration prerequisite - applications must explicitly override the default policy to retain style or script elements before this serialization path is reachable, substantially narrowing the realistic attack surface to a subset of justhtml deployments. No KEV listing exists and active exploitation has not been confirmed. EPSS data was not provided in the source intelligence; given the narrow prerequisite, real-world exploitation probability is likely low even among affected deployments. The vulnerability is a genuine concern for any application that uses justhtml with a permissive policy for style or script elements, and upgrading to 1.12.0 should be treated as routine hygiene rather than an emergency response for teams not using such a custom policy.

Exploit ScenarioDerived

An attacker submits content containing a text node inside a permitted <style> element with the value </style><img src=x onerror=alert(document.cookie)>. When the application passes the resulting DOM through sanitize_dom() with a custom policy retaining style elements and then renders the serialized string in a browser, the literal </style> closes the style block and the injected img tag executes attacker JavaScript in the victim's browser session. No public exploit code has been identified at time of analysis, but the GHSA advisory exposes source-level detail sufficient to construct a proof of concept.

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

Mutation XSS in justhtml (versions ≤1.11.0) allows injection of arbitrary HTML into serialized output when applications use a custom sanitization policy that retains raw-text elements such as <style> or <script>. Attacker-controlled text node content containing a closing tag sequence causes the serializer to break out of the raw-text context, inserting attacker-supplied markup into the final HTML string rendered by a victim's browser. No public exploit has been identified at time of analysis, but a vendor-released patch exists in version 1.12.0.

RemediationAI

Upgrade justhtml to version 1.12.0, which contains the vendor-released patch confirmed by GitHub Security Advisory GHSA-qvc2-mg72-jjhx (https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-qvc2-mg72-jjhx) and the VulnCheck advisory (https://www.vulncheck.com/advisories/justhtml-before-mutation-xss-via-raw-text-elements). If an immediate upgrade is not feasible, the most effective workaround is to revise the custom sanitization policy to drop or strip style and script elements entirely, aligning it with the default policy behavior; this eliminates the vulnerable serialization path at the cost of losing any intentional style or script passthrough in the output. No other compensating control fully mitigates the flaw without restricting these element types, as the vulnerability is inherent to their literal serialization.

Affected VersionsENISA

justhtml 0 <1.12.0

Affected Packages

pypi justhtml fix: 1.12.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 HTML sanitization library (pip package, CPE: cpe:2.3:a:emilstenstrom:justhtml:*:*:*:*:*:*:*:*) that produces safe HTML from untrusted DOM trees via sanitize_dom(). The root cause (CWE-79: Improper Neutralization of Input During Web Page Generation) resides in serialize.py, where text children of elements in the frozenset _LITERAL_TEXT_SERIALIZATION_ELEMENTS (containing 'script' and 'style') are emitted verbatim via return text instead of being passed through _escape_text(). This is a classic mutation XSS (mXSS) pattern: a text node containing </style>injected HTML is safely inert in a live DOM, but when serialized literally it produces a string that a browser re-parses as closing the <style> element and introducing arbitrary markup. The vulnerability path is only reachable when the caller supplies a custom policy that permits retention of style or script elements; the default justhtml policy discards their contents and is therefore completely unaffected.

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

AC:H because exploitation requires a non-default custom policy retaining style/script elements; S:C and UI:R reflect browser-side XSS impact requiring victim interaction.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:P/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 before 1.12.0 (versions <= 1.11.0) contains a mutation cross-site scripting (mXSS) vulnerability in the serialization of raw-text elements such as <style> and <script>. When a DOM tree is processed by sanitize_dom() using a custom policy that keeps these elements, text nodes inside them are serialized literally without escaping, allowing attacker-controlled text containing the matching closing tag sequence to break out of the raw-text context and inject arbitrary HTML into the serialized output. The default sanitization policy is not affected because it drops the contents of style and script.

Threat Intelligence Overview

EPSS Score
0.2%
Top 92% exploitable
Prevalence
Low
niche Python HTML sanitization library, limited enterprise footprint
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment 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 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
None
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-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