Bypassing Location Restrictions on a Android App Using Frida
The Android app relied on client-side checks to enforce location restrictions, which could be bypassed by hooking the location logic with Frida. An attacker could then access region-specific features or geofenced content as if on a real device.
medium.com
Published on medium.com
Hello, Pentester! In this post, I’ll take you through an intriguing journey of bypassing location restrictions in Android applications, showcasing my findings and techniques that can elevate your pentesting skills!
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 the app enforced location restrictions only on the client side, so the check could be altered at runtime.
Impact
Attackers could bypass location restrictions, potentially misusing region-specific features or geofenced services, which could lead to financial losses or legal issues.
What the attacker needed
Android device or emulator; Frida installed; APK decompilation tool; Ability to run the app
How it was found
- Decompile the APK with apktool to access the source code.
- Inspect multiple files handling location logic to find the relevant check.
- Create a Frida JavaScript hook to manipulate the location behaviour.
- Run the Frida hook against the app package.
- Log in again and observe that the location error is bypassed.
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.
The app tried to check the phone's location itself, but that check lived inside the app on the phone. Using a tool called Frida, the tester changed what that check returned while the app was running. So the app thought the phone was in an allowed place, even though it was not.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.