{"id":"GHSA-5qr2-v392-m9g8","revision":"0e22e126d07e4b9b8025d1734566f0f1","records":[{"revision":"0e22e126d07e4b9b8025d1734566f0f1","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-5qr2-v392-m9g8","aliases":["CVE-2026-72925"],"title":"SWC HTML minifier may allow script element breakout when minifying embedded JSON","description":"## 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});","state":0,"publishedAt":"2026-09-08T17:58:00+00:00","modifiedAt":"2026-09-08T18:15:03.9957744+00:00","affected":[{"ecosystem":"npm","name":"@swc/html","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"1.15.47-nightly-20260729.1"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"crates.io","name":"swc_html_minifier","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"59.0.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/swc-project/swc/security/advisories/GHSA-5qr2-v392-m9g8","https://nvd.nist.gov/vuln/detail/CVE-2026-72925","https://github.com/swc-project/swc/pull/12080","https://github.com/swc-project/swc/commit/e1877b44bdac8abc9fd51e984d584f40f6999832","https://github.com/swc-project/swc","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"],"sourceUrl":"https://github.com/advisories/GHSA-5qr2-v392-m9g8","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-5qr2-v392-m9g8","identifiers":["GHSA-5qr2-v392-m9g8","CVE-2026-72925"]},"retained":false,"historicalAffected":[]}],"coverage":[]}