Big Bounty: Uncovering Critical Security Flaws in Android Apps
The Android app contained hardcoded API keys, tokens and credentials in its BuildConfig file and assets folder. An attacker who decompiled the APK could extract these secrets and use them to access backend services without authorisation.
medium.com
Published on medium.com
Hi everyone! My name is Satyam Pawale, also known as @hackersatty in the bug bounty world.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, sensitive credentials and API keys were hardcoded into the app's source code and asset files instead of being kept server-side or injected at runtime.
What the attacker needed
Ability to download the APK; ability to decompile the APK
The fix
Secrets should be removed from the app code and assets, stored server-side, rotated frequently, and protected by server-side authentication.
How it was found
- Download the target APK file.
- Open the APK in jadx-gui for decompilation.
- Explore the project structure, focusing on core directories like com and assets.
- Search for keywords such as API_KEY, TOKEN, and SECRET.
- Inspect the BuildConfig.java file and JSON files in the assets folder for credentials.
- Use Burp Suite to intercept app traffic and modify requests with the discovered tokens to confirm unauthorised access.
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 write-up has not been written yet. The Original tab links to the source.
When developers build an Android app, they sometimes leave secret passwords or keys inside the app's code. Anyone can download the app and unpack it to read those secrets. If the secrets still work, an attacker can use them to talk to the app's servers as if they were the app itself.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.