GHSA-4p64-v8f5-r2gx: Justhtml Multiple Security Fixes Vulnerability
LOWGHSA-4p64-v8f5-r2gx is a LOW multiple security fixes vulnerability (CWE-436: Interpretation Conflict) affecting Justhtml libraries in the PyPI ecosystem. The issue involves multiple security fixes in justhtml. Remediation is available by upgrading affected packages to version 1.16.0.
GHSA-4p64-v8f5-r2gx at a Glance
How to Fix GHSA-4p64-v8f5-r2gx
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.16.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-4p64-v8f5-r2gx, 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.16.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-436: Interpretation Conflict, where product a handles inputs or steps differently than product b, which causes a to perform incorrect actions based on its perception of b's state. 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-4p64-v8f5-r2gx Affected Justhtml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
justhtml
|
PyPI |
< 1.16.0
|
1.16.0
|
References
Frequently Asked Questions
What is GHSA-4p64-v8f5-r2gx?
Which Justhtml versions are affected?
What version fixes GHSA-4p64-v8f5-r2gx?
Is justhtml affected?
What CWE is associated with GHSA-4p64-v8f5-r2gx?
How can I check PyPI dependencies for GHSA-4p64-v8f5-r2gx?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4p64-v8f5-r2gx",
"modified" : "2026-04-14T20:05:10Z",
"published" : "2026-04-14T20:05:10Z",
"aliases" : [ ],
"summary" : "Multiple security fixes in justhtml",
"details" : "## Summary\n\n`justhtml` `1.16.0` fixes multiple security issues in sanitization, serialization, and programmatic DOM handling.\n\nMost of these issues affected one of these advanced paths rather than ordinary parsed HTML with the default safe settings:\n\n- programmatic DOM input to `sanitize()` or `sanitize_dom()`\n- reused or mutated sanitization policy objects\n- custom policies that preserve foreign namespaces such as SVG or MathML\n\n## Affected versions\n\n- `justhtml` `<= 1.15.0`\n\n## Fixed version\n\n- `justhtml` `1.16.0` released on April 12, 2026\n\n## Impact\n\n### Policy reuse and mutation\nNested mutation of sanitization policy internals could weaken later sanitization by leaving stale compiled sanitizers active, or by mutating exported default policy internals process-wide.\n\n### In-memory sanitization gaps\nProgrammatic DOM sanitization could miss dangerous mixed-case tag names such as `ScRiPt` or `StYlE`, and custom `drop_content_tags` values such as `{\"SCRIPT\"}` could silently fail to drop dangerous subtrees.\n\n### Serialization injection\nCrafted programmatic doctype names could serialize into active markup before the document body.\n\n### Foreign-namespace policy bypasses\nCustom policies that preserve SVG or MathML could allow active SVG features to survive sanitization, including:\n\n- animation elements such as `<set>` and `<animate>` that mutate already-sanitized attributes after sanitization\n- presentation attributes such as `fill`, `clip-path`, `mask`, `marker-start`, and `cursor` containing external `url(...)` references\n- programmatic DOM trees that claim `namespace=\"html\"` but serialize as `<svg>` or `<math>`, bypassing foreign-content checks\n\n### Rawtext hardening gap\nMixed-case programmatic `style` or `script` nodes could bypass rawtext hardening and preserve active stylesheet content such as remote `@import` rules.\n\n## Default configuration\n\nMost of these issues did **not** affect the normal `JustHTML(..., sanitize=True)` path for ordinary parsed HTML.\n\nThe main exceptions were policy-mutation issues, which could weaken later sanitization if code mutated nested state on reused policy objects or exported defaults.\n\n## Recommended action\n\nUpgrade to `justhtml` `1.16.0`.\n\nIf you cannot upgrade immediately:\n\n- do not mutate `DEFAULT_POLICY`, `DEFAULT_DOCUMENT_POLICY`, or nested policy internals\n- avoid reusing policy objects after mutating nested state\n- avoid preserving SVG or MathML for untrusted input\n- avoid preserving `style` or `script` in custom policies for untrusted input\n- avoid serializing untrusted programmatic doctypes or DOM trees\n\n## Credit\n\nDiscovered during an internal security review of `justhtml`.",
"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/E:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "justhtml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.16.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.15.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-4p64-v8f5-r2gx"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/EmilStenstrom/justhtml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-178", "CWE-436", "CWE-471", "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-14T20:05:10Z",
"nvd_published_at" : null
}
}