Advisory

RUSTSEC-2026-0213

Also known as: CVE-2026-102342, GHSA-m6mh-2hw2-555x

Summary

XSS in ammonia via SVG animate and set animation tags

Details

The following SVG will produce a link with a javascript scheme.
If the user clicks this link, they will run it.

<svg xmlns="http://www.w3.org/2000/svg">
  <a>
    <set attributeName="href" to="javascript:alert('SET_XSS')"></set>
    <text y="30">Click set</text>
  </a>
</svg>

Ammonia did not apply attribute filters based on attributeName,
so the contents of the to, from, and values tags were not sanitized as URLs.

Applications that do not explicitly allow either of these tags should not be affected,
since neither are allowed by default.

---

Discovered by: Younghun Ko (@koyokr)

Severity

Not rated by the source.

Dates

Published
2026-07-21 12:00 UTC
Modified
2026-09-30 07:15 UTC

Affected packages and fixes

ammonia

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 3.3.3, introduced 4.0.0, fixed 4.0.3, introduced 4.1.0, fixed 4.1.4 (semver)

Fixed versions

3.3.3, 4.0.3, 4.1.4

Fix

  • Fixed version 3.3.3
    cargo update -p ammonia --precise 3.3.3
  • Fixed version 4.0.3
    cargo update -p ammonia --precise 4.0.3
  • Fixed version 4.1.4
    cargo update -p ammonia --precise 4.1.4

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences