Skip to content

← Actionable
Medium, CVSS 6.1amended

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

CVE-2026-72925GHSA-5qr2-v392-m9g8

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (swc_html_minifier 59.0.0; @swc/html 1.15.47-nightly-20260729.1), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • crates.io swc_html_minifier

    Affected
    < 59.0.0
    Fixed in
    59.0.0
  • npm @swc/html

    Affected
    < 1.15.47-nightly-20260729.1
    Fixed in
    1.15.47-nightly-20260729.1

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
6.1 · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS
  • CVE-2026-72925: 0.34% estimated exploitation activity in the next 30 days; percentile 27.27 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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 - swchtmlminifier 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: js await minify(html, { minifyJson: false, });

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 3 · amended ·

    Amended from ghsa record GHSA-5qr2-v392-m9g8

  2. Revision 2 · amended ·

    Amended from osv record GHSA-5qr2-v392-m9g8

  3. Revision 1 · created ·

    Published from ghsa record GHSA-5qr2-v392-m9g8

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-72925

Advisory: SWC HTML minifier may allow script element breakout when minifying embedded JSON
IDs: CVE-2026-72925, GHSA-5qr2-v392-m9g8
Record: https://patchnext.com/advisories/cve-2026-72925 (revision 3, source checked 26 Oct 2026, 13:02 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 6.1)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: swc_html_minifier 59.0.0; @swc/html 1.15.47-nightly-20260729.1. A vendor fix does not mean a deployment is fixed.

## Affected components
- crates.io swc_html_minifier: affected < 59.0.0; fixed in 59.0.0
- npm @swc/html: affected < 1.15.47-nightly-20260729.1; fixed in 1.15.47-nightly-20260729.1

## Suggested inspection (read-only)
- crates.io swc_html_minifier: check the installed version with your package manager.
- `npm ls @swc/html --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on swc_html_minifier, @swc/html.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-5qr2-v392-m9g8 (GitHub-reviewed advisory GHSA-5qr2-v392-m9g8 lists affected ranges: npm @swc/html >=0 <1.15.47-nightly-20260729.1)
- Verified: https://osv.dev/vulnerability/GHSA-5qr2-v392-m9g8 (OSV record GHSA-5qr2-v392-m9g8 lists affected ranges: npm @swc/html >=0 =0 <59.0.0 (fixed))
- Verified: https://github.com/advisories/GHSA-5qr2-v392-m9g8 (GitHub-reviewed advisory GHSA-5qr2-v392-m9g8 lists affected ranges: npm @swc/html >=0 =0 <59.0.0)

Commands are suggestions: review each one before running it.

Loading voting…