CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-WQ5F-XC86-PV6W

CVE-2026-96889: Remote Code Execution via Use-After-Free in librsvg (VectorFreed)

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 6, 2026·8 min read·30 visits

Executive Summary (TL;DR)

A Use-After-Free vulnerability in librsvg (CVE-2026-96889) allows remote code execution when processing crafted SVG files with nested XML Inclusions (XInclude) and duplicate entity declarations, transitively impacting sharp, Next.js, and Ghost.

VectorFreed identifies a critical Use-After-Free (UAF) memory corruption vulnerability in librsvg (CVE-2026-96889), which manifests when parsing structured SVG documents containing nested XML inclusions (XIncludes) and duplicate entity declarations. The flaw results from an entity ownership conflict where librsvg prematurely deallocates an xmlEntity structure still actively referenced by the underlying libxml2 parser context. When transitively compiled into downstream applications such as the high-performance sharp image processing library, this vulnerability facilitates denial of service and unauthenticated remote code execution on the host operating system.

Vulnerability Overview

The open-source library librsvg is responsible for rendering SVG vector graphics into raster images. It functions as a critical component in server-side image processing pipelines. Many higher-level application runtimes, including Node.js, depend transitively on librsvg through image manipulation libraries such as sharp and its bundled dependency libvips. This widespread dependency structure extends the attack surface of vector image parsing to web backends, serverless functions, and content management platforms.

To parse raw XML and SVG structures, librsvg interfaces directly with libxml2, a C-based XML parsing library. The integration involves managing shared parser states, custom input/output callbacks, and the lifecycle of XML entities. When an application processes an SVG document, the parsing engine must resolve document structures, including XML entities and nested schemas. This complex processing environment necessitates precise synchronization of memory boundaries between the Rust abstractions of librsvg and the raw C pointers of libxml2.

The vulnerability, classified as CWE-416 (Use-After-Free), originates in this synchronization layer. When a document invokes nested XML Inclusions (XIncludes) that contain duplicate entity declarations, the memory ownership model breaks. The high-level library frees a memory segment that the low-level parser still references as an active pointer. This misalignment introduces a dangling pointer, allowing attackers to manipulate the heap layout and execute arbitrary system commands.

Root Cause Analysis

The root cause of the Use-After-Free flaw lies in the handling of XML entity registrations within shared parser contexts. During normal document parsing, libxml2 allocates a 144-byte structure known as xmlEntity to store entity names, types, and replacement values. The parser maintains a lookup table of these structures. When the outer document defines an entity, libxml2 populates this memory structure and maps it to the specified identifier.

When the parser encounters an entity reference like &active;, it begins expanding the replacement text by calling xmlCtxtParseEntity(). If this replacement text includes an external reference using the XML Inclusions (XInclude) specification, librsvg resolves the resource. It initiates a secondary parser context to interpret the target file, which may be dynamically retrieved or embedded as a base64-encoded data URL. To coordinate entity lookup, both the outer parser and the inner parser reference a shared XmlState entity map managed on the Rust side of librsvg.

If the nested document declares an entity with the exact same name as the outer entity (e.g., <!ENTITY active "R">), librsvg processes this duplicate declaration inside its entity insertion function entity_insert(). The insertion logic replaces the pre-existing outer entity map entry with the newly parsed nested entity pointer. This replacement triggers the destructor for the old entry, which calls xmlFreeNode() on the old xmlEntity pointer. Because libxml2's outer parser is still mid-execution within xmlCtxtParseEntity(), it retains a reference to this deallocated memory, resulting in a dangling pointer.

Code Analysis

The vulnerability is located in the interaction between librsvg's entity map insertion and libxml2's reference management. Prior to the patch, the insertion logic did not verify whether the entity being replaced was currently in use by an active parser context. The following pseudocode illustrates the vulnerable implementation within librsvg:

// Vulnerable implementation in librsvg (before patch)
fn entity_insert(state: &mut XmlState, name: &str, entity: *mut xmlEntity) {
    // The map unconditionally replaces the existing entity and takes ownership of the old pointer
    if let Some(old_entity) = state.entities.insert(name.to_string(), entity) {
        // Immediately frees the libxml2 node, even if the parent parser is actively referencing it
        unsafe { xmlFreeNode(old_entity); }
    }
}

The upstream patch resolved this issue in commit 8a1b0cd319e9af2d1e9cf878081dd77f227a0504 by restructuring the insertion logic. Rather than unconditionally overwriting and deallocating the existing node, the library now detects duplicate keys within the active parsing context. If a duplicate entity name is registered, the incoming nested entity is safely discarded, or its deallocation is deferred, preserving the integrity of the active outer entity pointer:

// Patched implementation in librsvg (commit 8a1b0cd319e9af2d1e9cf878081dd77f227a0504)
fn entity_insert(state: &mut XmlState, name: &str, entity: *mut xmlEntity) {
    // Check if the entity name is already present in the active state map
    if state.entities.contains_key(name) {
        // Discard the duplicate incoming entity node to prevent dangling pointers in the active parser
        unsafe { xmlFreeNode(entity); }
        return;
    }
    state.entities.insert(name.to_string(), entity);
}

This defensive approach is complete because it maintains the invariant that no entity structure can be freed while an active parser execution stack holds its pointer. By prioritizing the preservation of the original entity definition over nested redefinitions, the parser context remains stable throughout its entire lifecycle.

Exploitation Methodology

Exploitation requires providing a crafted SVG document to an application that processes vector images using a vulnerable version of librsvg. The attack sequence involves defining an outer entity that contains an xi:include element. This element references a secondary, nested XML document encoded as a base64 data URL. The nested document must declare a duplicate entity using the same identifier as the outer entity.

When the outer parser processes &active;, it opens the nested SVG, triggering the duplicate entity insertion. This action deallocates the xmlEntity memory space. To achieve arbitrary code execution, the attacker must groom the heap. This is accomplished by allocating structured data into the newly freed 144-byte chunk before the outer parser regains execution control and attempts to access the deallocated structure.

On systems utilizing the glibc memory allocator, this is executed by sending carefully sized text strings or metadata fields immediately following the inclusion call. If the attacker successfully reclaims the chunk, they can overwrite the function pointers or internal string references of the xmlEntity structure. When the outer parser subsequently attempts to read or execute functions on the object, control flow is redirected to attacker-controlled memory regions.

Impact Assessment

The primary impact of this vulnerability is remote code execution (RCE) on the host operating system. The vulnerability is rated with a CVSS v3.1 score of 7.8 (High), with a vector of CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H. While the base CVSS rating assumes a local attack vector requiring user interaction, the practical risk is elevated in server-side deployments where applications automatically process user-supplied assets.

In the Node.js ecosystem, the vulnerability is highly exploitable due to downstream dependencies. The popular library sharp bundled the vulnerable librsvg statically in its prebuilt binary packages. Downstream platforms such as Next.js and Ghost exposed this code path to remote, unauthenticated users. In Next.js (CVE-2026-94545), a text-escaping vulnerability in the Satori library (GHSA-wx4j-mvgx-mqwp) allowed attackers to inject raw XML tags into the ImageResponse component, bypassing sanitization and feeding the malicious markup directly to sharp.

Similarly, Ghost (CVE-2026-105642) allowed users to create bookmark cards that fetched external web metadata. By serving a malicious SVG from a controlled web server, attackers could trigger the UAF inside Ghost's server-side image renderer. These examples demonstrate how a library-level memory corruption bug can scale into a remote code execution vector in modern web architectures.

Remediation & Mitigations

The primary remediation path is upgrading all affected components to their patched versions. For applications directly utilizing the sharp npm package, update the dependency to version 0.35.5 or later. This version incorporates @img/sharp-libvips version 1.3.4, which statically links against the secure librsvg release version 2.63.2.

If the host operating system provides the librsvg library dynamically, administrators must apply package updates to ensure the system library is upgraded. The upstream vendor has backported security fixes to older stable release branches. The verified safe versions are: 2.63.2, 2.62.4, 2.61.5, 2.60.3, 2.57.5, and 2.56.6.

If immediate patching is not feasible, administrators can block SVG parsing entirely within sharp by disabling the SVG loader module. This mitigation prevents the vulnerable parsing library from executing while maintaining functionality for raster image processing:

const sharp = require('sharp');
sharp.block({ operation: ["VipsForeignLoadSvg"] });

Additionally, ensure that the Node.js runtime and host binaries are compiled with Position Independent Executable (PIE) and Address Space Layout Randomization (ASLR) enabled. Official prebuilt binaries distributed directly from nodejs.org may lack these hardening flags, whereas standard package manager distributions on enterprise Linux operating systems typically include them, reducing the likelihood of reliable exploitation.

Fix Analysis (2)

Technical Appendix

CVSS Score
7.8/ 10
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected Systems

librsvgsharp (npm package)Next.js (ImageResponse Node.js runtime path)Ghost (Bookmark Cards processing)Satori

Affected Versions Detail

Product
Affected Versions
Fixed Version
librsvg
GNOME
< 2.63.22.63.2
sharp
Lovell Fuller
< 0.35.50.35.5
Next.js
Vercel
>= 16.2.0, <= 16.3.516.3.6
Ghost
TryGhost
>= 6.56.0, < 6.67.06.67.0
AttributeDetail
CWE IDCWE-416
Attack VectorLocal / Network via Transitive Library Calls
CVSS Base Score7.8 (High)
EPSS Score0.00129 (Percentile: 2.15%)
Exploit StatusProof-of-Concept Available
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1203Exploitation for Client Execution
Execution
CWE-416
Use After Free

The product uses a pointer that is associated with a pre-existing resource after the resource has been freed, leading to memory corruption and potential code execution.

Known Exploits & Detection

GitHubVectorFreed repository containing proof-of-concept scripts and dynamic detection details.
GitHub RawPython utility script to generate various formats of the UAF exploit payload.

References & Sources

  • [1]GitHub Advisory: Use-After-Free in sharp bundled dependency
  • [2]RustSec Security Advisory: Memory corruption in librsvg
  • [3]CVE Record: CVE-2026-96889
  • [4]Vercel Next.js Downstream Security Advisory
  • [5]Ghost Downstream Security Advisory
  • [6]Satori HTML/XML Escaping Bypass Advisory

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•16 minutes ago•CVE-2026-62361
5.5

CVE-2026-62361: Authenticated SQL Injection and Table Access Control Bypass in Listmonk Subscriber Export

CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).

Alon Barad
Alon Barad
2 views•11 min read
•about 1 hour ago•CVE-2026-28385
5.0

CVE-2026-28385: Server-Side Request Forgery in Canonical LXD Image Import

CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 2 hours ago•GHSA-9J25-MM2H-2F76
9.9

CVE-2026-48750: Arbitrary File Write on Host via exec-output Symlink in Canonical LXD and Incus

Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.

Alon Barad
Alon Barad
6 views•12 min read
•about 3 hours ago•GHSA-VGHH-5RFX-XHQ8
9.9

CVE-2026-48749: Arbitrary Host File Read and Write via Malicious Image Symlink in Canonical LXD and Incus

CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 4 hours ago•GHSA-FMC8-P6Q7-75CC
9.9

GHSA-fmc8-p6q7-75cc: Argument Injection in Canonical LXD Backup Compression Leads to Host Root Code Execution

GHSA-fmc8-p6q7-75cc (associated with CVE-2026-48755) is a critical argument injection vulnerability in Canonical LXD (github.com/canonical/lxd). The vulnerability occurs during instance and storage volume backup operations when processing the user-supplied compression_algorithm configuration parameter. While LXD validates the primary executable token against an allowlist of supported compression binaries, it fails to sanitize or restrict subsequent tokens parsed via shellquote.Split. These additional arguments are passed directly to exec.Command. An authenticated attacker with privileges to trigger backups can inject command-line flags for utilities like zstd to read staged files from a container filesystem and write them to arbitrary paths on the underlying host filesystem, such as /etc/cron.d/, achieving root-level arbitrary code execution on the host.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 5 hours ago•GHSA-PJFF-C2WC-F6JM
9.9

CVE-2026-48769: Arbitrary File Write and Remote Code Execution via Trusted Image Hash in Canonical LXD and Linux Containers Incus

A critical path traversal vulnerability caused by improper input validation (CWE-20) exists in the direct image download handler of Canonical LXD and Linux Containers Incus. When an authenticated user requests an image import using the URL source type, the daemon reads the image fingerprint from an untrusted HTTP response header (`Incus-Image-Hash` or `LXD-Image-Hash`) without validating that it conforms to a SHA-256 format. This unvalidated string is concatenated directly into a filesystem path via `filepath.Join` prior to file creation and cryptographic verification, allowing directory traversal sequences to write arbitrary files on the host filesystem as root.

Alon Barad
Alon Barad
8 views•10 min read