GHSA-3rcm-vjrc-p45j: Justhtml JustHTML Has A Sanitizer Bypass Vulnerability
MODERATEGHSA-3rcm-vjrc-p45j is a MODERATE justhtml has a sanitizer bypass vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Justhtml libraries in the PyPI ecosystem. The issue involves justhtml has a sanitizer bypass (in markdown). Remediation is available by upgrading affected packages to version 1.12.0.
GHSA-3rcm-vjrc-p45j at a Glance
How to Fix GHSA-3rcm-vjrc-p45j
To remediate this vulnerability, upgrade all affected Justhtml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install justhtml>=1.12.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show justhtml
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-3rcm-vjrc-p45j, inspect your installed packages using pip:
pip show justhtml
Analyze the terminal output to locate any version of Justhtml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.12.0), your application is affected.
Note: The pip show justhtml command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Justhtml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-3rcm-vjrc-p45j Affected Justhtml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
justhtml
|
PyPI |
< 1.12.0
|
1.12.0
|
References
Frequently Asked Questions
What is GHSA-3rcm-vjrc-p45j?
Which Justhtml versions are affected?
What version fixes GHSA-3rcm-vjrc-p45j?
Is justhtml affected?
What CWE is associated with GHSA-3rcm-vjrc-p45j?
How can I check PyPI dependencies for GHSA-3rcm-vjrc-p45j?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3rcm-vjrc-p45j",
"modified" : "2026-03-18T20:19:56Z",
"published" : "2026-03-18T20:19:56Z",
"aliases" : [ ],
"summary" : "JustHTML has a Sanitizer Bypass (in Markdown)",
"details" : "## 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 `<script>...</script>`\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><img src=x onerror=alert(1)></p>\", fragment=True)\n\nprint(doc.to_html())\nprint()\nprint(doc.to_markdown())",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "justhtml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.12.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.11.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-3rcm-vjrc-p45j"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/EmilStenstrom/justhtml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-18T20:19:56Z",
"nvd_published_at" : null
}
}