CVE-2026-5388 justhtml before 1.15.0 Multiple Security Issues
Attackers can bypass sanitization to inject malicious HTML and JavaScript via specific configurations or helper APIs in the justhtml library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-5388?
CVE-2026-5388 is a critical cross-site scripting vulnerability in EmilStenstrom justhtml, published on 23 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-20
Which versions are affected by CVE-2026-5388?
2 open source packages ship an affected version, including justhtml.
| Package | Affected | Fixed in |
|---|---|---|
justhtml PyPI | All versions | 1.15.0 |
justhtml PyPI | All versions | 1.15.0 |
How do I fix CVE-2026-5388?
Upgrade justhtml to 1.15.0 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-5388 being exploited?
There is no known exploitation of CVE-2026-5388 in the wild and no public exploit code.
Sources
Also known as GHSA-9ph2-9r4x-rhjp, GHSA-c9vm-hv86-f23r.