CVE-2026-72925 — Vulnerability in swc_html_minifier — CVE Details
SWC HTML minifier may allow script element breakout when minifying embedded JSON
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.34%). Schedule for your next planned update.
Does your project use an affected swc_html_minifier version?
Paste your Cargo.lock to check it for CVE-2026-72925 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
@swc/html minifies JSON contained in script elements such as
application/json and application/ld+json by parsing and serializing the
JSON value.
Before the patched versions, JSON serialization could convert escaped
less-than signs such as \u003C into literal < characters. If the JSON
contained an escaped </script> sequence, the generated HTML could terminate
the containing script element early because HTML tokenization occurs before
the JSON is consumed.
Applications that minify HTML containing attacker-controlled JSON data could therefore transform inert data into active markup. A crafted payload could execute script in the origin of the generated page.
Patches
The issue is fixed in:
@swc/html1.15.47swc_html_minifier59.0.0
The minifier now re-escapes less-than signs after JSON serialization, preserving the script element boundary.
Workarounds
Users who cannot upgrade can disable JSON minification with:
await minify(html, {
minifyJson: false,
});
Advisory Timeline
- First published September 8, 2026 (79 days ago).
- Last revised September 8, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p swc_html_minifier --precise 59.0.0
npm install @swc/html@1.15.47-nightly-20260729.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 2 ecosystems: crates.io (1), npm (1).
| Package | Fixed In |
|---|---|
| swc_html_minifier crates.io · Affected: All versions | 59.0.0 |
| @swc/html npm · Affected: All versions | 1.15.47-nightly-20260729.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
References
- https://github.com/swc-project/swc/security/advisories/GHSA-5qr2-v392-m9g8WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-72925ADVISORY
- https://github.com/swc-project/swc/pull/12080WEB
- https://github.com/swc-project/swc/commit/e1877b44bdac8abc9fd51e984d584f40f6999832WEB
- https://github.com/swc-project/swcPACKAGE
- https://github.com/swc-project/swc/releases/tag/v1.15.47WEB
- https://github.com/swc-project/swc/releases/tag/v1.15.47-nightly-20260729.1WEB
Frequently Asked Questions
- What is CVE-2026-72925?
- SWC HTML minifier may allow script element breakout when minifying embedded JSON. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
- How do I check if my project is affected by CVE-2026-72925?
- CVE-2026-72925 affects swc_html_minifier and @swc/html. It has a 0.3% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-72925 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 19.7% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-115906MEDIUM
zip: AES Entry HMAC Authentication Bypass on Premature EOF
- CVE-2026-35374MEDIUM
split: TOCTOU output-open allows truncating a swapped file