Skip to content
SSRF Write-up Intermediate

CVE-2025–66478 Explained: The Critical Next.js

A critical flaw in how Next.js and React Server Components process user-controlled input in server-side fetch operations allows an attacker to make the server send requests to internal or privileged endpoints. This can lead to SSRF and, in some configurations, remote code execution.

medium.com

Published on medium.com

On December 6, a critical security flaw — CVE-2025–66478 — was publicly disclosed, impacting both Next.js and React Server Components (RSC). This vulnerability enables sophisticated Server-Side Request Forgery (SSRF), and in certain configurations, the possibility of Remote Code Execution (RCE).

Priyen Mehta | Sr Software Engineer, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, user-controlled input is passed into server-side fetch calls without proper validation, allowing the server to be manipulated into requesting internal resources.

Impact

Attackers could reach internal APIs, access metadata endpoints, exfiltrate environment variables, and potentially execute malicious payloads, though RCE is only possible in specific configurations.

What the attacker needed

Application uses Next.js Server Actions or RSC; User input reaches server-side fetch; Server can make outbound requests

The fix

The vulnerability was fixed by upgrading Next.js and React to patched versions listed in the official advisories.

How it was found

  1. User input enters a Server Component or Server Action
  2. That input is passed into a backend call (often unintentionally)
  3. The server fetches a URL that includes the attacker’s payload
  4. The server reaches internal systems (SSRF)
  5. In specific infrastructures, this leak can escalate to RCE

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This bug lets an attacker trick a web server into making requests to other computers inside the same network, which are normally hidden from the outside. The server is fooled into thinking the request came from a trusted source, so it may reveal secrets or allow further attacks. In some setups, the attacker could even run their own code on the server.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.