News Security

Vercel Patches Remote Code Execution Bug Found in libheif

A libheif vulnerability let malicious AVIF images trigger remote code execution through Next.js image optimization on Vercel.

Security researchers found a remote code execution flaw in libheif, a widely used decoder for AVIF images, reachable through Next.js image optimization. Vercel says the flaw was reported by security firm Hacktron in August, and traced to libheif rather than Next.js itself, though the code path ran through Next.js, the sharp image library, and libvips before reaching libheif.

Vercel reports it worked with Hacktron to reproduce the exploit using a working proof of concept, then rolled out a platform-wide mitigation on its Image Optimization Service within two days, blocking AVIF images from ever reaching libheif for decoding. Vercel says it also disclosed the issue to the maintainers of sharp, libvips, and libheif, opening a coordinated fix through email contact and a GitHub security advisory.

According to Vercel, the Next.js team met with the libvips maintainer on August 19 to align on next steps, then folded an AVIF-disabling mitigation into a security release originally planned for a separate issue, shipping it a day early on August 25. The libheif maintainer released a patched version, v1.23.2, the same day, resolving the underlying decoding flaw six days after the coordination meeting.

Source: Reproducing, disclosing, and fixing the libheif vulnerability with Hacktron and the maintainers – Vercel.