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.
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…
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
- Capture the GET / request to the vulnerable website as request #1.
- Duplicate request #1 as request #2 and change its path to /admin and its Host header to 192.168.0.1.
- Send request #2 alone and observe a redirect to the homepage.
- Create a tab group containing request #1 and request #2.
- Set the Connection header to keep-alive in both requests and send the group in sequence over a single connection.
- 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.