Server-side Request Forgery (SSRF)next is a react framework.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the prepareDestination rewrite/redirect handling in packages/next/src/shared/lib/router/utils/prepare-destination.ts. An attacker can make the application proxy a request to an arbitrary hostname by supplying crafted path or query values that are substituted into an external rewrites() or redirects() destination hostname. When a destination hostname is built from request-controlled input, Next.js accepts the attacker-chosen host instead of the configured suffix, causing rewrites to fetch and serve content from the attacker’s target host and redirects to send users there. This can expose internal services to SSRF or send users to unintended destinations.
Workarounds
- Do not build the hostname of an external
rewrites() or redirects() destination from user-controlled input.
- If you must use a dynamic subdomain in a
rewrites() rule, constrain the capture to hostname-safe characters, for example value: '(?<region>[a-z0-9-]+)'.
How to fix Server-side Request Forgery (SSRF)? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=12.0.0 <15.5.21>=16.0.0 <16.2.11 |
Use of Cache Containing Sensitive Informationnext is a react framework.
Affected versions of this package are vulnerable to Use of Cache Containing Sensitive Information in createPatchedFetcher in packages/next/src/server/lib/patch-fetch.ts. An attacker can leak a cached response body from one request to another by sending server-side fetch(new Request(...), init) calls to the same URL with different request bodies or overrides. When the Request object and the separate init object diverge, the fetch cache can key the request differently from the effective upstream request, so a response generated for one body is reused for a different body. This exposes confidential data in cached POST responses to unauthorized requests.
Notes
- Applications using the Pages Router are not in scope for this issue; the advisory applies to the server-side patched fetch path.
- The leak requires
fetch(new Request(...), init) where the separate init overrides the base Request; fetch(new Request(init), init) is the safe shape called out by the maintainers.
How to fix Use of Cache Containing Sensitive Information? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=13.0.0 <15.5.21>=16.0.0 <16.2.11 |
Server-side Request Forgery (SSRF)next is a react framework.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) through createForwardedActionResponse and createRedirectRenderResult in packages/next/src/server/app-render/action-handler.ts. An attacker can make the server send a forwarded Server Action request or internal redirect to a malicious host by supplying Host-associated headers on a custom server deployment. The affected code builds the outbound origin from the incoming request’s host value when __NEXT_PRIVATE_ORIGIN is not set, so a crafted request can steer the server into contacting an attacker-controlled URL. In deployments where the host header is not pinned to a trusted origin, this can also expose internal values used in middleware or proxy authorization decisions.
Notes
- Managed hosting that pins the incoming host upstream is not in scope for this issue; the vulnerable path is the custom-server/deployment-with-untrusted-host-header case described in the advisory.
- The
__NEXT_PRIVATE_ORIGIN environment variable can override the derived origin in affected versions, so deployments that set it to a fixed real origin avoid the host-header-derived outbound URL.
Workarounds
- Ensure clients cannot control the
Host and X-Forwarded-Host headers your application receives by pinning or validating them at your edge or proxy, which prevents attacker-supplied host-associated headers from steering forwarded Server Actions requests or redirects to a malicious host.
- On Next.js
14.2.0 and later, set __NEXT_PRIVATE_ORIGIN to your deployment’s real origin, for example __NEXT_PRIVATE_ORIGIN=https://www.example.com node server.js, which prevents the server from deriving the outbound origin from request headers.
How to fix Server-side Request Forgery (SSRF)? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=14.1.1 <15.5.21>=16.0.0 <16.2.11 |
Allocation of Resources Without Limits or Throttlingnext is a react framework.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling through the areAllActionIdsValid validation in server action form submission handling. An attacker can exhaust CPU and block other requests in the same process by sending a crafted form payload with many $ACTION_REF_ fields to a page that uses Server Actions. The vulnerable code processes these malformed MPA form submissions before deeper action decoding work, so repeated oversized action-reference fields force excessive validation work on the server. Applications using the App Router with at least one Server Action are affected; Pages Router apps and apps without Server Actions are not.
Notes
- The vulnerable path is in App Router’s MPA form-submission validation, so the expensive validation work is exercised before action decoding on requests carrying server-action form data rather than during the action handler itself.
- The malformed payload pattern is specific to repeated
$ACTION_REF_ fields in the form body; ordinary Server Action submissions are not affected unless they include an unusually large number of those reference fields.
How to fix Allocation of Resources Without Limits or Throttling? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=13.0.0 <15.5.21>=16.0.0 <16.2.11 |
Insertion of Sensitive Information Into Sent Datanext is a react framework.
Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data in action-handler.ts and action-utils.ts. An attacker can enumerate internal Server Action IDs by sending crafted Next-Action requests or probing client-served artifacts that reference those IDs. This exposes the presence of internal server functions and enables endpoint discovery on apps that use Server Actions, increasing the risk of further abuse when combined with other weaknesses.
Notes
- Publicly served client artifacts can reveal the full Server Action ID format, so the disclosure is not limited to active probing with
Next-Action; attackers can also recover candidate IDs from browser-delivered chunks and manifests in apps that ship Server Actions.
- The advisory also covers
use cache endpoints exposed through the same App Router server-function machinery, not just use server actions.
Workarounds
- Never assume authentication at the
use cache or use server boundary; authenticate inside the Server Action or cache boundary itself so unauthenticated users cannot reach the internal endpoint.
How to fix Insertion of Sensitive Information Into Sent Data? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=13.0.0 <15.5.21>=16.0.0 <16.2.11 |
Allocation of Resources Without Limits or Throttlingnext is a react framework.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the handleAction Server Actions path in the App Router Edge runtime. An attacker can exhaust server memory by sending an oversized Server Action request, especially a multipart form submission, because the Edge handler reads the full body without enforcing serverActions.bodySizeLimit. This can crash or destabilize affected deployments and prevent legitimate Server Action requests from being processed.
Notes
- Affected deployments need App Router pages with at least one Server Action running in the Edge runtime; the issue is in that execution path rather than in Server Actions generally.
- The advisory’s practical ceiling is tied to hosting-side request body limits: if the platform does not cap uploads, an oversized multipart action request can still drive memory growth before application code sees it.
Workarounds
- Limit Server Actions request bodies at your hosting provider to 5 MiB maximum, so oversized multipart submissions cannot reach the Edge runtime and trigger excessive memory use.
How to fix Allocation of Resources Without Limits or Throttling? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=13.0.0 <15.5.21>=16.0.0 <16.2.11 |
Inefficient Algorithmic Complexitynext is a react framework.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity through the detectContentType path in next/dist/server/image-optimizer. An attacker can exhaust CPU in /_next/image by sending a remotely hosted SVG that forces expensive content-type detection during image optimization. The vulnerable code runs when the default image loader optimizes configured remote images, so a malicious SVG in config.images.remotePatterns can make the Image Optimization API spend excessive time parsing the response before serving it. This degrades or stalls image requests for users of self-hosted Next.js deployments that rely on the default optimizer.
Notes
- Self-hosted deployments only: the expensive path is in the default Image Optimization API, so
config.images.loader: 'custom', config.images.unoptimized: true, and Vercel-hosted apps are outside the vulnerable deployment pattern.
- The affected remote-image surface is limited to the patterns listed in
config.images.remotePatterns; only those configured origins can drive the costly SVG content-type detection work.
Workarounds
- Set
config.experimental.imgOptSkipMetadata: true to avoid the expensive metadata-detection path in /_next/image, which mitigates the CPU-exhaustion attack from malicious remote SVGs.
How to fix Inefficient Algorithmic Complexity? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=15.5.0 <15.5.21>=16.0.0 <16.2.11 |
Improper Encoding or Escaping of Outputnext is a react framework.
Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via the IncrementalCache.generateCacheKey function in next/dist/server/lib/incremental-cache. An attacker can make a server-side fetch return a cached response body from a different request by sending POST requests to the same URL with different non-UTF-8 request bodies that collapse to the same cache key. The affected cache key generation decodes request bodies as strings, so distinct byte sequences with invalid UTF-8 can hash to the same entry even though the requests are not deduped. This can leak confidential response data from one POST to an unauthorized request that uses a colliding body, breaking response isolation for server-side cached fetches.
Notes
- Applications using Pages Router are not affected; the advisory’s cache-key confusion is in the server-side fetch cache path used by the App Router/
IncrementalCache flow.
- The issue is only reachable when request bodies are sent with a non-UTF-8 charset or otherwise contain byte sequences that do not round-trip as UTF-8; default UTF-8 request bodies do not trigger the collision described in the advisory.
How to fix Improper Encoding or Escaping of Output? Upgrade next to version 15.5.21, 16.2.11 or higher.
| >=13.0.0 <15.5.21>=16.0.0 <16.2.11 |