Cybersecurity

Next.js Patches Critical AVIF and Windows Flaws Enabling Unauthenticated RCE

By Parviz Nasirov
Next.js Patches Critical AVIF and Windows RCE Vulnerabilities

Vercel has released urgent security updates for two critical Next.js vulnerabilities that can lead to unauthenticated remote code execution. One flaw affects AVIF image optimization through a libheif heap buffer overflow, while the second affects certain Windows-hosted Next.js applications through path traversal. Users running self-hosted deployments should upgrade to Next.js 15.5.24 or 16.3.3 immediately.

Vercel has released security patches for two critical vulnerabilities in Next.js that can potentially allow unauthenticated attackers to achieve remote code execution.

The flaws affect different parts of the framework:

  • AVIF image optimization
  • Windows filesystem request handling

The patched versions are:

  • Next.js 15.5.24
  • Next.js 16.3.3

Both updates were published on August 25, 2026.

Windows Path Traversal Vulnerability

The Windows-specific vulnerability is tracked as CVE-2026-75604 and carries a CVSS score of 9.0.

It affects Next.js applications that:

  • Use both the Pages Router and App Router
  • Do not use Cache Components
  • Run on a Windows filesystem

Linux and macOS deployments are not affected by this specific flaw.

Vercel says there is no known workaround for affected Windows-hosted applications and recommends upgrading immediately.

The vulnerability affects:

  • Next.js 13.4 through 15.5.23
  • Next.js 16.0 through 16.3.2

AVIF Image Optimization Vulnerability

The second issue affects Next.js image optimization when AVIF support is enabled.

Next.js relies on the sharp package for image processing, and sharp in turn uses the libheif C library to parse AVIF images.

Researchers discovered a critical heap buffer overflow in libheif that can potentially lead to remote code execution when an application processes a specially crafted AVIF image.

The issue is associated with:

GHSA-2xp9-vwfh-vxw4

and carries a CVSS v4 score of 9.5.

How the AVIF Bug Works

The underlying issue exists in libheif's image scaling logic.

A specially crafted AVIF file can contain nested identity-derivation and auxiliary item references that cause libheif to process two Alpha plane entries with different bit depths.

The library allocates a destination buffer based on the first 8-bit Alpha entry, but later writes 16-bit sample data into the same buffer.

This results in an out-of-bounds overwrite of approximately 16 KB beyond the allocated memory region.

Memory corruption at this level can potentially be leveraged for code execution.

Researchers stated that they successfully achieved RCE in multiple applications, although that claim had not been independently verified at the time of publication.

AVIF Support Must Be Explicitly Enabled

Not every Next.js deployment is exposed to the AVIF vulnerability.

Next.js only performs AVIF image optimization when the application explicitly enables:

image/avif

inside the formats configuration in next.config.js.

Deployments that do not enable AVIF optimization are not affected by this particular issue.

Patched Versions Disable AVIF Optimization

As a defensive measure, the patched Next.js releases currently disable AVIF optimization entirely until the upstream libheif fix becomes available.

At the time of reporting, libheif version 1.23.2 containing the upstream fix had not yet been released.

This is an example of a framework applying a temporary defense-in-depth mitigation while waiting for an upstream dependency to ship its own patch.

Vercel-Hosted Applications Are Already Protected

Applications hosted directly on Vercel are protected against both vulnerabilities.

Vercel says those customers do not need to take additional action for these issues.

The urgent upgrade requirement primarily applies to self-hosted Next.js applications running affected versions.

Why the Patch Was Released Early

Vercel originally planned to publish its August security fixes on August 26 as part of its monthly security cadence.

However, the release was moved forward by one day after an additional critical vulnerability was identified in an upstream dependency.

This reflects a broader trend in modern web development:

framework security increasingly depends on the security of underlying open-source libraries.

A flaw in a lower-level dependency such as libheif can become a remote-code-execution risk at the framework level.

Next.js Security Research Is Accelerating

Vercel introduced a more formal monthly security program in 2026.

The company has also noted that vulnerability research volume is increasing rapidly, partly because LLM-assisted vulnerability discovery is making it easier for researchers to identify and validate security issues.

In July 2026, Vercel released another scheduled Next.js security update addressing nine vulnerabilities involving:

  • Denial of service
  • SSRF
  • Middleware bypass

Users who installed the July fixes must still install the August update.

No Confirmed Exploitation Yet

As of August 27, 2026, there were no publicly reported cases of active exploitation for either of the two newly patched vulnerabilities.

However, the severity of both issues and the availability of public proof-of-concept material for the AVIF memory corruption make timely patching important.

Analysis and context

These vulnerabilities highlight an important reality of modern web security:

a framework is only as secure as the dependency chain underneath it.

The AVIF issue is particularly interesting because the vulnerable code is not primarily in Next.js itself.

The chain looks like:

Next.js
→ sharp
→ libheif
→ AVIF parsing
→ heap buffer overflow

This means a vulnerability deep inside a native image-processing library can eventually become an unauthenticated RCE issue in a high-level JavaScript framework.

Image Processing Is a High-Risk Attack Surface

Image processing libraries are historically attractive attack targets.

They must parse highly complex binary formats including:

  • JPEG
  • PNG
  • WebP
  • AVIF
  • HEIC

These formats contain nested structures, metadata, compression logic, color profiles, and multiple bit-depth combinations.

Attackers can intentionally construct malformed files that trigger memory-handling bugs.

When image optimization occurs automatically on a server, the attacker may not need an authenticated account.

If an application accepts or proxies attacker-controlled images, the image-processing pipeline itself becomes an attack surface.

Native Dependencies Change the Risk Model

JavaScript developers sometimes assume that a Node.js or Next.js application is mostly protected from classic memory-corruption vulnerabilities.

But packages like sharp rely on native C and C++ libraries.

That means traditional vulnerability classes such as:

  • Heap buffer overflow
  • Use-after-free
  • Out-of-bounds write
  • Integer overflow

can still affect modern JavaScript stacks.

Developers therefore need to monitor not only direct npm dependencies but also the native libraries they pull in transitively.

Windows Deployments Need Special Attention

CVE-2026-75604 also shows why operating-system differences matter.

A path-handling issue may behave differently depending on:

  • Filesystem semantics
  • Path separators
  • Drive-letter handling
  • Case sensitivity
  • Canonicalization behavior

A security test that passes on Linux may not necessarily behave the same way on Windows.

For organizations self-hosting Next.js on Windows, this is an important reminder to include platform-specific testing in security reviews.

Self-Hosted Users Carry More Responsibility

One of the clearest operational lessons is the difference between managed and self-hosted deployments.

Vercel-hosted applications received infrastructure-level protection automatically.

Self-hosted users are responsible for:

  • Monitoring advisories
  • Updating Next.js
  • Rebuilding deployments
  • Testing compatibility
  • Rolling patches into production

This is not unique to Next.js.

It reflects a general cloud-security tradeoff:

managed platforms reduce some operational security burden, while self-hosting provides more control but also more responsibility.

Immediate Recommended Actions

Organizations using Next.js should:

  • Check the current Next.js version.
  • Upgrade to 15.5.24 or 16.3.3.
  • Prioritize Windows-hosted environments.
  • Review whether image/avif is enabled in next.config.js.
  • Rebuild and redeploy production containers or servers after upgrading.
  • Verify that lockfiles and Docker images contain the patched dependency versions.
  • Review public image-upload or image-proxy functionality.
  • Monitor for unusual AVIF processing requests.
  • Keep dependency scanning enabled in CI/CD.

For Windows-hosted affected deployments, upgrading should be treated as urgent because Vercel reports no available workaround.

The Broader Security Lesson

The most important takeaway is that modern application security is increasingly supply-chain security.

A web framework can inherit critical vulnerabilities from:

  • npm packages
  • Native libraries
  • Image decoders
  • Runtime components
  • Operating-system behavior

Security teams therefore need visibility beyond application code alone.

The Next.js vulnerabilities demonstrate why dependency management, rapid patching, CI security scanning, and platform-specific testing are now fundamental parts of web application security.