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

- **Severity:** Critical 9.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 23 Aug 2026
- **Updated:** 26 Aug 2026
- **Also known as:** GHSA-9ph2-9r4x-rhjp, GHSA-c9vm-hv86-f23r

## 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 (Improper Input Validation)

## Which versions are affected by CVE-2026-5388?

2 open source packages ship an affected version, including justhtml.


| Package | Ecosystem | 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.

## Is CVE-2026-5388 being exploited?

There is no known exploitation of CVE-2026-5388 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-5388 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2026-5388 in the wild and no public exploit code.

Affected packages and fixed versions:
- justhtml (PyPI): affected all versions; fixed in 1.15.0
- justhtml (PyPI): affected all versions; fixed in 1.15.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-5388/ (Markdown: https://insights.sbomify.com/CVE-2026-5388/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-5388
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-5388
- OSV: https://osv.dev/vulnerability/CVE-2026-5388

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-5388/
Summaries are generated and may contain mistakes; the official description above is the record.
