Key Takeaways
- A mobile app ships to the attacker's device, so anything inside it, keys, URLs, logic, can be extracted. The app is not a secret-keeping place.
- The chain was: decompile the app, to hardcoded secrets and backend URLs, to a trusting backend API, to an over-privileged cloud key, to data and storage access.
- Hardcoded API keys and cloud credentials are among the most common mobile findings, and they often grant far more than the app needs.
- The backend, not the app, is where the real damage happens. A mobile pentest is really a test of the API and cloud behind the app.
- Secrets belong on the server, exchanged for scoped, short-lived tokens. The app should never hold a credential that can do more than the logged-in user.
The App Is the Attacker's to Keep
The fundamental fact of mobile security is that you give the application to the person attacking it. Once an app is installed, its package can be pulled from the device, and that package contains the compiled code, the resources, and anything the developers put inside it. Tools like jadx and apktool turn an Android APK back into readable code and resources in seconds. Whatever is in the app is readable; the only question is what the developers assumed nobody would look at.
We pulled the target's Android app and decompiled it. The goal at this stage is not exploitation, it is reading: looking through the code, the strings and the configuration files for anything that should not be shipped to a user's phone. It did not take long.
Link 1: Secrets Hardcoded in the Code
Inside the decompiled app we found what we were looking for: a hardcoded API key, the base URL of the backend, and a cloud service credential, all sitting in the code and resource files. Developers hardcode these to make the app work and assume the compiled binary hides them. It does not. A few minutes of static analysis surfaced them in plain text.
This gave us two things. First, the full map of the backend API the app talks to, including endpoints that the app's own screens never visibly used. Second, a cloud credential whose scope we now needed to test. Link one of a mobile chain is almost always this: read the app, take its keys and its API.
jadx-guiandapktool d app.apkdecompile the code and resources; grep the output for keys, tokens, URLs andhttpendpoints.- Check
strings, resource XML, and config files; secrets hide in all of them, not just the main code. - Hardcoded keys are frequently over-privileged, a cloud key with broad access rather than a scoped, user-specific token.
Want to Know Your Real Attack Chain?
Codesecure runs red team and internal penetration tests that start where a real attacker starts: an unauthenticated foothold, and chain the misconfigurations until something breaks. You get the full attack path, mapped to MITRE ATT&CK, with the exact fixes that break each link. ISO/IEC 27001:2022 certified delivery, named OSCP, CEH and CISSP consultants, across India, Singapore, UAE and Malaysia.
See Red Team and VAPT Services →Link 2: A Backend That Trusts the Client
Armed with the API map, we tested the backend directly, outside the app. The recurring mobile mistake is a backend that trusts the client: because requests normally come from the company's own app, the server assumes they are well-behaved. They are not, once an attacker is crafting them by hand. We found endpoints that returned user data based on an id in the request without checking ownership, the same broken object level authorization that plagues web APIs.
So, exactly as in a web chain, we could retrieve other users' records by changing identifiers in the API calls the app had shown us. The mobile app was simply the map that led us to a backend which had never been tested as an independent, internet-facing API, because everyone thought of it as "the app's backend" rather than "a public API that an app happens to call".
Link 3: An Over-Privileged Cloud Key to the Storage
The hardcoded cloud credential from link one turned out to be the deepest problem. Rather than a narrowly scoped token, it was a key with broad access to the project's cloud storage, the kind of credential that should live only on a server. With it, we could reach the storage buckets behind the application directly, outside any of the app's own logic, and access files belonging to many users.
This is the mobile-to-cloud pivot: a key meant to let the app read one user's avatar instead granted access to the whole bucket. Combined with the trusting backend, it meant the data exposure was not limited to what the API returned; it extended to the raw storage. A single over-privileged key, shipped inside an app anyone could download, undid the isolation between users.
- Test the scope of any extracted cloud key: what buckets, tables or services does it actually reach? Over-broad scope is the norm, not the exception.
- Misconfigured backends-as-a-service (for example open database rules or world-readable buckets) turn one leaked key into bulk data access.
- Rotate any key that has shipped in an app immediately; assume it is already public.
The Whole Chain
Three links, and the first was simply reading a file anyone could download:
- 1. Decompiling the app handed us hardcoded keys and the backend API.
- 2. A backend that trusts the client let us read other users' data by changing ids.
- 3. An over-privileged cloud key gave us direct access to the storage behind the app.
Not Sure Where Your Chain Starts?
Most compromises begin with something small: an anonymous share, a reused password, a writable script. On a free 30-minute call our lead will map the most likely first links in your environment and how we would test them.
Book a Free Scoping Call →Signals, and Why the Backend Is the Real Target
Parts of this chain are detectable on the backend side. A cloud key being used from unfamiliar locations or at unusual volume, bulk access to storage, and API requests enumerating ids across many users all leave traces in cloud and application logs that a SIEM can alert on. The static theft of the key from the app is silent, which is exactly why the key should not be there to steal and the backend should not trust it.
The through-line of mobile security is that the app is a map, and the backend is the territory. A mobile penetration test that stops at the app, checking only for local issues, misses the point; the serious findings are almost always in the API and cloud the app talks to. Testing the app and its backend together, as one system, is how you find a chain like this before someone else downloads your app and does.
Frequently Asked Questions
Can secrets really be extracted from a mobile app?
Yes, easily. A mobile app is distributed to users' devices, and its package can be pulled and decompiled with free tools like jadx and apktool, exposing the code, resources and configuration. Any API key, token, backend URL or cloud credential compiled into the app can be read in plain text. Obfuscation slows this down but does not prevent it. The correct assumption is that anything inside the app is public, so secrets must live on the server, not in the client.
Why is a hardcoded API key in a mobile app dangerous?
Because it is both extractable and often over-privileged. An attacker who decompiles the app obtains the key, and if that key grants broad access, for example to cloud storage or a database rather than a single user's data, it becomes a direct route to other users' information. Many mobile breaches trace to a hardcoded cloud credential with far more scope than the app needed. Keys should be kept server-side and exchanged for scoped, short-lived tokens.
Is mobile app security really about the backend?
Largely, yes. While apps do have local issues (insecure storage, weak cryptography, missing certificate pinning), the highest-impact findings are usually in the API and cloud services the app communicates with. The app reveals the backend's endpoints and sometimes its credentials, and a backend that trusts the client or exposes over-privileged keys is where data is actually breached. A good mobile penetration test assesses the app and its backend together as one system.
How do we secure a mobile app and its backend?
Keep secrets out of the app and exchange user authentication for scoped, short-lived tokens on the server; enforce authentication and object-level authorization on every backend request rather than trusting the app; tightly scope or eliminate cloud keys and enforce storage and database security rules server-side; follow the OWASP MASVS; add certificate pinning and secure local storage; and monitor cloud and API logs for anomalous key use and id enumeration. Test the app and backend together.
What is the OWASP MASVS?
The OWASP Mobile Application Security Verification Standard (MASVS) is the industry standard for mobile app security requirements and testing. It covers areas such as data storage, cryptography, authentication, network communication, platform interaction, code quality and resilience. It gives a structured basis for a mobile penetration test, and its guidance on not storing secrets in the client and on securing communication with the backend directly addresses the weaknesses in this attack chain.
Can Codesecure test our mobile app and its backend?
Yes. Codesecure runs mobile application penetration tests aligned to the OWASP MASVS, covering the app itself (reverse engineering, hardcoded secrets, insecure storage, pinning) and, crucially, the backend API and cloud services behind it, where the serious impact lives. You get the full attack path and the fix at each link. ISO/IEC 27001:2022 certified delivery with named OSCP, CEH and CISSP consultants across India, Singapore, UAE and Malaysia.
What Does Your App Hand to an Attacker?
Codesecure reverse-engineers your mobile app and tests the backend and cloud behind it as one system, chaining hardcoded secrets to real data impact, then hands you the fix at every link. Mobile pentest aligned to OWASP MASVS by named OSCP, CEH and CISSP consultants, ISO/IEC 27001:2022 certified, across India, Singapore, UAE and Malaysia.

