SWC HTML minifier may allow script element breakout when minifying embedded JSON
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| swc-project | swc | before 1.15.47 | 1.15.47 | Patch available | CNA |
| @swc | html | before 1.15.47-nightly-20260729.1 | 1.15.47-nightly-20260729.1 | Patch available | CNA |
| swc-project | swc_html_minifier | before 59.0.0 | 59.0.0 | Patch available | CNA |
| — | @swc/html (npm) | before 1.15.47-nightly-20260729.1 | 1.15.47-nightly-20260729.1 | Patch available | GHSA-5qr2-v392-m9g8 |
| — | swc_html_minifier (crates.io) | before 59.0.0 | 59.0.0 | Patch available | GHSA-5qr2-v392-m9g8 |
- swc Vendorswc-project Affected before 1.15.47 Fixed in 1.15.47 Patch available CNA
- html Vendor@swc Affected before 1.15.47-nightly-20260729.1 Fixed in 1.15.47-nightly-20260729.1 Patch available CNA
- swc_html_minifier Vendorswc-project Affected before 59.0.0 Fixed in 59.0.0 Patch available CNA
- @swc/html (npm) Vendor— Affected before 1.15.47-nightly-20260729.1 Fixed in 1.15.47-nightly-20260729.1 Patch available GHSA-5qr2-v392-m9g8
- swc_html_minifier (crates.io) Vendor— Affected before 59.0.0 Fixed in 59.0.0 Patch available GHSA-5qr2-v392-m9g8
Remediation
- Fix · CNA swc (swc-project) Fixed in 1.15.47
- Fix · CNA html (@swc) Fixed in 1.15.47-nightly-20260729.1
- Fix · CNA swc_html_minifier (swc-project) Fixed in 59.0.0
- Fix · GHSA-5qr2-v392-m9g8 @swc/html (npm) Fixed in 1.15.47-nightly-20260729.1 Advisory →
- Fix · GHSA-5qr2-v392-m9g8 swc_html_minifier (crates.io) Fixed in 59.0.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-72925
- 2026-10-03 Alias added: GHSA-5qr2-v392-m9g8
References
Other 6
- https://github.com/swc-project/swc/security/advisories/GHSA-5qr2-v392-m9g8
- https://github.com/swc-project/swc/pull/12080
- https://github.com/swc-project/swc/commit/e1877b44bdac8abc9fd51e984d584f40f6999832
- https://github.com/swc-project/swc/releases/tag/v1.15.47
- https://github.com/swc-project/swc/releases/tag/v1.15.47-nightly-20260729.1
- https://github.com/swc-project/swc
Sources
- CVE-2026-72925 · CVE Program
- CVE-2026-72925 · NVD
- FIRST EPSS
- GHSA-5qr2-v392-m9g8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences