Read the docs
TI-2026-66392 Aliases GHSA-3rcm-vjrc-p45j

JustHTML has a Sanitizer Bypass (in Markdown)

Priority LOW 38CWE-79Published · Updated

Key facts

Attack vector
—
Privileges required
—
User interaction
—
Attack complexity
—
Impact type
Cross-site scripting
Confidentiality · integrity · availability
—
Fix status
Fixed

No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-79.

Summary

## Summary `to_markdown()` does not sufficiently escape text content that looks like HTML. As a result, untrusted input that is safe in `to_html()` can become raw HTML in Markdown output. This is not specific to tokenizer raw-text states like `<title>`, `<noscript>`, or `<plaintext>`, although those states can trigger the behavior. The root cause is broader: Markdown text serialization leaves angle brackets unescaped in text nodes. ## Details When converting a parsed document to Markdown, text nodes are escaped for a small set of Markdown metacharacters, but HTML-significant characters such as `<` and `>` are preserved. That means content parsed as text, including entity-decoded text or text produced by RCDATA/RAWTEXT-style parsing, can be emitted into Markdown as raw HTML. Examples of affected input include: - Text produced from entity-decoded input such as `&lt;script&gt;...&lt;/script&gt;` - Text inside elements like `<title>`, `<textarea>`, `<noscript>` (when parsed as raw text), and `<plaintext>` This is distinct from actual `<script>` or `<style>` elements in the DOM. Those are already dropped by default in `to_markdown()` unless `html_passthrough=True`. ## Proof of Concept ### General case ```python from justhtml import JustHTML doc = JustHTML("<p>&lt;img src=x onerror=alert(1)&gt;</p>", fragment=True) print(doc.to_html()) print() print(doc.to_markdown())

Why it matters now

Fix Fixed justhtml (PyPI): 1.12.0

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—justhtml (PyPI)before 1.12.01.12.0Patch availableGHSA-3rcm-vjrc-p45j
  • justhtml (PyPI) Vendor— Affected before 1.12.0 Fixed in 1.12.0 Patch available GHSA-3rcm-vjrc-p45j

Remediation

  • Fix · GHSA-3rcm-vjrc-p45j justhtml (PyPI) Fixed in 1.12.0 Advisory →

Timeline

  1. 2026-10-03 Threatist record created from GHSA-3rcm-vjrc-p45j

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences