← All posts
Special report vulnerabilitybundled dependenciesexposure analysis

The libheif RCE, by package: who actually ships a vulnerable copy

Wordfence found a critical heap-overflow RCE in libheif. We mapped our file-level corpus to answer a different question: which published packages bundle a vulnerable copy of the library — and which only look like they do.

05 Oct 2026 7 min read By codelake Research

On the back of Wordfence's disclosure of a critical remote-code-execution bug in libheif, the obvious question for a defender is not "is libheif vulnerable" — it is "do I ship it, and which copy?" A library-level CVE tells you nothing about which of your dependencies quietly carry their own compiled copy inside the package. That is the question our file-level corpus can answer, so we did.

The vulnerability (credit: Wordfence)

Wordfence's research team (Alex Thomas, via their Argus program) discovered a heap buffer overflow in libheif's uncompressed-image decoder, present when the library is built with the uncompressed codec enabled. A crafted HEIF/HEIC image can trigger it, leading to out-of-bounds access and remote code execution — rated CVSS 9.8. It affects libheif 1.18.0 through 1.23.2 and is fixed in 1.23.3. A CVE number is pending at the time of writing. The discovery, the root cause and the severity are entirely Wordfence's work; we take no credit for the vulnerability. Our contribution is strictly the package-level exposure mapping below.

libheif decodes the HEIF/HEIC images that modern phones produce, so it turns up server-side in image-processing and upload pipelines far more often than people expect — which is exactly why knowing which package ships it matters.

Two things had to be right for this to be useful. First, the bundle-vs-link distinction: a package that merely links the operating system's libheif (language bindings such as libheif-sys or libheif-rs) carries the vulnerability on the host, not inside the package — patch the OS library and you're done. The packages that matter here are the ones that bundle their own copy: a compiled libheif.so/.dll, a WebAssembly build, or the full vendored source compiled at install. That copy travels with the package and ignores your system updates.

Second — and this is the trap — the package's own version number routinely does not match the libheif version inside it. The cleanest example in our data is PyPI's pylibheif: versions 1.23.1 and 1.23.2 sound vulnerable, but both actually bundle libheif 1.23.4 — already patched. A naive name-and-version scan would have falsely flagged a safe package. The only reliable method is to open each artifact and read the real bundled version. Everything below is classified on the actual compiled/vendored libheif version, not the package version.

What we found

Across the published-package corpus, these are the bundlers we verified at the file level. Vulnerable = the bundled libheif falls in 1.18.0–1.23.2; patched = ≥ 1.23.3.

PACKAGE (ecosystem) PKG VERSION BUNDLED libheif STATUS @img/sharp-libvips-dev (npm) 1.3.1 / 1.3.2 / 1.3.3 1.23.0 / .1 / .2 VULNERABLE @img/sharp-libvips-dev (npm) 1.3.4 1.23.5 patched @img-loong64/sharp-libvips-dev (npm) 1.3.3 (latest) 1.23.2 VULNERABLE @revizly/sharp-libvips-dev (npm) 1.0.41 1.23.0 VULNERABLE @revizly/sharp-libvips-dev (npm) 1.0.52 1.23.5 patched @xberg-io/xberg-linux-* (npm) up to 1.3.4 1.23.0 VULNERABLE libheif-js (npm) 1.23.2 1.23.2 VULNERABLE libheif-js (npm) 1.23.5 1.23.5 patched pdftools-toolbox (pypi) 1.14.2 1.18.2 VULNERABLE pylibheif (pypi) 1.23.1 / 1.23.2 1.23.4 patched (pkg version misleads)

sharp is the one that matters

sharp is one of the most widely deployed image-processing libraries in the Node ecosystem, and it ships its native stack through the @img/sharp-libvips-* packages. Its libvips build bundles libheif. We verified that @img/sharp-libvips-dev shipped a vulnerable libheif from 1.3.1 (1.23.0) through 1.3.3 (1.23.2), and that the fix landed in 1.3.4 (1.23.5). Anything resolving the native stack at 1.3.1–1.3.3 is exposed; 1.3.4 and later are clear.

The long tail is where it lingers. Architecture and vendor forks of the sharp-libvips build track the fix on their own clocks — @img-loong64/sharp-libvips-dev's latest (1.3.3) still carries 1.23.2, and @revizly/sharp-libvips-dev only reached a patched 1.23.5 by 1.0.52. And some bundlers never moved at all: @xberg-io/xberg-* ships a compiled libheif.so.1 pinned to 1.23.0 across every version we have, including the latest.

What to do about it

  • If you use sharp: make sure the resolved @img/sharp-libvips-* native package is 1.3.4 or later (libheif 1.23.5). Lockfiles pin the native stack independently of the top-level sharp version — check the one that actually resolved.
  • If you depend on a fork or a prebuilt binary (@img-loong64, @revizly, @xberg-io, libheif-js, pdftools-toolbox): verify the bundled libheif version, not the package version, and upgrade to a build carrying ≥ 1.23.3.
  • If you only link the system libheif (bindings like libheif-sys/libheif-rs): update the OS package; the binding itself is not the exposure.
  • Where you can, disable the uncompressed codec — the overflow is in that decoder path — and treat HEIF/HEIC uploads as untrusted input.
Method & scope

All classifications are from static, file-level inspection of published package artifacts; we never install packages. The bundled libheif version was read from each archived artifact (the filled heif_version.h, the vendored build's project version, or the compiled libheif.so), never inferred from the package name or version. Packages that only ship a build recipe (e.g. a vcpkg port.cmake) or that link the system library are excluded — they do not carry a copy. The vulnerability itself was discovered and disclosed by Wordfence; the CVE identifier is pending.

Keep reading
All posts →
Stay current

New editions, in your inbox.

Get notified when codelake Research publishes a new report, threat brief or quarterly advisory roundup. No marketing — just the research.

We use your address only to send research updates. Unsubscribe anytime.