Coinbase Android Application - Bitcoin Wallet Leaks OAuth Response Code
The Coinbase Android app logged the OAuth response code to the system log, which any app on the same device could read. Combined with a hardcoded client secret, an attacker could exchange the code for an access token.
Originally disclosed on HackerOne
- Triaged in 28 days
- Fixed in 5 months
- Paid in 5 months
- Disclosed after 8 months
Hi,
There's a simple bug here, the Coinbase Android App. "BitCoin Wallet" leaks the OAuth Response Code which can be obtained using adb logcat -s Coinbase command line for testing, and any Android application on the same phone can read the response code for the user by reading the logs. As of now nothing can be harmed with OAuth Response code, but along with the hardcoded client secret we can obtain the access_token.
This bug is similar to this - http://attack-secure.com/all-your-facebook-access-tokens-are-belong-to-us/
So using the stolen response code and client secret we can derive the access_token
POC: https://www.dropbox.com/s/zionksi1pt7lot5/Coinbase-Android.mov
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
Impact
An attacker with a malicious app on the same device could read the OAuth response code and, with the hardcoded client secret, potentially derive an access token.
What the attacker needed
Malicious app on same device; access to device logs
How it was found
- Run the Coinbase Android app and trigger the OAuth flow.
- Use adb logcat with the Coinbase tag to view logs.
- Observe the OAuth response code in the logs.
- Extract the hardcoded client secret from the app.
- Exchange the response code and client secret for an access token.
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 log in to an app using another service (like Coinbase), the service sends back a short-lived code. This code is like a temporary key. The app then swaps this code, along with a secret password, for a longer-lived access token that lets it act as you. Here, the app wrote that temporary code into a system log that any other app on the phone can read. If an attacker also knows the secret password (which was hardcoded in the app), they can swap the stolen code for an access token and access the victim's account.
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.