Skip to content
SSRF Audit finding Intermediate

Server-Side Request Forgery (SSRF) in ./src/pages/_app.tsx via the Host header

The Next.js application builds a server-side URL from the user-controlled Host header and fetches it, returning the response in the page. An attacker could make the server issue requests to arbitrary hosts, including internal network assets, and inject spoofed configuration data.

cdl Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#47740 [W&A-Critical] Server-Side Request Forgery (SSRF) in `./src/pages/_app.tsx` via the Host header

Submitted on Jun 19th 2025 at 12:58:45 UTC by @cdl for IOP | Zano Trade

  • Report ID: #47740
  • Report Type: Websites & Apps
  • Report severity: Critical
  • Target: ./src/pages/_app.tsx
  • Impacts:
    • Retrieve sensitive data/files from a running server, such as:
  • /etc/shadow
  • database passwords
  • blockchain keys (this does not include non-sensitive environment variables, open source code, or usernames)

Description

Brief/Intro

The Next.JS application is vulnerable to Server-Side Request Forgery (SSRF) on every page due to trusting user input in ./src/pages/_app.tsx. This allows an attacker to issue HTTP requests originating from Zano's servers to any destination on the internet and to internal networks.

Vulnerability Details

In ./src/pages/_app.tsx, the application generates the intialPageProps server-side – https://github.com/PRavaga/zano-p2p/blob/master/src/pages/\\_app.tsx#L61-L83

It does so by:

  1. Grabbing the Host header.
  2. Building a URL from that host header.
  3. Issuing an HTTP request to the URL.
  4. Returning the JSON response in the page:
<script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{},"config":{JSON_RESPONSE_FROM_STEP_2}},

However, an attacker can control the Host header. So an attacker can send the following request:

$ curl http://localhost:30289/dex -H 'Host: attacker.com'

And the application is forced to make an HTTP request to http://attacker.com/api/config/

Impact Details

An attacker can issue HTTP requests to internal network assets or can force the application to load their own spoofed JSON. The latter could potentially be used to poison the cache for other users (need to investigate this claim more).

Proof of Concept

Proof of Concept

  1. Start the dex locally: npm i; npm run build; npm start
  2. Start the HTTP server on the attacker VPS
  3. Run:

curl -H 'Host: x.xxe.sh' http://localhost:30289/dex where x.xxe.sh is the FQDN / IP address of your attacking server.

You'll see the application fetches your host:

tail -F /var/log/apache2/access.log
REDACTED - - [19/Jun/2025:12:55:24 +0000] "GET /api/config HTTP/1.1" 301 573 "-" "node"
REDACTED - - [19/Jun/2025:12:55:24 +0000] "GET /api/config/ HTTP/1.1" 200 260 "-" "node"

Furthermore, if you use my host you'll see the page config is now set to:

{"pageProps":{},"config":{"ssrf":"cdl_was_here"}}

The live version is currently protected by Cloudflare, however it may be possible to find the Origin IP / server.

The original report as published on Immunefi, by cdl. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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

How it worked

Root cause

The application trusted the user-supplied Host header to build a URL for a server-side HTTP request without validation.

Impact

An attacker could issue HTTP requests to internal network assets or force the application to load spoofed JSON, potentially poisoning the cache for other users; the live version is protected by Cloudflare, though the origin may be findable.

What the attacker needed

Ability to send a request with a custom Host header; attacker-controlled server to receive requests

How it was found

  1. Start the application locally.
  2. Start an HTTP server on an attacker-controlled host.
  3. Send a request to the application with the Host header set to the attacker's host.
  4. Observe the application fetching the attacker's host in its access log.

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 report has not been written yet. The Original tab links to the source.

Server-Side Request Forgery (SSRF) is when a server is tricked into making a request to a destination the attacker chooses. Here the app took the website name from the incoming request and used it to fetch configuration, so an attacker could point it at their own server or internal systems.

What is SSRF?

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

More by cdl

View all

14 more disclosed reports, best first.

More from Zano Trade

View all

The newest disclosed reports for this program.

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.