Skip to content
Leaked secrets Disclosed report Beginner

hardcoded api secret & api key in com.reddit.frontpage

The Reddit Android app shipped Twitter consumer key and secret values inside its compiled string resources. Anyone who extracted the app could read those credentials and use them to obtain a Twitter bearer token.

0xcharan Follow

Originally disclosed on HackerOne

Critical View original
  • Disclosed after 4 months

hi security team, in file Resources/Resources.arsc/res/values/strings.xml i have found <string name="twitter_consumer_key">███</string> <string name="twitter_consumer_secret">███</string>

It shouldn't be disclosed to third parties it meant for deveoplers as per https://developer.twitter.com/en/docs/authentication/oauth-2-0/bearer-tokens

poc:- curl --user "██████:███" --data 'grant_type=client_credentials' 'https://api.twitter. com/oauth2/token'

response:- {"token_type":"bearer","access_token":"████"}

it meant to request successful as official docs say https://developer.twitter.com/en/docs/authentication/oauth-2-0/bearer-tokens

Impact

leakage of twitter_consumer_key and twitter_consumer_secret to public it meant for deveoplers only

Attachments

Capture.PNG
Capture.PNG From the original on HackerOne
Capture_1.PNG
Capture_1.PNG

The original report as published on HackerOne, by 0xcharan. 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 Twitter consumer key and secret were hardcoded into the app's string resources instead of being kept server-side.

Impact

The Twitter consumer key and secret were exposed to anyone who downloaded the app, allowing them to request bearer tokens with Reddit's developer credentials.

What the attacker needed

Download of the Reddit Android app

How it was found

  1. Extract the app package and open the compiled string resources file.
  2. Locate the twitter_consumer_key and twitter_consumer_secret entries.
  3. Use those values against Twitter's OAuth2 token endpoint to request a bearer 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.

Apps often bundle fixed strings, such as API keys, inside their package. If those strings are secrets, anyone who downloads the app can pull them out and use them. Here the reporter found Twitter developer credentials in the app and showed they still worked to get an access token.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by 0xcharan

View all

1 more disclosed report, best first.

More from Reddit

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.