{"id":"CVE-2026-72925","aliases":["GHSA-5qr2-v392-m9g8"],"url":"https://o3.security/vulnerability/CVE-2026-72925","summary":"SWC HTML minifier may allow script element breakout when minifying embedded JSON","details":"## Impact\n\n`@swc/html` minifies JSON contained in `script` elements such as\n`application/json` and `application/ld+json` by parsing and serializing the\nJSON value.\n\nBefore the patched versions, JSON serialization could convert escaped\nless-than signs such as `\\u003C` into literal `<` characters. If the JSON\ncontained an escaped `</script>` sequence, the generated HTML could terminate\nthe containing script element early because HTML tokenization occurs before\nthe JSON is consumed.\n\nApplications that minify HTML containing attacker-controlled JSON data could\ntherefore transform inert data into active markup. A crafted payload could\nexecute script in the origin of the generated page.\n\n## Patches\n\nThe issue is fixed in:\n\n- `@swc/html` 1.15.47\n- `swc_html_minifier` 59.0.0\n\nThe minifier now re-escapes less-than signs after JSON serialization, preserving\nthe script element boundary.\n\n## Workarounds\n\nUsers who cannot upgrade can disable JSON minification with:\n\n```js\nawait minify(html, {\n  minifyJson: false,\n});","published":"2026-08-11T14:45:12.907Z","modified":"2026-10-21T03:01:29.915503585Z","cvss":{"score":6.1,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"},"epss":{"score":0.00194,"percentile":0.09292,"asOf":"2026-09-16"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"crates.io","name":"swc_html_minifier","fixedVersion":"59.0.0"},{"ecosystem":"npm","name":"@swc/html","fixedVersion":"1.15.47-nightly-20260729.1"}],"fix":{"url":"https://github.com/swc-project/swc/commit/e1877b44bdac8abc9fd51e984d584f40f6999832","label":"swc-project/swc@e1877b4"},"references":[{"type":"WEB","url":"https://github.com/swc-project/swc/releases/tag/v1.15.47"},{"type":"WEB","url":"https://github.com/swc-project/swc/releases/tag/v1.15.47-nightly-20260729.1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/72xxx/CVE-2026-72925.json"},{"type":"ADVISORY","url":"https://github.com/swc-project/swc/security/advisories/GHSA-5qr2-v392-m9g8"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-72925"},{"type":"FIX","url":"https://github.com/swc-project/swc/commit/e1877b44bdac8abc9fd51e984d584f40f6999832"},{"type":"FIX","url":"https://github.com/swc-project/swc/pull/12080"},{"type":"PACKAGE","url":"https://github.com/swc-project/swc"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-21T03:01:29.915503585Z"}}