Intel

AIKIDO-2026-890476

ammonia is vulnerable to Cross-Site Scripting (XSS)

CVE-2026-102342Published Jul 23, 2026
July 23, 2026

54

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

The ammonia HTML sanitizer applies attribute filters to SVG elements but did not sanitize values based on the attributeName referenced by SVG animate and set tags. Untrusted markup such as <set attributeName="href" to="javascript:alert('SET_XSS')"> inside an allowed <a> element can inject a javascript: URL that executes when a victim clicks the resulting link. The fix applies URL sanitization to to, from, and values content according to the targeted attribute name.

How do I fix this?

Upgrade the ammonia 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 your sanitizer configuration explicitly allows the SVG animate or set tags, which are disabled by default.

Package

Versions

3.2.0 - 3.3.2

Fixed in 3.3.3

4.0.0 - 4.0.2

Fixed in 4.0.3

4.1.0 - 4.1.3

Fixed in 4.1.4

Background info

ammonia is vulnerable to Cross-Site Scripting (XSS) in versions 3.2.0 - 3.3.2, 4.0.0 - 4.0.2 and 4.1.0 - 4.1.3.

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