# Reproducing, disclosing, and fixing the libheif vulnerability with Hacktron and the maintainers

By Steven Van · 2026-09-18

Hacktron found an RCE reachable through Next.js image optimization, and Vercel mitigated it platform-wide while the libheif maintainers worked on a fix.

[Vercel](<https://creatorstoolbox.com/tools/vercel>) has published an account of how it handled a remote code execution (RCE) bug that [Hacktron reported in Next.js image optimization](<https://vercel.com/blog/reproducing-disclosing-and-fixing-the-libheif-vulnerability-with-hacktron-and-the-maintainers>) in August 2026. The vulnerable code turned out to be in libheif, an AVIF image decoder used by Next.js, ImageMagick, WordPress, sharp and much of the web.

## Where the bug was

Next.js image optimization lets applications resize and optimize images through the next/image component. For AVIF images, the chain is:

- the Image component invokes /\_next/image

- /\_next/image calls sharp

- sharp calls libvips

- libvips uses libheif to decode the image

The vulnerable code was not in Next.js, but it was reachable through it. A malicious AVIF image sent to the image optimization endpoint would invoke libheif through sharp and libvips.

## Mitigation and disclosure

One obvious mitigation was to disable AVIF optimization in Next.js, so malicious AVIF images would stop at the endpoint instead of reaching libheif. Vercel says that alone, without an upstream fix, posed a disclosure problem. After reproducing the issue with Hacktron, it rolled out a platform-wide mitigation on Vercel and contacted the maintainers of sharp, libvips and libheif to disclose the bug and start work on a fix.

## Timeline

- **August 11-12:** Hacktron reported the issue to Vercel. The two reproduced the RCE with a working proof of concept.

- **August 13:** Vercel applied a platform mitigation through its Image Optimization Service.

- **August 19:** The Next.js team met the libvips maintainer and began coordination across sharp, libvips and libheif.

- **August 24:** Next.js informed its security partners.

- **August 25:** Next.js published a security advisory.

![Vercel](<https://www.google.com/s2/favicons?domain=vercel.com&sz=128>)

Vercel

The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.

[View Vercel →](<https://creatorstoolbox.com/tools/vercel>)

Sources

[Original source](<https://vercel.com/blog/reproducing-disclosing-and-fixing-the-libheif-vulnerability-with-hacktron-and-the-maintainers>)

[Read Reproducing, disclosing, and fixing the libheif vulnerability with Hacktron and the maintainers on Creators Toolbox](<https://creatorstoolbox.com/blog/vercel-reproducing-disclosing-and-fixing-the-libheif-vulnerability>)

---
Canonical source: https://creatorstoolbox.com/blog/vercel-reproducing-disclosing-and-fixing-the-libheif-vulnerability
