Skip to content
Open redirect Disclosed report Beginner

use of unsafe host header leads to open redirect

The URL shortener built links using the untrusted Host header, so an attacker could supply a crafted host and have the short link redirect victims to an attacker-controlled domain. This enabled open redirects and phishing.

exception Follow

Originally disclosed on HackerOne

  • Triaged in 5 days
  • Fixed in 25 days
  • Paid in 11 days
  • Disclosed after 57 days

Hi guys

I noticed you are using unsafe host header in generating short links.

#Details First i navigated to my account https://socialclub.rockstargames.com/member/xerojuzto

Then i created a new message , and i clicked on share button which shortens the url for example

From https://socialclub.rockstargames.com/member/xerojuzto/feed/3073813190982488067 to http://rsg.ms/517ae7c

I fetched the http requests to find the end-point which is used to shorten urls. https://socialclub.rockstargames.com/some_dirs/share/Person/getcontent?_=1488723542848

the end-point is taking all the url parts before /Share/Person and creates a short link corresponding to this cut url.

I Guess the code looks like

<?php
$actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$trimed_link=explode($actual_link,"/Share");

$short=DB_Create_short_link($trimed_link);
echo $short;
?>

Did you notice the usage of HTTP_HOST which is variable and could be changed by sending different host header values , this will result in creating malicious urls.

The following request

GET /feed/102126489/activity/3073813190982488067/share/Person/getcontent?_=1488723542848 HTTP/1.1
Host: socialclub.rockstargames.com

Is meant to shorten /feed/102126489/activity/3073813190982488067 to http://rsg.ms/517ae7c but due to not sharing my wall , it will create another redirect to my profile https://socialclub.rockstargames.com/member/xerojuzto

#Exploiting I tried to manipulate the host header to force it to redirect the client to my domain

GET /feed/102126489/activity/2960911889698885091/share/Person/getcontent?_=1488725310707 HTTP/1.1
Host: socialclub.rockstargames.com.this.is.my.domain.evil.net

and it resulted in creating http://rsg.ms/5350b75 if you visited it , you would be redirected to

https://socialclub.rockstargames.com.this.is.my.domain.evil.net/member/xerojuzto/feed/2960911889698885091 Which is not your domain.

#Consequences 1- Phishing attacks 2- Open redirects 3- Cache poisoning and password reset leakage (Limited)

#Steps to reproduce 1- Log into your account at socialclub 2- Navigate to your profile 3- Post a new message 4- Set up a proxy server (i used burp) 5- Configure your browser(firefox in my case) to work with the proxy server 6- Click on share button 7- Intercept the request 8- Manipulate the host header and copy the generated shorten url (ex: rsg.ms/5350b75) 9- Visit it and you will see a redirect to the injected domain.

you can visit http://rsg.ms/5350b75 , if you need a video just shout me .

#Fix

  • If you are shortening urls from only socialclub , then you should correctly validate the host header

-If you are using many domains you should create a white list for them before constructing urls.

#Ref http://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html

Best regards Yasser

Attachments

RS_req_resp.png
RS_req_resp.png From the original on HackerOne

The original report as published on HackerOne, by exception. 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 constructed the shortened URL from the HTTP Host header without validating it against an allowlist.

Impact

Attackers could use the short links for phishing and open redirects; the report also mentions limited cache poisoning and password reset leakage.

What the attacker needed

A free account; victim clicks the short link

The fix

The host header should be validated against an allowlist of legitimate domains before constructing shortened URLs.

How it was found

  1. Log into the socialclub account and navigate to the profile.
  2. Post a new message and click the share button to shorten its URL.
  3. Intercept the share request with a proxy.
  4. Change the Host header to an attacker-controlled domain.
  5. Copy the generated short link and visit it to observe the redirect.

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 builds a link, it should use its own known domain name. Here it trusted whatever domain name the visitor's browser sent in the request, so an attacker could put their own domain in that field and the site would create a short link pointing there. Victims clicking the short link would then be sent to the attacker's 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 by exception

View all

7 more disclosed reports, best first.

More from Rockstar Games

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.