Skip to content
Access control Write-up Intermediate

Host Validation Bypass via Connection State Attack: Multiple Requests Over the Same TCP Connection

The front-end server validated the Host header only on the first request of a persistent TCP connection, trusting all later requests on that connection. An attacker could send a second request with an internal Host header to reach restricted internal endpoints such as an admin panel.

infosecwriteups.com

Published on infosecwriteups.com

In this specific scenario, the front-end server uses connection-based assumptions to validate the Host header. It analyzes only the first HTTP request in a persistent connection (usually with Connection: keep-alive) to determine if the Host header is valid.

Bash Overflow, 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 front-end server cached the Host validation result from the first request on a keep-alive connection and applied it to all later requests on that connection.

Impact

Services restricted by IP address or host-based logic could be exposed, and in larger infrastructures this might help pivot from a public interface to deeper internal networks.

What the attacker needed

Ability to send raw HTTP requests; server reuses TCP connections (keep-alive); internal service reachable from front-end

How it was found

  1. Send a normal request with a valid public Host header and keep-alive to the server.
  2. Send a second request on the same TCP connection with an internal Host header targeting the admin panel.
  3. Observe that the internal admin panel loads in the response to the second request.
  4. Extract the CSRF token and session cookie from the admin panel response.
  5. Send a POST request on the same connection to the admin delete endpoint with the token and cookie to delete a user.

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.

A web server often checks the Host header to decide which site a request is for. Here the check only happened on the first request of a reused connection, so a second request on the same connection could claim to be for an internal address and get through. This let the author reach an admin page that was meant to be internal only.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.