{"id":"GHSA-mm7x-qfjj-5g2c","aliases":["RUSTSEC-2025-0071"],"status":"published","title":"Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal","description":"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","severity":{"version":"4.0","score":1.7,"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","level":"low","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2025-09-21T12:00:00Z","modified":"2026-09-10T03:50:28Z","fixes":[{"ecosystem":"crates.io","package":"ammonia","fixed_in":["4.1.2","4.0.1","3.3.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.1.0"},{"fixed":"4.1.2"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.0.1"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"SEMVER","events":[{"introduced":"4.1.0"},{"fixed":"4.1.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"4.0.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.3.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"3.3.1"},{"introduced":"4.0.0"},{"fixed":"4.0.1"},{"introduced":"4.1.0"},{"fixed":"4.1.2"}]}]}],"references":[{"url":"https://github.com/rust-ammonia/ammonia/commit/de0297111a3a1273275b670960bcd47a0481718e","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0071.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-mm7x-qfjj-5g2c"},{"url":"https://github.com/rust-ammonia/ammonia","tags":["package"]},{"url":"https://crates.io/crates/ammonia","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-mm7x-qfjj-5g2c","title":"Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal","description":"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","status":"published","published":"2025-09-22T15:40:15Z","modified":"2025-09-22T15:40:16Z","cvss":[{"version":"4.0","score":1.7,"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","level":"low"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:38:58.107905Z"}],"osv":[{"id":"GHSA-mm7x-qfjj-5g2c","title":"Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal","description":"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","status":"published","published":"2025-09-22T15:40:15Z","modified":"2026-09-10T03:50:28.411338408Z","cvss":[{"version":"4.0","score":1.7,"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","level":"low"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:52.170928Z"},{"id":"RUSTSEC-2025-0071","title":"Incorrect handling of embedded SVG and MathML leads to mutation XSS after removal","description":"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","status":"published","published":"2025-09-21T12:00:00Z","modified":"2025-10-28T06:29:25.438486Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
