5.4medium
ammonia allows stored XSS through unsanitized SVG animate and set attributes
- Severity
- 5.4medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.27% (higher than 20% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-m6mh-2hw2-555xRUSTSEC-2026-0213
Description
ammonia is a Rust library for repairing and securing untrusted HTML. Prior to 3.3.3, 4.0.3, and 4.1.4, applications that allow the SVG animate or set elements can retain an animation whose attributeName targets href and whose value uses the javascript scheme. The sanitized SVG can therefore create a script-bearing link, and a user who clicks the link can execute attacker-controlled script in the application's origin, enabling stored cross-site scripting. This issue is fixed in versions 3.3.3, 4.0.3, and 4.1.4.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rust-ammonia ammonia | < 3.3.3, >= 4.0.0, < 4.0.3, >= 4.1.2, < 4.1.4 | CVE List |
| ammonia (crates.io) | before 3.3.3, from 4.0.0 before 4.0.3, from 4.1.2 before 4.1.4, from 0.0.0-0 before 3.3.3, from 4.1.0 before 4.1.4 | GitHub Advisory Database, RustSec Advisory Database |
All scores
| GitHub_M | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
ammonia is a Rust library for repairing and securing untrusted HTML. Prior to 3.3.3, 4.0.3, and 4.1.4, applications that allow the SVG animate or set elements can retain an animation whose attributeName targets href and whose value uses the javascript scheme. The sanitized SVG can therefore create a script-bearing link, and a user who clicks the link can execute attacker-controlled script in the application's origin, enabling stored cross-site scripting. This issue is fixed in versions 3.3.3, 4.0.3, and 4.1.4.
GitHub Advisory Database
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>
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.
RustSec Advisory Database
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)
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-102342 changed 2026-10-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-m6mh-2hw2-555x changed 2026-09-29 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2026-0213 changed 2026-09-30 | CC0-1.0 |
| NVD | CVE-2026-102342 changed 2026-10-16 | Public domain |