GitHub's reviewed advisory for Next.js documents a critical unauthenticated remote-code-execution risk in the Image Optimization API when AVIF files are optimized. Affected ranges are Next.js 10.0.0 through versions before 15.5.24, and 16.0.0 through versions before 16.3.3. The advisory lists 15.5.24 and 16.3.3 as patched Next.js versions. Vercel says the root cause was upstream in libheif, an AVIF decoder used across the web ecosystem, and that Vercel deployed a platform-wide mitigation while working with maintainers. Patch the framework and relevant image-processing dependencies, then verify the actual deployed build; do not rely on a package.json edit or a hosting-provider mitigation that does not apply to your environment.
Your production app uses Next.js Image Optimization and accepts or optimizes AVIF images
Your dependency scanner flags GHSA-2xp9-vwfh-vxw4 or a related libheif/sharp advisory
You run an affected Next.js version and are unsure whether the host mitigates the issue
You upgraded dependencies but have not verified the production runtime or image pipeline
Possible causes
Next.js uses image-processing dependencies that can invoke libheif when AVIF content is decoded
The 2026 vulnerability was traced upstream to libheif rather than to ordinary page-rendering logic in Next.js
Applications can remain exposed when an affected framework or image-processing dependency is still present in the deployed artifact
Platform-level mitigations and package-level patches are different controls and should not be assumed to cover every hosting model
HOW TO FIX IT
Work from the safest step to the harder repair.
Step 1. Inventory the exact Next.js version running in each production environment. GitHub's reviewed advisory lists affected versions as >=10.0.0 and <15.5.24, plus >=16.0.0 and <16.3.3; it lists 15.5.24 and 16.3.3 as patched framework releases.
Step 2. Upgrade through the framework's supported package-management and deployment path. Regenerate the lockfile only as needed, preserve a rollback point, and do not suppress the advisory merely to make a security scan green.
Step 3. Inspect image-processing dependencies as well. Vercel traced the AVIF issue to upstream libheif used by tools including sharp. A Next.js patch addresses the framework advisory, but separately reported libheif or sharp advisories should be evaluated against the versions actually installed rather than assumed fixed by one framework bump.
Step 4. Run the full TypeScript typecheck, automated tests and production build. Then exercise pages that render local images, remote images, AVIFs, responsive srcsets, image placeholders and any user-supplied image flow.
Step 5. Verify the deployed artifact, not just source control. Confirm the live runtime is serving the intended patched Next.js version and that old containers, serverless bundles or cached build artifacts are not still active.
Step 6. If the application accepts user-controlled or remote images, review the allowed origins and ingestion path. Keep remotePatterns or equivalent restrictions as narrow as the product allows and do not broaden them as a workaround for a broken image.
Step 7. Check the hosting provider's current security notice. Vercel states it deployed a platform-wide mitigation, but self-hosted and other hosting environments should not assume that mitigation exists unless their provider says so.
Step 8. After deployment, monitor image-optimization errors, 5xx rates, memory/CPU anomalies and security-scanner results. Treat a clean public page as useful regression evidence, not proof that the underlying dependency graph is secure.
Need the actual code? Go to GenesisCodeDoctor.com to search the Code Store or request code for the exact platform, error, and repair you are working on.
Patch in a reversible branch or checkpoint and keep the lockfile under review so transitive dependency changes are visible.
Use test assets you control when validating image optimization; do not collect unknown exploit samples from untrusted forums.
Keep secrets, private image URLs, signed asset tokens and internal infrastructure details out of public debugging output.
STOP AND GET HELP WHEN
Do not turn a repair into a larger outage.
Do not publish or execute proof-of-concept exploit payloads against a production or third-party site.
Do not disable security scanners, image validation or origin restrictions simply to clear an alert or restore one broken asset.
Do not say every AVIF file is malicious; the advisory concerns a vulnerable decoder path and specially crafted input, not the image format itself.
Do not assume a Vercel platform mitigation protects self-hosted Next.js or another provider's infrastructure.
HOW GENESIS HANDLES IT
Diagnose the exact failure before choosing a repair.
Genesis separates the visible symptom from the underlying technical cause. Run the supported diagnostic first, review the evidence, and then use a matching repair only when the failure is actually verified.
Platform scope
Next.js applications using Image Optimization, especially deployments that process AVIF images
Category
Next.js · Security · Current advisories
Last updated
2026-09-22
REPAIR PROFILE
Know the complexity before you edit.
Difficulty
Intermediate
Change risk
High
These labels describe implementation complexity and blast radius, not a guaranteed repair time.
AUTHORITATIVE SOURCES
Verify time-sensitive platform details at the source.
Which Next.js versions are affected by the 2026 AVIF image-optimization RCE advisory?
GitHub's reviewed advisory lists >=10.0.0 and <15.5.24, plus >=16.0.0 and <16.3.3, as affected.
Which Next.js versions contain the framework patch?
The advisory lists 15.5.24 and 16.3.3 as patched versions for the Next.js issue.
Is the vulnerability actually inside Next.js?
Vercel says the root cause was upstream in libheif, an AVIF decoder used by sharp and other web tooling. The Next.js advisory covers how that dependency affected the framework's image-optimization path.
If my site is hosted on Vercel, do I still need to upgrade?
Vercel says it deployed a platform-wide mitigation, but upgrading to a patched framework version is still the durable application-level response and helps keep the dependency state explicit.
Once you know the platform and the verified problem, search the Genesis Code Doctor Code Store for a matching package. If the exact integration or repair is not there, use Request a Code and describe the platform, official documentation, desired behavior, and sanitized error—never send your secret key.
Start with a free diagnostic. If Genesis verifies a problem and a compatible treatment exists, continue to the matching Code Store product or repair path. If you cannot find the exact code you need, request it at GenesisCodeDoctor.com rather than forcing a generic snippet into the wrong platform.