Skip to main content
Vulnerability Database/CVE-2026-114112

CVE-2026-114112: Sharp Image Library RCE Vulnerability

CVE-2026-114112 is a remote code execution vulnerability in Sharp image processing library caused by a vulnerable libheif dependency. Attackers can exploit this by submitting crafted AVIF/HEIF images to execute arbitrary code on glibc-based Linux systems. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-114112 Overview

CVE-2026-114112 affects the sharp Node.js image processing library in versions prior to 0.35.4. The library bundles a vulnerable libheif dependency that mishandles crafted AVIF and HEIF images during decoding. Attackers can supply malicious image input to applications that process untrusted content with sharp, triggering memory corruption in libheif on glibc-based Linux systems. Successful exploitation can lead to remote code execution within the context of the processing application. The weakness is tracked as a heap-based buffer overflow ([CWE-122]).

Critical Impact

Applications accepting untrusted AVIF or HEIF uploads and routing them through sharp versions before 0.35.4 on glibc Linux can be coerced into executing attacker-supplied code.

Affected Products

  • sharp Node.js library versions prior to 0.35.4
  • Bundled libheif dependency shipped with vulnerable sharp releases
  • glibc-based Linux environments running sharp for AVIF/HEIF decoding

Discovery Timeline

  • 2026-10-21 - CVE-2026-114112 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-114112

Vulnerability Analysis

The sharp library bundles its own copy of libheif to decode HEIF and AVIF images. The bundled libheif version contains a memory safety flaw triggered when parsing malformed image structures. Processing a crafted file corrupts heap memory inside the native decoding path.

Because sharp is widely used as a server-side image pipeline, the vulnerable code executes inside the Node.js process handling user uploads. On glibc-based Linux hosts, heap layout and allocator behavior make the corruption exploitable for code execution rather than only a crash. The flaw is classified as a heap-based buffer overflow under [CWE-122].

Root Cause

The root cause resides in the bundled libheif decoding logic rather than in sharp itself. libheif fails to properly validate size or boundary fields in AVIF/HEIF container structures before writing decoded data into heap buffers. The out-of-bounds write corrupts adjacent allocator metadata or object pointers, which an attacker can shape to redirect execution. sharp releases prior to 0.35.4 ship this vulnerable libheif build, exposing every consumer of the library.

Attack Vector

Exploitation requires an attacker to deliver a crafted AVIF or HEIF file to an application that invokes sharp for decoding, resizing, or format conversion. Typical delivery paths include user avatar uploads, document ingestion pipelines, thumbnailing services, and media transformation APIs. No authentication is required when the target application accepts anonymous uploads. The attacker does not need to execute code on the host beforehand; providing the malicious image is sufficient to trigger decoding and the heap overflow in libheif.

Technical details are documented in the GitHub Security Advisory GHSA-rgj7-g3m4-5g8c and the VulnCheck Advisory for RCE.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-114112

Indicators of Compromise

  • Node.js worker processes crashing or restarting shortly after processing AVIF or HEIF uploads
  • Unexpected child processes or outbound network connections spawned from image processing services
  • Core dumps or SIGSEGV entries in system logs referencing libheif symbols
  • Inbound uploads with .heic, .heif, or .avif extensions from untrusted sources immediately preceding anomalous process behavior

Detection Strategies

  • Inventory Node.js applications and container images for sharp versions below 0.35.4 using npm ls sharp or software composition analysis tooling
  • Alert on native code crashes within Node.js processes that import sharp, correlating stack traces to libheif frames
  • Monitor image processing endpoints for anomalous request patterns such as oversized or malformed AVIF/HEIF payloads

Monitoring Recommendations

  • Enable runtime telemetry on image processing workloads to capture process lineage, memory faults, and new network sockets
  • Forward application and container logs to a centralized data lake and correlate crashes with upload events by request ID
  • Track outbound egress from image processing microservices and alert on connections to non-approved destinations

How to Mitigate CVE-2026-114112

Immediate Actions Required

  • Upgrade sharp to version 0.35.4 or later in all affected applications and rebuild container images
  • Rotate any secrets or credentials accessible to image processing services if compromise is suspected
  • Restrict acceptable upload MIME types and extensions to formats the application actually requires
  • Isolate image decoding workloads in sandboxed containers with least-privilege service accounts

Patch Information

The maintainers released sharp0.35.4, which replaces the vulnerable bundled libheif with a fixed version. Update dependency manifests with npm install sharp@^0.35.4 or the equivalent for yarn and pnpm, then redeploy. Review the GitHub Security Advisory GHSA-rgj7-g3m4-5g8c for release details.

Workarounds

  • Disable AVIF and HEIF decoding paths in application code when those formats are not required by business logic
  • Reject uploads with HEIF, HEIC, and AVIF content types at the ingress or web application firewall layer until patching completes
  • Run image processing in ephemeral, network-restricted sandboxes to limit the blast radius of a successful exploit
  • Validate image file structure with a hardened pre-filter before passing content to sharp
bash
# Configuration example
npm install sharp@^0.35.4
npm ls sharp

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.