Findings

RUSTSEC-2021-0158

XSS in ammonia via SVG , , and/or tags

Published Oct 10, 2021 · updated Oct 13, 2026

The neutralization that ammonia applied to and was not applied to other forms of SVG animation, which can be used for XSS. The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it. Ammonia did not apply attribute filters based on , so the contents of the , , and tags were not sanitized as URLs. Applications that do not explicitly allow any of these tags should not be affected, since none are allowed by default. --- This vulnerability was reported by [ucsurf](https://uc.surf).

Timeline

Detection, updates, and resolution for this record.

  1. Oct 10, 2021 · Catalog

    Detected

    The neutralization that ammonia applied to and was not applied to other forms of SVG animation, which can be used for XSS. The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it. Ammonia did not apply attribute filters based on , so the contents of the , , and tags were not sanitized as URLs. Applications that do not explicitly allow any of t

  2. Oct 13, 2026 · Catalog

    Fix available

    crates.io ammonia 0.0.0-0 → 4.1.7

  3. Oct 13, 2026 · Catalog

    Updated

    The neutralization that ammonia applied to and was not applied to other forms of SVG animation, which can be used for XSS. The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it. Ammonia did not apply attribute filters based on , so the contents of the , , and tags were not sanitized as URLs. Applications that do not explicitly allow any of t

Affected

  • crates.io ammonia0.0.0-0 → 4.1.7

Sources

References