CVE-2026-72925 SWC HTML minifier may allow script element breakout when minifying embedded JSON

Medium 6.1 Published Updated

An attacker can execute arbitrary JavaScript in the victim's browser by injecting a closing script tag into JSON data processed by the SWC HTML minifier.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-72925?

CVE-2026-72925 is a medium-severity cross-site scripting vulnerability in @swc html, published on 11 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

SWC is a TypeScript / JavaScript compiler written in Rust. Prior to @swc/html 1.15.47-nightly-20260729.1 and swc_html_minifier 59.0.0, the minifyJson processing in crates/swc_html_minifier/src/lib.rs parsed and serialized attacker-controlled JSON in application/json and application/ld+json script elements without the escape_json_for_html_script behavior to re-escape less-than signs, allowing a closing script sequence to terminate the element early and execute script in the generated page's origin. This issue is fixed in @swc/html 1.15.47-nightly-20260729.1 and swc_html_minifier 59.0.0.

Weakness: CWE-79, CWE-116

Which versions are affected by CVE-2026-72925?

4 open source packages ship an affected version, including @swc/html and swc_html_minifier.

PackageAffectedFixed in
@swc/html npmAll versions1.15.47-nightly-20260729.1
@swc/html npmAll versions1.15.47-nightly-20260729.1
swc_html_minifier crates.ioAll versions59.0.0
swc_html_minifier crates.ioAll versions59.0.0

How do I fix CVE-2026-72925?

Upgrade @swc/html to 1.15.47-nightly-20260729.1 or later.

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-2026-72925 being exploited?

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

Sources

Also known as GHSA-5qr2-v392-m9g8.

Is CVE-2026-72925 in your software?

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

Check your SBOMs for free