Skip to content

← Public intelligence

PyPI package

justhtml

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

10 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 6.1PyPIAmendedPublished

    justhtml: to_markdown() code-span blank-line breakout enables XSS

    CVE-2026-77088 · GHSA-jf6w-2mvx-633j

    Affected
    • PyPI justhtml >= 0.9.0, <= 1.21.0
    Fixed in
    1.22.0· Vendor fix available
    Issue
    justhtml: tomarkdown() code-span blank-line breakout enables XSS Summary In justhtml 0.9.0 through 1.21.0, tomarkdown() renders <code text (and <pre text inside a link) as an inline Markdown code span whose only protection is backtick-fence length. A blank line (\n\n) in that text terminates the inline span in any compliant Markdown renderer, so attacker-controlled text that survived HTML sanitization is emitted unescaped after the blank line and is re-parsed as live raw HTML/Markdown — yielding XSS in the default configuration. Likely CWE-79 (Cross-site Scripting) arising from CWE-116 (Improper Encoding/Escaping of Output). Details tomarkdown() is documented as a safety surface. docs/text.md states the guarantee applies "to the HTML produced by rendering that Markdown with a compliant Markdown renderer," and SECURITY.md promises tomarkdown() "escapes line-start Markdown markers that could change block structure" and "uses code fences long enough to contain backticks safely." The…

    Recommended action: Upgrade to 1.22.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. UnratedPyPIAmendedPublished

    justhtml introduces denial-of-service hardening

    CVE-2026-4671 · GHSA-r8cj-3554-33mr

    Affected
    • PyPI justhtml < 1.18.0
    Fixed in
    1.18.0· Vendor fix available
    Issue
    justhtml 1.18.0 fixes multiple low-severity denial-of-service hardening issues in CSS selector handling and linkification. These issues are availability concerns. They do not allow script execution, data disclosure, or sanitizer bypass by themselves. Affected versions - justhtml < 1.18.0 Fixed version - justhtml 1.18.0 released on May 4, 2026 Impact CSS selector handling Applications that evaluate attacker-controlled selector strings, or that run selector-based transform pipelines over attacker-controlled documents, could consume disproportionate CPU or memory. The affected selector patterns included oversized selectors, large selector lists, oversized compound selectors, long combinator chains, deeply nested functional pseudo-classes such as :not(...), repeated attribute/class token matching over large values, repeated sibling or ancestor scans, repeated positional pseudo-class work, and :contains(...) over large descendant text. Programmatically constructed malformed DOM…

    Recommended action: Upgrade to 1.18.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. Medium, CVSS 6.0PyPIAmendedPublished

    justhtml has sanitization bypass in custom policies and programmatic DOM

    CVE-2026-6827 · GHSA-vrx2-77f2-ww34

    Affected
    • PyPI justhtml < 1.17.0
    Fixed in
    1.17.0· Vendor fix available
    Issue
    justhtml 1.17.0 fixes multiple security issues in sanitization, serialization, and programmatic DOM handling. Most of these issues affected advanced or custom configurations rather than the default safe path. Affected versions - justhtml <= 1.16.0 Fixed version - justhtml 1.17.0 released on April 19, 2026 Impact Custom SVG / MathML sanitization policies Custom policies that preserved foreign namespaces could allow dangerous content to survive sanitization, including: - active HTML integration points such as SVG <foreignObject, MathML <annotation-xml encoding="text/html", SVG <title / <desc, and MathML text integration points - mutation-XSS parser-differential payloads that looked inert in memory but became active HTML after reparse - SVG filter="url(...)" attributes that could trigger external fetches These issues affected: - JustHTML(..., sanitize=True) with custom foreign-namespace policies - sanitize() / sanitizedom() - low-level terminal Sanitize(...) transform execution…

    Recommended action: Upgrade to 1.17.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. Low, CVSS 1.3PyPIAmendedPublished

    Multiple security fixes in justhtml

    CVE-2026-7808 · GHSA-4p64-v8f5-r2gx

    Affected
    • PyPI justhtml <= 1.15.0
    Fixed in
    1.16.0· Vendor fix available
    Issue
    justhtml 1.16.0 fixes multiple security issues in sanitization, serialization, and programmatic DOM handling. Most of these issues affected one of these advanced paths rather than ordinary parsed HTML with the default safe settings: - programmatic DOM input to sanitize() or sanitizedom() - reused or mutated sanitization policy objects - custom policies that preserve foreign namespaces such as SVG or MathML Affected versions - justhtml <= 1.15.0 Fixed version - justhtml 1.16.0 released on April 12, 2026 Impact Policy reuse and mutation Nested mutation of sanitization policy internals could weaken later sanitization by leaving stale compiled sanitizers active, or by mutating exported default policy internals process-wide. In-memory sanitization gaps Programmatic DOM sanitization could miss dangerous mixed-case tag names such as ScRiPt or StYlE, and custom dropcontenttags values such as {"SCRIPT"} could silently fail to drop dangerous subtrees. Serialization injection Crafted…

    Recommended action: Upgrade to 1.16.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. UnratedPyPIAmendedPublished

    justhtml includes multiple security fixes

    CVE-2026-5388 · GHSA-c9vm-hv86-f23r

    Affected
    • PyPI justhtml <= 1.14.0
    Fixed in
    1.15.0· Vendor fix available
    Issue
    justhtml 1.15.0 includes multiple security fixes affecting URL sanitization helpers, HTML serialization, Markdown passthrough, and several custom sanitization-policy edge cases. These issues have different impact levels and do not all affect the default configuration in the same way. Affected versions - justhtml <= 1.14.0 Fixed version - justhtml 1.15.0 released on April 9, 2026 Impact overview Helper and serialization issues These issues could affect applications using JustHTML helpers or programmatic DOM construction, even outside the default HTML sanitization path. - JustHTML.cleanurlvalue(...) and cleanurlinjsstring(...) could accept URL values such as javascript&#58..., which became active javascript: URLs after HTML attribute parsing. - URL sanitization could treat values like \\evil.example/x or /\\evil.example/x as safe relative URLs even though browsers could resolve them as remote requests. - Malformed bracketed hosts such as https://[evil.example]/x could raise…

    Recommended action: Upgrade to 1.15.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  6. Low, CVSS 2.1PyPIAmendedPublished

    justhtml: Mutation XSS with custom foreign-namespace sanitization policies

    CVE-2026-5751 · GHSA-r758-8hxw-4845

    Affected
    • PyPI justhtml >= 1.13.0, < 1.14.0
    Fixed in
    1.14.0· Vendor fix available
    Issue
    A parser-differential / mutation XSS issue was found in justhtml when using a custom sanitization policy that preserves foreign namespaces such as SVG or MathML. Under these custom settings, specially crafted input could sanitize into HTML that looked safe at first, but became unsafe when parsed again by a browser or another HTML parser. Impact This issue does not affect the default safe configuration. You may be affected if you use a custom SanitizationPolicy with settings like: - dropforeignnamespaces=False - allowlisted foreign elements such as MathML or SVG - allowlisted raw-text containers such as <style In that case, an attacker could inject markup that survives sanitization and turns into active HTML after re-parsing. Affected versions - justhtml <= 1.13.0 Fixed version - Fixed in 1.14.0 Workarounds Until you upgrade: - keep dropforeignnamespaces=True - avoid allowlisting foreign namespaces for untrusted input - avoid allowlisting raw-text containers such as <style in…

    Recommended action: Upgrade to 1.14.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  7. High, CVSS 7.1PyPIAmendedPublished

    JustHTML is vulnerable to XSS via code fence breakout in content

    CVE-2026-5389 · GHSA-5vp3-3cg6-2rq3

    Affected
    • PyPI justhtml <= 1.12.0
    Fixed in
    1.13.0· Vendor fix available
    Issue
    tomarkdown() is vulnerable when serializing attacker-controlled <pre content. The <pre handler emits a fixed three-backtick fenced code block, but writes decoded text content into that fence without choosing a delimiter longer than any backtick run inside the content. An attacker can place backticks and HTML-like text inside a sanitized <pre element so that the generated Markdown closes the fence early and leaves raw HTML outside the code block. When that Markdown is rendered by a CommonMark/GFM-style renderer that allows raw HTML, the HTML executes. This is a bypass of the v1.12.0 Markdown hardening. That fix escaped HTML-significant characters for regular text nodes, but <pre uses a separate serialization path and does not apply the same protection. Details The vulnerable <pre Markdown path: - extracts decoded text from the <pre subtree - opens a fenced block with a fixed delimiter of - writes the decoded text directly into the output - closes with another fixed Because the…

    Recommended action: Upgrade to 1.13.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  8. Medium, CVSS 5.3PyPIAmendedPublished

    JustHTML has a Sanitizer Bypass (in Markdown)

    CVE-2026-8445 · GHSA-3rcm-vjrc-p45j

    Affected
    • PyPI justhtml <= 1.11.0
    Fixed in
    1.12.0· Vendor fix available
    Issue
    tomarkdown() does not sufficiently escape text content that looks like HTML. As a result, untrusted input that is safe in tohtml() 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…

    Recommended action: Upgrade to 1.12.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  9. Medium, CVSS 5.3PyPIAmendedPublished

    JustHTML Affected by Mutation XSS via Literal Text Serialization in Raw Text Elements (style/script)

    CVE-2026-8630 · GHSA-qvc2-mg72-jjhx

    Affected
    • PyPI justhtml <= 1.11.0
    Fixed in
    1.12.0· Vendor fix available
    Issue
    Sanitized DOM trees can be unsafe to serialize when a custom policy allows raw-text elements such as <style or <script. The issue affects DOM trees that are constructed or modified programmatically and then passed through sanitizedom() with a policy that keeps these elements. Text nodes inside <style and <script are serialized literally, so attacker-controlled text containing the matching closing tag sequence can break out of the raw-text context and inject HTML into the serialized output. The default sanitization policy is not affected because it drops the contents of style and script. Details The root cause is in HTML serialization of raw-text elements. In serialize.py, text children of script and style are emitted verbatim: python LITERALTEXTSERIALIZATIONELEMENTS = frozenset({"script", "style"}) def serializetextforparent(text: str | None, parentname: str | None) - str: if not text: return "" if parentname in LITERALTEXTSERIALIZATIONELEMENTS: return text return…

    Recommended action: Upgrade to 1.12.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  10. High, CVSS 7.1PyPIAmendedPublished

    Uncontrolled recursion DoS in JustHTML() via deeply nested HTML

    CVE-2026-9769 · GHSA-v7cf-c9rm-wm3j

    Affected
    • PyPI justhtml <= 1.9.1
    Fixed in
    1.10.0· Vendor fix available
    Issue
    justhtml through 1.9.1 allows denial of service via deeply nested HTML. During parsing, JustHTML.init() always reaches TreeBuilder.finish(), which unconditionally calls populateselectedcontent(). That function recursively traverses the DOM via findelements() / findelement() without a depth bound, allowing attacker-controlled deeply nested input to trigger an unhandled RecursionError on CPython. Depending on the host application's exception handling, this can abort parsing, fail requests, or terminate a worker/process. Details TreeBuilder.finish() (treebuilder.py#L476) unconditionally calls populateselectedcontent(self.document) at line 494. populateselectedcontent() (treebuilder.py#L1243) calls findelements() (treebuilder.py#L1280) to recursively search the DOM tree for <select elements: When the DOM tree depth exceeds CPython's default recursion limit (1000), this raises an unhandled RecursionError. The full call path is: JustHTML(html) → tokenizer.run() →…

    Recommended action: Upgrade to 1.10.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →