Skip to content
OAuth / SSO Disclosed report Intermediate

Incorrect param parsing in Digits web authentication

The Digits web authentication client-side parameter parser only splits on ampersand, while the server also accepts semicolons as delimiters. An attacker could craft a URL that bypasses host validation and redirects the OAuth flow to a domain they control, potentially stealing the victim's OAuth credentials.

File Descriptor Follow

Originally disclosed on HackerOne

  • Triaged in 2 hours
  • Fixed in 5 months
  • Paid in 4 days
  • Disclosed after 2.4 years

Hi, I would like to report an issue on Digits web authentication which allows attackers to retrieve the OAuth credential data of an application victims authorized.

#Detail Digits web authentication has strict validation on host and callback_url. On the server side, the values are compared with the registered domain. However, on the client side, the way parameters are parsed has a wrong assumption. Specifically, in https://cdn.digits.com/45ed91c4cf9b6bb7465c27574b16910df8a86d2e_1458327827406/javascripts/popup.js

JavaScript
              return window.location.search.slice(1).split("&").forEach(function(e) {
                    var n = e.split("=");
                    t[n[0]] = window.unescape(n[1])
                })

The above code snippet is responsible to convert query string into parameters, which assumes that the param delimiter has to be ampersand (&). In fact, the server side also accepts semi-colon (;) as param delimiter. For example:

https://www.digits.com/login?consumer_key=9I4iINIyd0R01qEPEwT9IC6RE;host=https%3A%2F%2Fwww.periscope.tv

is the same as

https://www.digits.com/login?consumer_key=9I4iINIyd0R01qEPEwT9IC6RE&host=https%3A%2F%2Fwww.periscope.tv

This creates a problem because from the server's perspective, a=b;c=d is two different parameters a and c, while the client thinks there is only one parameter a with value b;c=d. Attacker can evade the validation by append ;@attacker.com in the corresponding param. Such bypass looks like this:

https://www.digits.com/login?consumer_key=9I4iINIyd0R01qEPEwT9IC6RE&host=https%3A%2F%2Fwww.periscope.tv;@attacker.com

The server side thinks the host parameter is https://www.periscope.tv, while for client side it is https://www.periscope.tv;@attacker.com.

The funky URL in browser perspective looks like this:

https://www.periscope.tv;@attacker.com
--------\    authority   /\ hostname /

Therefore attacker successfully control the destination domain to his/her controlled site.

#PoC

  1. Prepare a Periscope account which is associated with a phone number
  2. Login to Periscope using the phone number with digits web login flow: https://innerht.ml/pocs/digits-validation-bypass/
  3. After that your account will be renamed as "Pwn3d"

#Fix In addition to ampersand, also treat semi-colon as param delimiter. A sample patch would be to change

JavaScript
window.location.search.slice(1).split("&")

to

JavaScript
window.location.search.slice(1).split(/[&;]/)

The original report as published on HackerOne, by filedescriptor. 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

The client-side JavaScript parser assumed only '&' separates parameters, but the server also accepted ';', creating a parsing mismatch that allowed host validation bypass.

Impact

An attacker could redirect the OAuth flow to a domain they control and retrieve the victim's OAuth credential data.

What the attacker needed

Victim has a Periscope account with a phone number; victim uses Digits web login flow; attacker controls a domain

The fix

The client-side parser should treat both ampersand and semicolon as parameter delimiters, for example by splitting on a regular expression that matches either character.

How it was found

  1. Prepare a Periscope account associated with a phone number.
  2. Log in to Periscope using the phone number with the Digits web login flow.
  3. After that, the account will be renamed to 'Pwn3d'.

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.

The report shows the check could be fooled by using a semicolon instead of an ampersand in the web address, letting an attacker send the login result to their own site and retrieve OAuth credential data.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More by File Descriptor

View all

20 more disclosed reports, best first.

More from X / xAI

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.