Skip to content
Open redirect Write-up Beginner

Multiple Host Header Attacks after bypassing protection with… a Header Attack

The API returned 200 responses instead of 403 when the Host header was changed, allowing directory enumeration and access to robots.txt. Some directories with 301 responses redirected to any website supplied in the Host header, enabling open redirects.

vict0ni Follow

Published on web.archive.org

I was searching for bug bounty programmes by using google dorks, when I came across one by a company, let’s say, Example Inc. They had a relatively big scope and I thought I’d give that a try.

vict0ni, on web.archive.org

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 trusted the Host header for access control and for building redirect URLs, instead of using a fixed, validated hostname.

Impact

An attacker could bypass API key checks to enumerate directories and read robots.txt, and could use the 301 endpoints to redirect users to arbitrary websites.

What the attacker needed

None

How it was found

  1. Send a request to the API without a valid X-API-KEY header and observe a 403 response.
  2. Change the Host header to a different value and observe a 200 response.
  3. Access robots.txt and enumerate directories that were previously inaccessible.
  4. Use ffuf to find directories that return 301 responses.
  5. Change the Host header on those 301 directories to redirect to an arbitrary website.

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 Host header tells a web server which website name the browser asked for. Here, changing that name made the server skip its normal access check and also let an attacker choose where some redirects sent people.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

More by vict0ni

View all

6 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.