{"id":"CVE-2026-8445","aliases":["CVE-2026-8445","GHSA-3rcm-vjrc-p45j"],"related":[],"kind":"vulnerability","state":"published","title":"justhtml before 1.12.0 Sanitizer Bypass via Markdown","summary":"justhtml versions <= 1.11.0 (fixed in 1.12.0) do not sufficiently escape HTML-significant characters (angle brackets) in text nodes when converting a parsed document to Markdown via to_markdown(). While a small set of Markdown metacharacters are escaped, characters such as < and > are preserved, so untrusted input that is safe in to_html() — including entity-decoded text (e.g. &lt;script&gt;) or text from RCDATA/RAWTEXT-parsed elements like <title>, <textarea>, <noscript>, and <plaintext> — can be emitted as raw HTML in the Markdown output, enabling a sanitizer bypass and potential cross-site scripting when that output is rendered.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"justhtml versions <= 1.11.0 (fixed in 1.12.0) do not sufficiently escape HTML-significant characters (angle brackets) in text nodes when converting a parsed document to Markdown via to_markdown(). While a small set of Markdown metacharacters are escaped, characters such as < and > are preserved, so untrusted input that is safe in to_html() — including entity-decoded text (e.g. &lt;script&gt;) or text from RCDATA/RAWTEXT-parsed elements like <title>, <textarea>, <noscript>, and <plaintext> — can be emitted as raw HTML in the Markdown output, enabling a sanitizer bypass and potential cross-site scripting when that output is rendered.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n`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.\n\nThis 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.\n\n## Details\n\nWhen 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.\n\nExamples of affected input include:\n\n- Text produced from entity-decoded input such as `&lt;script&gt;...&lt;/script&gt;`\n- Text inside elements like `<title>`, `<textarea>`, `<noscript>` (when parsed as raw text), and `<plaintext>`\n\nThis is distinct from actual `<script>` or `<style>` elements in the DOM. Those are already dropped by default in `to_markdown()` unless `html_passthrough=True`.\n\n## Proof of Concept\n\n### General case\n\n```python\nfrom justhtml import JustHTML\n\ndoc = JustHTML(\"<p>&lt;img src=x onerror=alert(1)&gt;</p>\", fragment=True)\n\nprint(doc.to_html())\nprint()\nprint(doc.to_markdown())","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones de justhtml menor o igual que 1.11.0 (corregido en 1.12.0) no escapan suficientemente los caracteres significativos de HTML (corchetes angulares) en los nodos de texto al convertir un documento analizado a Markdown a través de to_markdown(). Si bien un pequeño conjunto de metacaracteres de Markdown se escapan, caracteres como < y > se conservan, por lo que la entrada no confiable que es segura en to_html() - incluyendo texto decodificado por entidades (p. ej., <script>) o texto de elementos analizados como RCDATA/RAWTEXT como <title>, <textarea>, <noscript> y <plaintext> - puede ser emitido como HTML sin procesar en la salida de Markdown, lo que permite un bypass del saneador y potencial cross-site scripting cuando esa salida se renderiza.","source":"nvd"}],"published":"2026-03-18T20:19:56.000Z","modified":"2026-10-12T16:10:00.220Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":9.3,"rating":"CRITICAL"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.12.0","status":"affected"},{"type":"semver","version":"1.12.0","status":"unaffected"}],"vendor":"EmilStenstrom","product":"justhtml","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.12.0"}],"ecosystem":"PyPI","package":"justhtml","purl":"pkg:pypi/justhtml","source":"ghsa"}],"references":[{"url":"https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-3rcm-vjrc-p45j","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/justhtml-before-sanitizer-bypass-via-markdown","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/EmilStenstrom/justhtml","tags":["package"],"sources":["ghsa"]}],"credits":["kejcao"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-08-24T19:06:10.251Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-8445","url":"https://www.cve.org/CVERecord?id=CVE-2026-8445","licence":"CVE Terms of Use","modified":"2026-08-24T19:06:17.094Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3rcm-vjrc-p45j","url":"https://github.com/advisories/GHSA-3rcm-vjrc-p45j","licence":"CC-BY-4.0","modified":"2026-08-24T03:56:00.500Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-8445","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-8445","licence":"Public domain","modified":"2026-10-12T16:10:00.220Z"}],"updatedAt":"2026-11-25T22:59:34.970Z","epss":{"score":0.00381,"percentile":0.34196,"date":"2026-12-01T12:00:22.000Z"}}