Skip to main content

CVE-2026-72925 — Vulnerability in swc_html_minifier — CVE Details

MEDIUM

SWC HTML minifier may allow script element breakout when minifying embedded JSON

Published September 8, 2026Updated September 8, 2026Source: OSV

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.

Check my Cargo.lock

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/html 1.15.47
  • swc_html_minifier 59.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 swc_html_minifier to 59.0.0 or later
cargo update -p swc_html_minifier --precise 59.0.0
npm
Update @swc/html to 1.15.47-nightly-20260729.1 or later
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).

PackageFixed In
swc_html_minifier crates.io · Affected: All versions59.0.0
@swc/html npm · Affected: All versions1.15.47-nightly-20260729.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-116
    Improper Encoding or EscapingMITRE
  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

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

CVSS Score
6.1

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.34%
EPSS percentile: 19.7

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

GHSA-5qr2-v392-m9g8

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock