nextjs.vnTiếng Việt

All advisories

Remote code execution via Image Optimization when AVIF files are used

Critical CVSS 9.5 · Published 2026-09-08 · GHSA-2xp9-vwfh-vxw4

Original title: Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used

What happens

libheif, used by sharp, which Next.js uses for image optimization, has a vulnerability that allows remote code execution when AVIF files are optimized. No authentication is needed.

Who is affected

  • Applications that use the Next.js image optimization API and optimize AVIF files.

Affected and fixed versions

AffectedFixed in
>= 10.0.0, < 15.5.2415.5.24
>= 16.0.0, < 16.3.316.3.3

What to do

  • Upgrade Next.js to the fixed version in the table below.
  • Note: in the fixed versions, AVIF optimization is disabled until the upstream fix has propagated.

Check yourself

  • Run npm ls next sharp and compare the Next.js version with the table below.

Sources

Rewritten from the original advisory; versions from the GitHub Advisory Database (CC-BY-4.0), updated 2026-10-29. Where they differ, the original advisory wins.