CVE-2026-114112 in Sharp
Summary
by MITRE • 10/22/2026
Sharp before 0.35.4 bundles a vulnerable libheif dependency that allows attackers to achieve possible remote code execution on glibc-based Linux by supplying crafted images. Attackers can submit malicious AVIF/HEIF input to applications processing untrusted images with sharp, triggering libheif decoding flaws to execute code.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 10/22/2026
The vulnerability identified in Sharp versions prior to 0.35.4 stems from the inclusion of a compromised version of the libheif library, which serves as the underlying engine for handling HEIF and AVIF image formats within the Node.js package ecosystem. This dependency flaw creates a critical attack vector where malicious actors can exploit memory corruption issues during the decoding process of specially crafted images. The core technical failure lies in how libheif processes specific structural elements or metadata fields within these image files, leading to conditions such as buffer overflows or use-after-free errors when executed on systems utilizing the GNU C Library glibc. These memory management vulnerabilities are particularly dangerous because they allow for arbitrary code execution by manipulating heap structures or instruction pointers through carefully constructed input data that triggers undefined behavior in the underlying C/C++ codebase of the decoder.
From an operational perspective, this vulnerability poses a severe risk to any application that accepts untrusted image uploads and utilizes Sharp for processing, resizing, or converting these files into other formats like JPEG or PNG. An attacker does not need authentication if the service exposes endpoints for file upload or direct image manipulation via API calls. By submitting malicious AVIF or HEIF images containing crafted payloads, an adversary can trigger the decoding flaws within libheif, potentially achieving remote code execution on the host system. This capability effectively bypasses standard application-level security controls since the exploit occurs at the native library level before any higher-level sanitization might take effect. The impact extends beyond simple data exposure to full compromise of the server infrastructure, allowing for further lateral movement, persistence mechanisms, or denial of service through crashes and instability in the hosting environment.
This incident aligns with Common Weakness Enumeration categories such as CWE-120 Buffer Copy without Checking Size of Input Classic Buffer Overflow and CWE-416 Use After Free, which are typical root causes for memory corruption vulnerabilities in C-based libraries. In terms of adversary tactics, this vulnerability facilitates techniques associated with the MITRE ATT&CK framework, specifically Initial Execution via user interaction or automated ingestion, followed by Defense Evasion through native API abuse to bypass application-level security monitoring. The exploitation chain typically involves crafting a malicious image file that exploits specific parsing logic errors in libheif, leading to memory corruption and ultimately code execution under the privileges of the process running Sharp.
To mitigate this risk, organizations must immediately upgrade the Sharp package to version 0.35.4 or later, which includes patched versions of libheif addressing these decoding flaws. It is imperative for development teams to audit their dependency trees using tools like npm audit or yarn audit to ensure no vulnerable transitive dependencies remain in production environments. Additionally, implementing strict input validation and file type verification at the application layer can provide defense-in-depth, although it should not be relied upon as the sole mitigation since native library vulnerabilities often bypass such checks. Security teams should also monitor for unusual process behavior or memory usage spikes that might indicate exploitation attempts against older versions of Sharp still in use within legacy systems until they can be patched and updated to secure releases.