Skip to content
Open redirect Disclosed report Beginner

Host Header Attac

The application trusts the Forwarded header's host value, so an attacker can make it redirect users to an arbitrary domain. This enables phishing and potentially cache poisoning.

n_ob_o_dy Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 4 months
  • Fixed in 6 months
  • Disclosed after 6 months

The application is vulnerable to Host Header Injection. An attacker can manipulate the Host header to redirect users to arbitrary domains or potentially poison web caches. Steps to reproduce:

  1. Navigate to https://rubygems.org/ and intercept the request.
  2. Add header ==Forwarded: host=evil.com== and forward the request.
  3. Notice you will be redirect to attacker's malicious website.

Impact

Successful exploitation can lead to user redirection to malicious sites, phishing attacks, and potential data loss. The overall impact of a Host Header attack can be significant, leading to financial loss, reputational damage, and legal consequences. It's crucial to address this vulnerability promptly to protect users and systems.

Attachments

Recording__1.mp4 From the original on HackerOne

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

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

Likely the application uses the client-supplied Forwarded header host value when constructing redirect URLs without validating it against an allowlist.

Impact

Users could be redirected to malicious sites for phishing, and the text claims possible cache poisoning, though no cache behaviour is demonstrated.

What the attacker needed

Ability to intercept and modify requests

The fix

The application should not trust client-supplied host values in the Forwarded header when building redirects.

How it was found

  1. Go to the site and intercept the request.
  2. Add a Forwarded header with an attacker-controlled host value.
  3. Forward the request and observe the redirect to the attacker's site.

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.

When you visit a website, your browser sends a 'Host' header saying which site you want. Some apps also read a 'Forwarded' header that proxies add. Here the app believed the host value from that header and used it to build a redirect, so an attacker could send victims to a fake site.

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 from RubyGems

View all

The newest disclosed reports for this program.

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.