---
id: "CVE-2026-96889"
kind: "vulnerability"
aliases: ["CVE-2026-96889", "GHSA-cpvr-w4j5-2mpg"]
title: "Librsvg: Use-after-free when XML includes have duplicated entities"
severity: "high"
cvss: 7.800000190734863
epss: 0.0020000000949949026
exploited: false
status: "open"
category: "package"
products: [{"name": "librsvg", "fixed": ["2.57.5"], "affected": "< 2.57.5", "ecosystem": "cargo"}, {"name": "librsvg", "fixed": ["2.60.3"], "affected": ">= 2.60.0-beta.0, < 2.60.3", "ecosystem": "cargo"}, {"name": "librsvg", "fixed": ["2.61.5"], "affected": ">= 2.61.0, < 2.61.5", "ecosystem": "cargo"}, {"name": "librsvg", "fixed": ["2.62.4"], "affected": ">= 2.62.0-beta.0, < 2.62.4", "ecosystem": "cargo"}, {"name": "librsvg", "fixed": ["2.63.2"], "affected": ">= 2.63.0-beta.0, < 2.63.2", "ecosystem": "cargo"}]
ecosystems: ["cargo"]
tags: ["cwe-416", "librsvg", "package", "rust", "self-hosted", "svg-rendering"]
not_affected_if: ["librsvg-below-affected-range", "svg-not-parsed-from-untrusted-input"]
published_at: "2026-09-23T20:17:27+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T23:44:52+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-cpvr-w4j5-2mpg", "first_seen_at": "2026-10-23T19:11:32+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-96889", "first_seen_at": "2026-10-23T23:44:52+00:00"}]
---

# Librsvg: Use-after-free when XML includes have duplicated entities

librsvg, the SVG rendering library, can use freed memory when an SVG file contains a nested XInclude that declares an entity with a duplicate name. An attacker who supplies a crafted SVG to an app that renders it could crash the process or potentially run code.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- cargo:librsvg affected < 2.57.5 fixed 2.57.5
- cargo:librsvg affected >= 2.60.0-beta.0, < 2.60.3 fixed 2.60.3
- cargo:librsvg affected >= 2.61.0, < 2.61.5 fixed 2.61.5
- cargo:librsvg affected >= 2.62.0-beta.0, < 2.62.4 fixed 2.62.4
- cargo:librsvg affected >= 2.63.0-beta.0, < 2.63.2 fixed 2.63.2

## How to check

Run `cargo tree -i librsvg` or check Cargo.lock for librsvg and compare its version to the affected ranges.

## Fix

Upgrade librsvg to 2.57.5, 2.60.3, 2.61.5, 2.62.4, 2.63.2 or later, matching your release line.

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-cpvr-w4j5-2mpg
- 2026-10-23T23:44:52+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-96889

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
