Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. swc_html_minifier
  4. ›
  5. CVE-2026-72925

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

September 8, 2026

@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.

References

  • github.com/advisories/GHSA-5qr2-v392-m9g8
  • github.com/swc-project/swc/commit/e1877b44bdac8abc9fd51e984d584f40f6999832
  • github.com/swc-project/swc/pull/12080
  • github.com/swc-project/swc/releases/tag/v1.15.47
  • github.com/swc-project/swc/releases/tag/v1.15.47-nightly-20260729.1
  • github.com/swc-project/swc/security/advisories/GHSA-5qr2-v392-m9g8
  • nvd.nist.gov/vuln/detail/CVE-2026-72925

Code Behaviors & Features

Detect and mitigate CVE-2026-72925 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 59.0.0

Fixed versions

  • 59.0.0

Solution

Upgrade to version 59.0.0 or above.

Impact 6.1 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-116: Improper Encoding or Escaping of Output
  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

cargo/swc_html_minifier/CVE-2026-72925.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:04 +0000.