Case study 04

The App That Kept Its Secrets in Plain Sight

An Android application was storing sensitive data in ways that made it accessible to anyone who looked.

The situation

I was reviewing an Android application to understand how it handled credentials, network traffic, and locally stored data. The app was a typical mobile application. It stored user data, communicated with a backend API, and maintained authentication state. It appeared to function correctly from the user's perspective.

The investigation revealed a different story.

The investigation

I started with static analysis of the application package, which involves examining the decompiled code without running the application.

The first finding was hardcoded credentials. An API key was embedded directly in the application code and used to authenticate requests to a backend service. Anyone who extracted the application package could access this key.

The second finding was cleartext network traffic. The application was transmitting sensitive data over HTTP rather than HTTPS, which meant the data could be intercepted and read by anyone on the same network.

The third finding was insecure local storage. Authentication tokens and other sensitive data were being stored in plaintext on the device, where other applications with storage permissions could access them.

Why it mattered

These vulnerabilities were simple to exploit. An attacker could:

  • Extract the hardcoded API key from the application package.
  • Intercept cleartext network traffic.
  • Access plaintext tokens stored locally.

The combined impact was significant. Account takeover, data exfiltration, and impersonation were all possible. The CVSS score for this combination of vulnerabilities was 9.8.

The fix

I documented each finding with evidence and step by step remediation guidance.

  • The hardcoded credentials needed to be removed from the application code and managed through a secure backend.
  • The network traffic needed to be encrypted using HTTPS to prevent interception.
  • The locally stored data needed to be encrypted and stored in a secure location.

What I learned

This case reminded me that mobile applications are often treated as trusted environments. They are not. The same security principles that apply to web applications apply to mobile applications.

Secrets in client-side code are not secrets. Data in transit needs protection. Data at rest needs protection. The vulnerabilities were not complex. They were the result of assuming that the application environment was secure.

Technical takeaway

The investigation involved:

  • Decompilation of the Android application package
  • Static analysis of code for hardcoded credentials
  • Network traffic analysis
  • Local storage inspection

The same approach can be applied to most mobile applications: examine what is stored, what is transmitted, and what is embedded in the code.