REDHAT-BUG-2539279: Use After Free

Published Sep 23, 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

1 affected component
Gnome librsvg

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade librsvg to a version that resolves this vulnerability.

    Patch 8a1b0cd319e9af2d1e9cf878081dd77f227a0504

Event History

Sep 23, 2026
Data Sourced
via Red Hat·09:29 AM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What input conditions are required to trigger the flaw?

The SVG must use a nested XInclude and an XML entity declaration whose name duplicates an existing entity. Exploitation occurs when libxml2 is expanding an internal entity while the recursive XInclude parses another document declaring that same entity name.

2

What component is affected during parsing?

The issue is in librsvg's shared XmlState entity map when it parses SVG XML through libxml2. Replacing the existing entity-map entry frees an xmlEntity that the outer libxml2 parse continues to use, causing a use-after-free.

3

What is the relevant remediation?

Use a librsvg build containing commit 8a1b0cd319e9af2d1e9cf878081dd77f227a0504. That change prevents librsvg from freeing xmlEntity pointers that libxml2 is still using.

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