Android Logcat: The Hidden Goldmine of Sensitive Data for Pentest
The Android app logged sensitive data such as authentication tokens, OTPs, GPS coordinates, and PII to the system log during normal use. An attacker with ADB access could read these logs without root and use the exposed tokens or personal data to hijack sessions or violate privacy.
When performing Android application security testing, one of the most overlooked yet critical areas is log exposure through logcat. During a recent pentest, I discovered that the target app was unintentionally leaking sensitive user and device information including tokens, GPS coordinates, API traffic, and personally…
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 used debug logging statements that printed sensitive values without stripping them out in production builds.
Impact
Sensitive data such as tokens, OTPs, and PII could be read by anyone with ADB access, potentially leading to session hijacking or privacy regulation violations, though the text notes this is easier on rooted devices or debug builds.
What the attacker needed
ADB access to the device; app installed and running; no root required
The fix
The app should avoid logging sensitive data, sanitise any necessary logs, disable debug logging in release builds, and enable code obfuscation.
How it was found
- Find the app's package name using ADB, Frida, or the device's App Info screen.
- Get the app's process ID with adb shell pidof.
- Capture logs for that process ID to a file using adb logcat.
- Interact with the app normally, including logging in, browsing, and logging out.
- Stop the log capture and search the output file for keywords like token, auth, otp, or location.
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.
Android apps can write messages to a system log called logcat, which is meant for debugging. If an app writes private things like login tokens or your location there, anyone who can connect a computer to the phone with debugging tools can read them. This report shows that even without special hacking tools, those logs can leak secrets.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.