GitHub Advisoryadvisory · crates.io
GHSA-cpvr-w4j5-2mpg Librsvg: Use-after-free when XML includes have duplicated entities
HIGH
Official page ↗
- Aliases
- CVE-2026-96889
- Ecosystem
- crates.io
- Packages
- librsvg
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-416
- Reviewed
- 2026-10-22
Affected packages
• crates.io librsvg: < 2.57.5 → fixed in 2.57.5
• crates.io librsvg: >= 2.60.0-beta.0, < 2.60.3 → fixed in 2.60.3
• crates.io librsvg: >= 2.61.0, < 2.61.5 → fixed in 2.61.5
• crates.io librsvg: >= 2.62.0-beta.0, < 2.62.4 → fixed in 2.62.4
• crates.io librsvg: >= 2.63.0-beta.0, < 2.63.2 → fixed in 2.63.2
Description
Librsvg uses libxml2, a C library, to parse XML. When librsvg parses
an SVG document which has a nested Xinclude, an XML entity declaration
with a duplicate name as an existing one can cause a use-after-free error.
While libxml2 is expanding an internal entity, a recursive XInclude
can parse another document that declares an entity with the same
name. Both parses use the same `XmlState` entity
map on the librsvg side. `entity_insert()` replaces the first entry, whose `Drop`
implementation calls `xmlFreeNode()`. The outer `xmlCtxtParseEntity()`
then keeps using the freed 144-byte `xmlEntity`.
The included parse should not free an entity that the outer parser is still using.
The fix is in commit 8a1b0cd319e9af2d1e9cf878081dd77f227a0504, where
librsvg will no longer free xmlEntity pointers that libxml2 is still
using.
Related
Alias · CVE (1)
- CVE-2026-96889 A flaw was found in librsvg. vulnerability
Weakness · CWE (1)
- CWE-416 Use After Free weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-96889 advisory
- https://github.com/GNOME/librsvg/commit/0bc935e675947e185d42005d3ad93d7cf61bcea9 web
- https://github.com/GNOME/librsvg/commit/1606574427408baca8203ef723281509a229f9e2 web
- https://github.com/GNOME/librsvg/commit/4d0051a9dbd038a5fe8461b61486677d88f8736d web
- https://github.com/GNOME/librsvg/commit/e56cc8a33a7184eef6e8a720414aee6205a400ad web
- https://rustsec.org/advisories/RUSTSEC-2026-0305.html web
- https://gitlab.gnome.org/GNOME/librsvg/-/work_items/1241 web
- https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/1211 web
- https://gitlab.gnome.org/GNOME/librsvg/-/commit/8a1b0cd319e9af2d1e9cf878081dd77f227a0504 web
- https://gitlab.gnome.org/GNOME/librsvg package
- https://github.com/GNOME/librsvg/releases/tag/2.63.2 web
- https://github.com/GNOME/librsvg/releases/tag/2.62.4 web
- https://github.com/GNOME/librsvg/releases/tag/2.61.5 web
- https://github.com/GNOME/librsvg/releases/tag/2.60.3 web
- https://github.com/GNOME/librsvg/releases/tag/2.57.5 web
- https://github.com/GNOME/librsvg/blob/2.63.2/NEWS web
- https://bugzilla.redhat.com/show_bug.cgi?id=2539279 web
- https://access.redhat.com/security/cve/CVE-2026-96889 web
- https://access.redhat.com/errata/RHSA-2026:86921 web
- https://access.redhat.com/errata/RHSA-2026:86842 web
- https://access.redhat.com/errata/RHSA-2026:86841 web
- https://access.redhat.com/errata/RHSA-2026:86331 web