A flaw in the Python library justhtml lets untrusted text escape sanitization when converted to Markdown, allowing raw HTML, and potential cross-site scripting, to reach rendered output.
What Is It
justhtml versions before 1.12.0 do not sufficiently escape HTML-significant characters when converting a parsed document to Markdown via to_markdown(). The function escapes a small set of Markdown metacharacters, but leaves angle brackets (< and >) intact in text nodes.
The result is an inconsistency between two output paths. Input that to_html() renders safely, including entity-decoded text such as <script>, or text taken from RCDATA/RAWTEXT-parsed elements like <title>, <textarea>, <noscript>, and <plaintext>, can be emitted as raw HTML in the Markdown output. When that Markdown is later rendered, the sanitizer has effectively been bypassed.
The issue is classified as CWE-79 (cross-site scripting).
Why It Matters
The CVE record carries a CVSS 3.1 base score of 9.8 (CRITICAL) with vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, network-reachable, low complexity, no privileges and no user interaction required; alongside a CVSS 4.0 score of 9.3 (CRITICAL). Both are the assigning CNA's scores, carried through to the NVD entry. NVD has not yet completed its own analysis, so it has published no independent severity assessment; treat these numbers as provisional. The 3.1 vector in particular claims full confidentiality, integrity, and availability impact with no user interaction, which is an aggressive reading for a stored-XSS sanitizer bypass whose exploitation normally depends on a victim rendering the affected output.
The practical risk is that developers reasonably assume both output paths carry the same guarantees. Any pipeline that sanitizes with justhtml and then serves the Markdown output, user comments, content ingestion, document conversion, inherits an XSS path from content the library was expected to neutralize.
There is no CISA KEV entry for this CVE, so there is no confirmation of active exploitation at this time.
What's Vulnerable
- Vendor: EmilStenstrom
- Product:
justhtml(PyPI,pkg:pypi/justhtml) - Affected: all versions before 1.12.0
- Not affected: 1.12.0 and later
Exposure depends on use of to_markdown() against untrusted input.
Patch Status
Fixed in justhtml 1.12.0. Upgrade to 1.12.0 or later. No workaround is documented in the supplied advisory data; because the flaw is in the escaping logic itself, upgrading is the remediation.
The NVD record was published 2026-08-23 with a vulnerability status of "Received," meaning NVD analysis is not yet complete and the affected-version ranges and scoring may still change.
Sources
- NVD, CVE-2026-8445, https://nvd.nist.gov/vuln/detail/CVE-2026-8445
- GitHub Security Advisory GHSA-3rcm-vjrc-p45j; https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-3rcm-vjrc-p45j
- VulnCheck Advisory; https://www.vulncheck.com/advisories/justhtml-before-sanitizer-bypass-via-markdown