Intel

AIKIDO-2026-74136

swc_html_minifier is vulnerable to Cross-Site Scripting (XSS)

CVE-2026-72925Published Aug 5, 2026
August 5, 2026

61

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

The HTML minifier in swc_html_minifier compresses JSON embedded in script elements such as application/json and application/ld+json by parsing and re-serializing the JSON value. During serialization it can turn escaped less-than sequences like \u003C back into literal < characters, so a script-closing sequence inside the JSON can terminate the containing script element early because HTML tokenization runs before the JSON is consumed. When the minified HTML embeds user-controlled JSON data, inert data can become active markup and execute script in the origin of the generated page. The fix re-escapes less-than signs after JSON serialization so the script element boundary is preserved.

How do I fix this?

Upgrade the swc_html_minifier library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you minify HTML that embeds user-controlled JSON inside a script element such as application/json or application/ld+json.

Versions

0.4.1 - 58.0.0

Fixed in 59.0.0

Background info

swc_html_minifier is vulnerable to Cross-Site Scripting (XSS) in versions 0.4.1 - 58.0.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea