{"id":"GHSA-f2pc-rwv3-69mv","aliases":["GHSA-f2pc-rwv3-69mv","RUSTSEC-2021-0158"],"related":[],"kind":"vulnerability","state":"published","title":"XSS in ammonia via SVG `animateMotion`, `animateTransform`, and/or `animateColor` tags","summary":"The neutralization that ammonia applied to `animate` and `set` was not applied to other forms of SVG animation, which can be used for XSS.\n\nThe following SVG will produce a link with a javascript scheme.\nIf the user clicks this link, they will run it.\n\n```xml\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n  <a>\n    <animateMotion attributeName=\"href\" to=\"javascript:alert('SET_XSS')\"></animateMotion>\n    <text y=\"30\">Click set</text>\n  </a>\n</svg>\n```\n\nAmmonia did not apply attribute filters based on `attributeName`,\nso the contents of the `to`, `from`, and `values` tags were not sanitized as URLs.\n\nApplications that do not explicitly allow any of these tags should not be affected,\nsince none are allowed by default.\n\n---\n\nThis vulnerability was reported by [ucsurf](https://uc.surf).","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"The neutralization that ammonia applied to `animate` and `set` was not applied to other forms of SVG animation, which can be used for XSS.\n\nThe following SVG will produce a link with a javascript scheme.\nIf the user clicks this link, they will run it.\n\n```xml\n<svg xmlns=\"http://www.w3.org/2000/svg\">\n  <a>\n    <animateMotion attributeName=\"href\" to=\"javascript:alert('SET_XSS')\"></animateMotion>\n    <text y=\"30\">Click set</text>\n  </a>\n</svg>\n```\n\nAmmonia did not apply attribute filters based on `attributeName`,\nso the contents of the `to`, `from`, and `values` tags were not sanitized as URLs.\n\nApplications that do not explicitly allow any of these tags should not be affected,\nsince none are allowed by default.\n\n---\n\nThis vulnerability was reported by [ucsurf](https://uc.surf).","format":"markdown","source":"rustsec"}],"published":"2021-10-10T12:00:00.000Z","modified":"2026-10-13T07:30:02.289Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"4.1.7"},{"type":"semver","introduced":"4.2.0","status":"affected","fixed":"4.2.3"}],"ecosystem":"crates.io","package":"ammonia","purl":"pkg:cargo/ammonia","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/ammonia","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0158.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/rust-ammonia/ammonia/pull/261","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0158","url":"https://rustsec.org/advisories/RUSTSEC-2021-0158.html","licence":"CC0-1.0","modified":"2026-10-13T07:30:02.289Z"}],"updatedAt":"2026-11-25T22:56:43.088Z"}