Email me

Rust advisories / librsvg

Vulnerability HighRUSTSEC-2026-0305 · librsvg

RUSTSEC-2026-0305: Use-after-free when XML includes have duplicated entities

Short answerA security vulnerability in the librsvg crate: Use-after-free when XML includes have duplicated entities. GitHub rates it High. Fixed in 2.57.5, 2.60.3, 2.61.5, 2.62.4, 2.63.2: update to a fixed version.

Cratelibrsvg
TypeVulnerability (memory-corruption)
Affected versionsBefore 2.57.5; from 2.57.90 before 2.60.3; from 2.61.0 before 2.61.5; from 2.61.90 before 2.62.4; from 2.62.90 before 2.63.2.
Fixed in2.57.5, 2.60.3, 2.61.5, 2.62.4, 2.63.2
SeverityHigh (GitHub rating)
Published2026-09-23
Last changed2026-10-23
Also known asCVE-2026-96889, GHSA-cpvr-w4j5-2mpg

What to do

  1. See which version you have: cargo tree -i librsvg (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p librsvg. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example librsvg = "2.63.2") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Other advisories for librsvg

Full security history of librsvg

Up next

Same cratelibrsvg: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ