{"id":"RUSTSEC-2026-0305","summary":"Use-after-free when XML includes have duplicated entities","details":"Librsvg uses libxml2, a C library, to parse XML.  When librsvg parses\nan SVG document which has a nested Xinclude, an XML entity declaration\nwith a duplicate name as an existing one can cause a use-after-free error.\n\nWhile libxml2 is expanding an internal entity, a recursive XInclude\ncan parse another document that declares an entity with the same\nname. Both parses use the same `XmlState` entity\nmap on the librsvg side. `entity_insert()` replaces the first entry, whose `Drop`\nimplementation calls `xmlFreeNode()`. The outer `xmlCtxtParseEntity()`\nthen keeps using the freed 144-byte `xmlEntity`.\n\nThe included parse should not free an entity that the outer parser is still using.\n\nThe fix is in commit 8a1b0cd319e9af2d1e9cf878081dd77f227a0504, where\nlibrsvg will no longer free xmlEntity pointers that libxml2 is still\nusing.","modified":"2026-09-23T08:00:03.782171470Z","published":"2026-09-23T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/librsvg"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0305.html"},{"type":"WEB","url":"https://gitlab.gnome.org/GNOME/librsvg/-/work_items/1241"}],"affected":[{"package":{"name":"librsvg","ecosystem":"crates.io","purl":"pkg:cargo/librsvg"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"2.62.4"},{"introduced":"2.62.90"},{"fixed":"2.63.2"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"os":[],"functions":[],"arch":[]}},"database_specific":{"source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0305.json","categories":["memory-corruption"],"cvss":null,"informational":null}}],"schema_version":"1.9.0"}