Skip to content
Open redirect Disclosed report Beginner

Open redirection with "X-Forwarded-Host" header injection

The application trusted the X-Forwarded-Host header when building redirect URLs, so an attacker could set it to an external domain and cause users to be redirected there. This could be used for phishing.

GitLab

Originally disclosed on GitLab

  • Fixed in 20 months
  • Disclosed after 20 months
Link:          https://hackerone.com/reports/411914
By:            @8ayac

Details: Summary: I have discovered the possibility of Open redirection which threatens the user on so many functions.

Description: The exploitation is via "X-Forwarded-Host" header injection. Note: This issue is at all places where 302 redirect occurs.

Steps To Reproduce:

  1. Sign in to GitLab.
  2. Go to "http://{GitLab host}/projects/new"
  3. Fill out "Project name" form with "poc".
  4. Click "Create project" button.
  5. Intercept the request.
  6. Add X-Forwarded-Host: http://www.example.com to the request header.
  7. Send the request.

Result: Redirected to www.example.com

Impact

An attacker could redirect users to his webpages for phishing attacks.

Note: This issue is at all places where 302 redirect occurs.

Timeline: 2018-09-21 17:45:08 +0000: @jritchey (user assigned to bug [team-only])

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

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 used the value of the X-Forwarded-Host header to construct the redirect URL without validating that it pointed to a trusted domain.

Impact

An attacker could redirect users to their webpages for phishing attacks.

What the attacker needed

A GitLab account; ability to intercept HTTP requests

How it was found

  1. Sign in to GitLab.
  2. Go to the new project page.
  3. Fill out the project name form with 'poc'.
  4. Click the create project button.
  5. Intercept the request.
  6. Add an X-Forwarded-Host header pointing to an external domain and send the request.

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 a website redirects you to another page, it sometimes uses information from the request to decide where to send you. Here, the site trusted a header called X-Forwarded-Host, which a user can set, to choose the destination. An attacker could make the site send people to a fake page that looks real, to steal information.

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 GitLab

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.