# GHSA-M6MH-2HW2-555X: Ammonia: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2026-09-29
- Modified: 2026-09-29

## Tracked as

- [CVE-2026-102342](https://cve.now/CVE-2026-102342.md): ammonia allows stored XSS through unsanitized SVG animate and set attributes

## Also published as

- [RUSTSEC-2026-0213](https://cve.now/RUSTSEC-2026-0213.md) (RustSec)

## Affected versions

- ammonia (crates.io): fixed in 3.3.3
- ammonia (crates.io): from 4.0.0, fixed in 4.0.3
- ammonia (crates.io): from 4.1.2, fixed in 4.1.4

## Description

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

```svg
<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>
```

### Impact

Allows stored XSS in applications that allow the `animate` and `set` tags.

### Patches

Fixed in 3.3.3, 4.0.3, and 4.1.4

### Workarounds

Do not enable the `animate` or `set` tags.

## References

- https://github.com/rust-ammonia/ammonia/security/advisories/GHSA-m6mh-2hw2-555x
- https://github.com/rust-ammonia/ammonia/pull/250
- https://github.com/rust-ammonia/ammonia/pull/251
- https://github.com/rust-ammonia/ammonia/pull/252
- https://github.com/rust-ammonia/ammonia/commit/9394bd81179e756cb911314deabd943f1a9c8989
- https://github.com/rust-ammonia/ammonia/commit/9e3335e2dd8ab07346ff7997f20662a3da4023f6
- https://github.com/rust-ammonia/ammonia/commit/d2ae1547f478bd84d158bc5e57f5d31437dc4d8d
- https://github.com/rust-ammonia/ammonia
- https://rustsec.org/advisories/RUSTSEC-2026-0213.html

Page: https://cve.now/GHSA-M6MH-2HW2-555X

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
