Skepra / Web recovery & resilience

Next.js SVG rejection bypass: verify self-hosted image optimization safely

A self-hosted image optimizer needs a bounded rejection test and exact version evidence before a security decision.

Discuss the next maintenance decision

The Next.js advisory GHSA-7qx7-33qx-rqx2 describes an SVG rejection bypass in the image optimizer. The affected ranges are Next.js 15.0.0 through 15.5.28 and 16.0.0 through 16.4.4. The fixed versions are 15.5.29 and 16.4.5. The advisory is limited to self-hosted deployments where the image optimizer can process attacker-supplied content from a permitted source even though dangerouslyAllowSVG: false is configured.

Verify the actual image path

Record the installed next version, whether the deployment is self-hosted, the image loader, remotePatterns or equivalent source allowlist and the dangerouslyAllowSVG setting. A site using a custom loader may not use the affected optimizer path. A source allowlist is still relevant because the advisory requires an image from a permitted source.

Test rejection without live content

Use a staging host and a synthetic image source that the application intentionally permits. Keep the test SVG non-executable and free of client data. Request it through /_next/image and record the response status, content type, cache behavior and server logs. Also test a non-permitted source to verify that the allowlist still rejects it.

The expected outcome is that an SVG remains rejected when the application has disabled SVG support. Do not broaden the allowlist to make the test pass, and do not label a parser reachability result as XSS or remote code execution. If the version and deployment shape match, upgrade to 15.5.29 or 16.4.5 and rerun the same bounded test.

Handoff artifact

Give the owner the package-lock or equivalent version evidence, deployment mode, image configuration, permitted source class, staging request and before-and-after result. Record whether the application uses the default image optimizer or a custom loader. Keep the test asset and logs free of secrets and personal data.

Applicability and limits

This article applies conditionally to self-hosted Next.js image optimization in the affected ranges. The advisory describes increased exposure to denial of service and SVG decoder vulnerabilities. It does not by itself establish XSS, remote code execution or a vulnerable client site.

Primary sources: Next.js November 2026 Security Release and GHSA-7qx7-33qx-rqx2. Title evidence is provisional because the authorized SerpApi observation returned only two resolved organic sites. Technical and editorial review remain pending.