Next.js Image Optimization Vulnerability: AVIF File Risk
- Severity
- HIGH
- Affected component
- next.js (npm)
- Patched version
- Not yet available
An early warning has been issued regarding a potential vulnerability in the Next.js image optimization feature when AVIF files are used. This vulnerability, which is under investigation, could lead to remote code execution.
What happened
An early warning has been issued for a potential vulnerability in the Next.js image optimization feature. This vulnerability is reportedly linked to the underlying `libheif` library, which Next.js uses for image optimization. The issue appears to arise when AVIF files are optimized, potentially leading to remote code execution. Until a fix has propagated, optimization of AVIF files is disabled as a precautionary measure.
The vulnerability is tracked under GHSA-2xp9-vwfh-vxw4 and has been flagged since September 8, 2026. It is important to note that this is an early warning and the details are still under investigation. No authoritative version range has been published for the affected Next.js versions, and no exploitation in the wild has been reported yet.
What to do about it
- Avoid using AVIF file optimization in Next.js until a fix is available.
- Monitor the primary sources for updates on the vulnerability and any available patches.
- Consult the GitHub advisories for GHSA-2xp9-vwfh-vxw4 and GHSA-p293-qw3h-jr36 for the latest information.
- If you are using Next.js for image optimization, consider alternative formats until the issue is resolved.
How 0Day would have caught this
next.js is anywhere in your dependency tree, the engineers who own the affected repositories get a push alert the moment it is flagged — no manual audit to remember to run.Read how this differs from waiting on a scanner to catch a known advisory, or see the exact, read-only access 0Day needs to do this for an organization.
Frequently asked questions
Am I affected?
If you are using Next.js for image optimization and processing AVIF files, you may be affected. However, no authoritative version range has been published yet, so it is advisable to monitor the situation closely.
What should I do right now?
Avoid using AVIF file optimization in Next.js until a fix is available. Monitor the primary sources for updates and consider using alternative image formats.
Has this been exploited in the wild?
No, there are no reports of this vulnerability being exploited in the wild at this time.
Where can I find more information?
Consult the GitHub advisories for GHSA-2xp9-vwfh-vxw4 and GHSA-p293-qw3h-jr36 for the latest information on this vulnerability.
Sources
- [GHSA-2r5q-h53f-9rp3] @yeger/turbo-graph: Unauthenticated Network-Exposed Task Execution via /api/run
- [GHSA-2xp9-vwfh-vxw4] Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used
- [GHSA-p293-qw3h-jr36] Next.js: Unauthenticated Remote Code Execution on windows-hosted servers
- [GHSA-2xp9-vwfh-vxw4] Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AVIF files are used