Executive brief
Next.js is a popular React framework used to build and serve web applications. The image optimization feature in Next.js improperly handles specially crafted HEIF/AVIF image files, allowing unauthenticated attackers to execute arbitrary code on the application server. An attacker can exploit this by uploading a malicious image file to a Next.js application, potentially compromising the entire application and underlying infrastructure.
Technical details
The vulnerability is an unauthenticated remote code execution flaw in Next.js image optimization and the underlying libheif library. The root cause lies in improper processing of clean aperture boxes in HEIF/AVIF image files, which leads to code execution when malicious image data is processed. The attack vector is network-based and requires no authentication—an attacker simply supplies a crafted image file to the application's image optimization endpoint. An attacker can achieve arbitrary code execution within the application context. Patches are available: Next.js versions 16.3.3 and 15.5.24 or later address this issue. Customers must also monitor for upstream libheif patches and rebuild container base images accordingly.
Affected products
- Vercel Next.js below 15.5.24 and below 16.3.3
- libheif <UNKNOWN>
Timeline
- 2026-08-25: disclosed: Published in GCP-2026-055 security bulletin
- 2026-08-25: patched: Patches available: Next.js 16.3.3, 15.5.24 and later