GHSA-cpvr-w4j5-2mpg: Use After Free

Published Oct 22, 2026
·
Updated

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. entityinsert() 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.

Affected Software

5 affected componentsFixes available
rust/librsvg>=2.63.0-beta.0<2.63.2
2.63.2
rust/librsvg>=2.62.0-beta.0<2.62.4
2.62.4
rust/librsvg>=2.61.0<2.61.5
2.61.5
rust/librsvg>=2.60.0-beta.0<2.60.3
2.60.3
rust/librsvg<2.57.5
2.57.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rust/librsvg to a version that resolves this vulnerability.

    Fixed in 2.63.2
  2. Upgrade

    Upgrade rust/librsvg to a version that resolves this vulnerability.

    Fixed in 2.62.4
  3. Upgrade

    Upgrade rust/librsvg to a version that resolves this vulnerability.

    Fixed in 2.61.5
  4. Upgrade

    Upgrade rust/librsvg to a version that resolves this vulnerability.

    Fixed in 2.60.3
  5. Upgrade

    Upgrade rust/librsvg to a version that resolves this vulnerability.

    Fixed in 2.57.5
  6. Upgrade

    Upgrade librsvg to a version that resolves this vulnerability.

    Patch 8a1b0cd319e9af2d1e9cf878081dd77f227a0504

Event History

Oct 22, 2026
Advisory Published
via GitHub·03:52 PM
Data Sourced
via GitHub·03:52 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What access and interaction are required for exploitation?

The severity vector identifies local attack access and required user interaction. An attacker would need to get a crafted SVG processed by librsvg after a user-mediated action.

2

What SVG features are needed to trigger the memory-safety flaw?

The SVG must cause nested XInclude processing while an internal XML entity is expanded, and the included document must declare an entity with a name that duplicates an existing entity. This causes the shared entity map to replace and free an entity still in use by the outer parse.

3

How can I determine whether a fix is present when no fixed release version is provided?

The described fix changes librsvg so it does not free xmlEntity pointers that libxml2 is still using. The description identifies commit 8a1b0cd319e9af2d1e9cf878081dd77f227a0504 as containing that fix.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203