Finding an Unintended Privilege Escalation While Solving Mobile H
The MainActivity of an Android app trusted user-supplied Intent extras for username, credit balance, and Pro User status without verification. An attacker could launch the activity directly with forged values to gain Pro User privileges and arbitrary credits.
I recently started working through the Food Store challenge on Mobile Hacking Lab.
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
The app assumed only its login screen would launch the main screen, so it never checked whether the data it received was genuine.
What the attacker needed
Android device or emulator with ADB access; The Food Store app installed
The fix
The app should not trust client-supplied Intent extras for security decisions; it should verify user status and credits from a trusted server-side source.
How it was found
- Open the app's APK in JADX and trace the login flow.
- Notice that LoginActivity passes user details to MainActivity via Intent extras.
- See that MainActivity reads those extras directly without validation.
- Use ADB to launch MainActivity manually with forged extras for username, credit, and Pro User status.
- Observe the app accepts the forged values and displays the attacker-controlled data.
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.
In Android, an 'Intent' is a message that starts an app screen and can carry extra data. This app's main screen believed whatever data it received, so anyone could start it with fake data and pretend to be a rich Pro user.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.