Advisory

RUSTSEC-2026-0305

Also known as: CVE-2026-96889, GHSA-cpvr-w4j5-2mpg

Summary

Use-after-free when XML includes have duplicated entities

Details

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.

Severity

Not rated by the source.

Dates

Published
2026-09-23 12:00 UTC
Modified
2026-10-23 06:45 UTC

Affected packages and fixes

librsvg

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 2.57.5, introduced 2.57.90, fixed 2.60.3, introduced 2.61.0, fixed 2.61.5, introduced 2.61.90, fixed 2.62.4, introduced 2.62.90, fixed 2.63.2 (semver)

Fixed versions

2.57.5, 2.60.3, 2.61.5, 2.62.4, 2.63.2

Fix

  • Fixed version 2.57.5
    cargo update -p librsvg --precise 2.57.5
  • Fixed version 2.60.3
    cargo update -p librsvg --precise 2.60.3
  • Fixed version 2.61.5
    cargo update -p librsvg --precise 2.61.5
  • Fixed version 2.62.4
    cargo update -p librsvg --precise 2.62.4
  • Fixed version 2.63.2
    cargo update -p librsvg --precise 2.63.2

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences