Skip to content
OpenAdvisories
Medium · 6.5 Scanner template CVE-2025-57822 EUVD-2025-26245GHSA-4342-x723-ch2f

Next.js Improper Middleware Redirect Handling Leads to SSRF

Published Aug 29, 2025 · Updated Sep 2, 2025 · Assigned by GitHub_M

Description

Next.js is a React framework for building full-stack web applications. Prior to versions 14.2.32 and 15.4.7, when next() was used without explicitly passing the request object, it could lead to SSRF in self-hosted applications that incorrectly forwarded user-supplied headers. This vulnerability has been fixed in Next.js versions 14.2.32 and 15.4.7. All users implementing custom middleware logic in self-hosted environments are strongly encouraged to upgrade and verify correct usage of the next() function.

Affected products

VendorProductAffectedFixed
vercel next.js < 14.2.32, < 15.4.7 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling jitsucom-jitsu +2 2.11.0-r1 —

Automated scanner template

A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.

Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.

Affected packages

EcosystemPackageAffectedFixedRecord
npm next >= 0.9.9, < 14.2.32 14.2.32 GHSA-4342-x723-ch2f
npm next >= 15.0.0-canary.0, < 15.4.7 15.4.7 GHSA-4342-x723-ch2f

Advisories 1

References