Skip to content
SSRF Write-up Intermediate

Connect State Attack First Request Validation

The application validated the Host header only on the first request of an HTTP keep-alive connection, allowing an attacker to send a second request on the same connection with a tampered Host header to reach an internal admin panel.

Yani Follow

Published on infosecwriteups.com

The purpose of the HTTP host header is to help identify which back-end service the client wants to communicate with, in addition, many applications rely on the host header to generate password reset link or redirect address, etc. The logic flaw or misconfiguration may result in different types of HTTP host header…

Yani, on infosecwriteups.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 the application validates the Host header only on the first request of a persistent HTTP connection and does not re-validate it on subsequent requests.

Impact

An attacker could access internal websites, such as an admin panel, that are not meant to be publicly reachable.

What the attacker needed

Ability to send HTTP requests; keep-alive connection support

The fix

The application should validate the Host header on every request in a connection, not just the first.

How it was found

  1. Capture the GET / request to the vulnerable website as request #1.
  2. Duplicate request #1 as request #2 and change its path to /admin and its Host header to 192.168.0.1.
  3. Send request #2 alone and observe a redirect to the homepage.
  4. Create a tab group containing request #1 and request #2.
  5. Set the Connection header to keep-alive in both requests and send the group in sequence over a single connection.
  6. Observe that the second request successfully accesses the internal admin panel.

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.

When you visit a website, your browser sends a 'Host' header telling the server which site you want. Some servers check this header only on the first request of a connection, then reuse the same connection for later requests without checking again. An attacker can abuse this by sending a normal first request, then a second request on the same connection with a fake Host header to reach 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 Yani

View all

4 more disclosed reports, best first.

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.