Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-r758-8hxw-4845
No affected components available
Summary
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:
drop_foreign_namespaces=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
drop_foreign_namespaces=True - avoid allowlisting foreign namespaces for untrusted input
- avoid allowlisting raw-text containers such as
<style>in custom policies
Notes
The default JustHTML(..., sanitize=True) behavior was not found to be vulnerable in this issue.
Credit
Discovered by JustHTML author during a LLM-based security review of justhtml.
The vulnerability can be exploited over the network without needing physical access. It is difficult for an attacker to exploit this vulnerability and may require special conditions. An attacker does not need any special privileges or access rights.
Limited exploitation activity has been observed. Close monitoring and planned remediation are recommended.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard