Insufficient validation on Digits bridge
The Digits login bridge validated the HTTP Referer header to decide whether a site was allowed to request another app's OAuth credentials, but treated an empty Referer as valid. An attacker could suppress the Referer header and use the bridge to obtain a victim's OAuth credentials for a different application.
Originally disclosed on HackerOne
- Triaged in 6 days
- Fixed in 14 days
- Paid in 13 days
- Disclosed after 3.9 years
Hi, I would like to report an issue in one of the login methods, getLoginStatus() in Digits, which allows attacker to retrieve the OAuth credential data of an application victims authorized.
#Details The getLoginStatus() method provides a seamless login option. If a user has logged in Digits, a website can use this method to get the user's OAuth credentials instead of asking him to authorize it. The way it works is to embed an iframe (https://www.digits.com/bridge) onto a web page, and communicate with the web page through postMessage(). Currently, there is a security check in place which prevents a website to call this method with other app's key by making sure the HTTP Referer is the registered domain. The protection works because embedding an iframe involves sending the Referer header in the request. If app A wants to call the method and pretend itself as app B, it won't work because the Referer header is from app A instead of the registered domain of app B.
However, It was found that if the Referer header is left empty, the validation will also think this is valid. The problem is that there is a way for a website to disable sending Referer for out bound requests by using the tag <meta name="referrer" content="never">. This allows an attacker to bypass the validation.
#PoC
- Prepare a Periscope account which is associated with a phone number, and make sure you have logged in Digits (https://www.digits.com/signin) with that number
- Go to http://innerht.ml/pocs/digits-bridge-referer-bypass
- Wait for a while
- You Periscope account will be renamed as "Pwn3d"
#Fix Instead of validating HTTP Referer, using the app's registered domain as the targetOrigin in postMessage is more reliable. That way, only the correct recipient can read the transferred data.
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 bridge's origin check treated a missing Referer header as a match instead of rejecting it, and relied on Referer rather than the postMessage targetOrigin.
Impact
An attacker could retrieve the OAuth credential data of an application the victim had authorised.
What the attacker needed
Victim has a Digits-linked account; victim visits attacker page; attacker knows target app key
How it was found
- Prepare a Periscope account linked to a phone number and sign in to Digits with that number
- Visit the attacker's proof-of-concept page
- Wait for the page to run
- The linked Periscope account is renamed to a marker showing the attack worked
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 sign in to a site with your phone number, a small embedded frame (an iframe) passes your login details back to the page. The service checked a header called Referer, which normally says which website made the request, to make sure only the right site could ask. It forgot that a page can simply stop sending that header, and an empty value was accepted as if it were correct.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.