Next.js: Server-Side Request Forgery in Server Actions on custom servers
Impact
When a Server Action forwards or redirects a request, an attacker can cause the server to send that outbound request to a malicious host (Server-Side Request Forgery). This requires the attacker's request to control Host-associated headers. In some configurations, it's also possible to obtain internal values that weaken middleware/proxy authorization.
Applications that use Server Actions are affected when the incoming host header is not fixed to a trusted value. This typically occurs on custom servers, or on deployments not behind a proxy that pins the host. Managed hosting pins the host upstream and is not affected; next start and standalone output do the same from version 14.2 onward.
Workarounds
If you cannot upgrade, ensure clients do not control the host header your application receives. Pin or validate Host and X-Forwarded-Host at your edge or proxy. On version 14.2.0 and later, you can additionally set the __NEXT_PRIVATE_ORIGIN environment variable to your deployment's real origin:
__NEXT_PRIVATE_ORIGIN=https://www.example.com node server.js
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | next | >= 14.1.1, < 15.5.21, >= 16.0.0, < 16.2.11 | 15.5.21, 16.2.11 |
References
- https://github.com/vercel/next.js/security/advisories/GHSA-89xv-2m56-2m9x
- https://github.com/vercel/next.js/commit/b51206321854193208c0805ba42acc49287f942b
- https://github.com/vercel/next.js/commit/e3e5666ccead3a15162793d697af5e48b7cc0498
- https://github.com/vercel/next.js
- https://github.com/vercel/next.js/releases/tag/v15.5.21
- https://github.com/vercel/next.js/releases/tag/v16.2.11
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N- Weakness (CWE)
CWE-918- Platform
- npm
- Package
next- Disclosed
- 22.07.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-89xv-2m56-2m9x - CC BY 4.0
Vulnerability history: next
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 73
- First → latest
- 12.2017 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 5
- High 27
- Medium 32
- Low 9
Disclosures per year
- 2017: 1
- 2018: 2
- 2019: 0
- 2020: 3
- 2021: 3
- 2022: 3
- 2023: 1
- 2024: 6
- 2025: 14
- 2026: 40
-
Next.js: Server-Side Request Forgery in Server Actions on custom servers this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.