CVE-2025-52561 HTMLSanitizer.jl Possible XSS

Medium 6.9 Published Updated

An attacker can execute arbitrary JavaScript via tag injection in HTML sanitized by this Julia library when the style tag is whitelisted.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-52561?

CVE-2025-52561 is a medium-severity cross-site scripting vulnerability in JuliaComputing HTMLSanitizer.jl, published on 23 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

HTMLSanitizer.jl is a Whitelist-based HTML sanitizer. Prior to version 0.2.1, when adding the style tag to the whitelist, content inside the tag is incorrectly unescaped, and closing tags injected as content are interpreted as real HTML, enabling tag injection and JavaScript execution. This could result in possible cross-site scripting (XSS) in any HTML that is sanitized with this library. This issue has been patched in version 0.2.1. A workaround involves adding the math and svg elements to the whitelist manually.

Weakness: CWE-79

Which versions are affected by CVE-2025-52561?

How do I fix CVE-2025-52561?

Upgrade to a fixed version.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-52561 being exploited?

There is no known exploitation of CVE-2025-52561 in the wild and no public exploit code.

Sources

Also known as GHSA-3mj7-qxh9-6q4p, JLSEC-2025-39.

Is CVE-2025-52561 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free