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:
- Sign in to GitLab.
- Go to "http://{GitLab host}/projects/new"
- Fill out "Project name" form with "poc".
- Click "Create project" button.
- Intercept the request.
- Add
X-Forwarded-Host: http://www.example.comto the request header. - 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])
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
- Sign in to GitLab.
- Go to the new project page.
- Fill out the project name form with 'poc'.
- Click the create project button.
- Intercept the request.
- 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.