{"id":"GHSA-mm7x-qfjj-5g2c","aliases":["GHSA-mm7x-qfjj-5g2c","RUSTSEC-2025-0071"],"related":[],"kind":"vulnerability","state":"published","title":"Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal","summary":"Affected versions of this crate did not correctly strip namespace-incompatible tags\nin certain situations, causing it to incorrectly account for differences between HTML,\nSVG, and MathML.\n\nThis vulnerability only has an effect when the `svg` or `math` tag is allowed,\nbecause it relies on a tag being parsed as html during the cleaning process, but\nserialized in a way that causes in to be parsed as xml by the browser.\n\nAdditionally, the application using this library must allow a tag that is parsed as raw text in HTML.\nThese [elements] are:\n\n* title\n* textarea\n* xmp\n* iframe\n* noembed\n* noframes\n* plaintext\n* noscript\n* style\n* script\n\nApplications that do not explicitly allow any of these tags should not be affected, since none are allowed by default.\n\n[elements]: https://github.com/servo/html5ever/blob/57eb334c0ffccc6f88d563419f0fbeef6ff5741c/html5ever/src/tree_builder/rules.rs","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"Affected versions of this crate did not correctly strip namespace-incompatible tags\nin certain situations, causing it to incorrectly account for differences between HTML,\nSVG, and MathML.\n\nThis vulnerability only has an effect when the `svg` or `math` tag is allowed,\nbecause it relies on a tag being parsed as html during the cleaning process, but\nserialized in a way that causes in to be parsed as xml by the browser.\n\nAdditionally, the application using this library must allow a tag that is parsed as raw text in HTML.\nThese [elements] are:\n\n* title\n* textarea\n* xmp\n* iframe\n* noembed\n* noframes\n* plaintext\n* noscript\n* style\n* script\n\nApplications that do not explicitly allow any of these tags should not be affected, since none are allowed by default.\n\n[elements]: https://github.com/servo/html5ever/blob/57eb334c0ffccc6f88d563419f0fbeef6ff5741c/html5ever/src/tree_builder/rules.rs","format":"markdown","source":"ghsa"}],"published":"2025-09-21T12:00:00.000Z","modified":"2026-09-10T03:50:28.411Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U","rating":"LOW"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U","rating":"LOW"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"4.1.0","status":"affected","fixed":"4.1.2"}],"ecosystem":"crates.io","package":"ammonia","purl":"pkg:cargo/ammonia","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.0.1"}],"ecosystem":"crates.io","package":"ammonia","purl":"pkg:cargo/ammonia","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.3.1"}],"ecosystem":"crates.io","package":"ammonia","purl":"pkg:cargo/ammonia","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"3.3.1"},{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.0.1"},{"type":"semver","introduced":"4.1.0","status":"affected","fixed":"4.1.2"}],"ecosystem":"crates.io","package":"ammonia","purl":"pkg:cargo/ammonia","source":"rustsec"}],"references":[{"url":"https://github.com/rust-ammonia/ammonia/commit/de0297111a3a1273275b670960bcd47a0481718e","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rust-ammonia/ammonia","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0071.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/ammonia","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mm7x-qfjj-5g2c","url":"https://github.com/advisories/GHSA-mm7x-qfjj-5g2c","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:28.411Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2025-0071","url":"https://rustsec.org/advisories/RUSTSEC-2025-0071.html","licence":"CC0-1.0","modified":"2025-10-28T06:29:25.438Z"}],"updatedAt":"2026-11-25T22:56:43.268Z"}