Skip to content
Leaked secrets Disclosed report Beginner

Insecure Storage and Overly Permissive API Keys in Android App

The Android app contained hardcoded API keys and tokens that could be extracted by decompiling the APK. An attacker with the app could recover these secrets and potentially use them to send requests on the user's behalf or access data.

ticzox Follow

Originally disclosed on HackerOne

Bounty$750 Medium View original
  • Triaged in 4 days
  • Fixed in 2 months
  • Paid in 5 days
  • Disclosed after 4 months

#Description: Most often Developers for their ease of use,leave API keys and some sensitive keys ,Tokens as hardcoded strings,which isn't really a good ideas as it can result in Leaks of sensitive information getting in Wrong Hands which indeed can results in Data theft and Tampering with how the application deals with the data, and API requests the application Makes.

==I found a bunch of API keys,Tokens.==

#To Check API keys leaks Sensitive Information or not https://github.com/streaak/keyhacks

#Steps to reproduce. 1.Decomiple the app. 2.Look for sensitive information

#Proof of Concept: Screenshots has been attached as a proof of concept.

Impact

If an attacker decompiles your apk, and extracts your token, they can indeed maliciously send traffic on your behalf. This is the case with pretty much every single one of the web companies out there (google included). The main thing to know however, is that it is rarely useful for people to do this. Polluting someone else's data while possible, isn't exactly a profitable thing to do. You can also create server-side filters to help prevent this thing from happening.

The original report as published on HackerOne, by ticzox. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Zenly is a location-sharing app, and the asset in scope here is the Android client, app.zenly.locator. The report is about what ships inside that APK rather than about a server-side endpoint: API keys and tokens that the developers left in the application as hardcoded strings. The researcher's framing is that developers often do this for ease of use, and that the practice can leak sensitive information into the wrong hands, leading to data theft and to tampering with how the application handles data and makes API requests.

The weakness recorded for the report is cleartext storage of sensitive information, and the researcher describes finding "a bunch of API keys, Tokens".

Setup

The only precondition is the ability to obtain the application package and decompile it. No accounts, roles or special access are described. The researcher points to an external helper for the next stage, a GitHub repository used to check whether a leaked API key exposes sensitive information:

Text
https://github.com/streaak/keyhacks

The researcher points to that repository as a way to check whether a leaked API key exposes sensitive information.

Finding it

The researcher's observation is a general one about mobile development: keys and tokens are frequently embedded as hardcoded strings because it is convenient. The suspicion is that this app does the same. The test is therefore not a request against a live endpoint but an inspection of the shipped binary.

Exploitation

Step 1: Decompile the app

Text
1.Decomiple the app.

The APK is unpacked and decompiled so that its strings and code become readable. This is the standard first move on an Android target: the DEX bytecode and the resources are turned back into something a human can search.

Step 2: Look for sensitive information

Text
2.Look for sensitive information

With the decompiled output in hand, the researcher searched for embedded secrets and found a set of API keys and tokens. The report does not list the individual keys, the services they belong to, or the values, so the specific findings cannot be reproduced from the text alone.

Step 3: Check what the keys expose

Each candidate key is looked up in the keyhacks catalogue to determine whether it grants access to anything sensitive. The report states that screenshots were attached as proof of concept, but no screenshots are present in the material available here, so the concrete responses from those checks are not shown.

Root cause

The mistake is in how the client was built: credentials that should live on the server, or be issued per user at runtime, were compiled into the APK as constant strings. Anything shipped in an APK is readable by anyone who downloads the app, because decompilation is cheap and the binary is public. The report does not describe any server-side control that would have limited what those keys could do. The report does not describe any defence that was in place and failed.

Impact

The researcher's own statement of impact is measured. If an attacker decompiles the APK and extracts a token, they can send traffic on the application's behalf. The report notes that this is true of pretty much every web company, Google included, and that it is rarely useful for someone to do so: polluting another party's data is possible but not exactly profitable. The report also suggests server-side filters as a way to prevent it.

So the impact is that an attacker can send traffic on the application's behalf; polluting another party's data is possible but rarely profitable. The severity recorded for the report is medium, and a bounty of 750 USD was paid.

Fix

The direction it points to is server-side filtering to constrain what requests made with an extracted key can do.

Variants to test

  1. Search decompiled output for strings that look like keys from well-known services, then run each through the keyhacks catalogue. A positive result is a key that returns data or accepts a write when used from outside the app.
  2. Check third-party SDK configuration inside the APK, such as map, analytics and push providers. A positive result is a provider key with broader permissions than the app itself needs.
  3. Look for tokens in resource files and build config rather than only in code. A positive result is a secret in strings.xml, BuildConfig or an asset file.
  4. Test whether an extracted key is scoped to a single app or shared across the platform. A positive result is a key that works against endpoints the app never calls.

Hunting notes

This class of bug hides in the client binary, so the entry point is always the APK: decompile it, then grep for high-entropy strings and for the naming patterns of common providers. The report itself keeps the impact claim modest, acknowledging that abuse is possible but rarely profitable, and that server-side filtering is the practical mitigation.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

Zenly is an app for sharing your location with friends. The report is about the Android version of that app, whose package name is app.zenly.locator. The problem is not in Zenly's servers. It is in the app file itself, the one you download from the app store.

When a developer builds an Android app, all the code and resources are packed into a single file called an APK. That file sits on your phone, and anyone can copy it off and open it up. If the developer has written secret values, such as API keys and tokens, directly into the code as fixed text, then those secrets travel inside the APK to every user. Anyone who unpacks the file can read them.

The researcher decompiled the Zenly app, searched through what came out, and found "a bunch of API keys, Tokens". The weakness recorded for the report is cleartext storage of sensitive information: secrets stored in a form anyone can read, with no protection around them.

A quick word on the two central ideas, because everything below depends on them:

  • An API (application programming interface) is the set of addresses a program uses to talk to a company's servers. Think of it as the service counter at a shop: the app walks up, shows its credentials, and asks for data or asks to save something.
  • An API key or token is the credential the app shows at that counter. It is a long string of characters that identifies the app to the server. Think of it as a membership card: whoever holds the card gets served, without the server asking who they really are.

If the membership card is printed inside a file that every customer receives, then anyone can copy the card and use the counter in the app's name. That is the whole finding.

Setup

To repeat this, you need one thing: the ability to get the app's package file and decompile it. Decompiling means turning the packed, machine-readable APK back into something a person can read and search, roughly like unpacking a zip archive and finding readable text inside. The report describes no accounts, no special roles and no access to Zenly's internal systems. The app is public, so the starting material is public too.

For the next stage, working out what a found key can actually do, the researcher points to an external helper, a public GitHub repository:

Text
https://github.com/streaak/keyhacks

The researcher points to that repository as a way to check whether a leaked API key exposes sensitive information.

Finding it

The researcher starts from a general observation about mobile development: developers often leave keys and tokens in the code as fixed strings because it is convenient. It saves the effort of building a proper system for handing out credentials at runtime. The suspicion is that this app does the same.

So the test here is not a request sent to a live server. It is an inspection of the file that ships to users. That is an important difference for a beginner: you are not attacking anything over the network, you are reading something that was handed to you.

Exploitation

Step 1: Decompile the app

Text
1.Decomiple the app.

This line is the first instruction in the researcher's reproduction steps. The APK is unpacked and decompiled so that its strings and code become readable. On Android, the app's logic is stored in a compiled form called DEX bytecode, and the app's resources (text, images, configuration) are stored alongside it. Decompiling turns both back into something a human can search through.

Why this step comes first: everything else depends on being able to read the app's contents. Until the APK is unpacked, the secrets are just bytes inside a binary. Once it is unpacked, they are text you can search for.

Step 2: Look for sensitive information

Text
2.Look for sensitive information

With the decompiled output in hand, the researcher searched for embedded secrets and found a set of API keys and tokens. Searching here means looking for text that resembles a credential: long random-looking strings, or strings sitting next to names that suggest a key, such as a provider's name followed by "key" or "token".

Why this step matters: finding a string that looks like a key is only a lead. It could be a placeholder, a test value, or something already revoked. The next step is what turns a lead into a finding.

The report does not list the individual keys, which services they belong to, or their values. That means the specific findings cannot be reproduced from the text alone; you would have to repeat the decompilation yourself on the same version of the app.

Step 3: Check what the keys expose

Each candidate key is looked up in the keyhacks catalogue to determine whether it grants access to anything sensitive. In plain terms: you take the key you found, find the service it belongs to in the catalogue, and follow the catalogue's instructions for testing that kind of key.

The report states that screenshots were attached as proof of concept, but no screenshots are present in the material available here, so the concrete responses from those checks are not shown.

Root cause

The mistake is in how the app was built. Credentials that should live on the server, or be handed to each user at runtime, were compiled into the APK as constant strings. A constant string is a value written directly into the code, fixed at build time, identical for every copy of the app.

Anything shipped in an APK is readable by anyone who downloads the app, because decompilation is cheap and the file is public. The report does not describe any server-side control that would have limited what those keys could do. The report does not describe any defence that was in place and failed.

Impact

The researcher's own statement of impact is measured. If an attacker decompiles the APK and extracts a token, they can send traffic on the application's behalf. In everyday terms: they can walk up to the service counter holding a copy of the app's membership card, and the server will treat the requests as coming from the app.

The report notes that this is true of pretty much every web company, Google included, and that it is rarely useful for someone to do so. Polluting another party's data is possible, but not exactly profitable. The report also suggests server-side filters as a way to prevent it: rules on the server that restrict what requests made with a given key are allowed to do.

So the impact is that an attacker can send traffic on the application's behalf; polluting another party's data is possible but rarely profitable. The severity recorded for the report is medium, and a bounty of 750 USD was paid.

Fix

The direction it points to is server-side filtering, to constrain what requests made with an extracted key can do.

Variants to test

  1. Search the decompiled output for strings that look like keys from well-known services, then run each one through the keyhacks catalogue. A positive result is a key that returns data or accepts a write when used from outside the app.
  2. Check the configuration of third-party components inside the APK, such as map, analytics and push providers. A positive result is a provider key with broader permissions than the app itself needs.
  3. Look for tokens in resource files and build configuration, not only in code. A positive result is a secret in strings.xml, BuildConfig or an asset file.
  4. Test whether an extracted key is limited to a single app or shared across the whole platform. A positive result is a key that works against addresses the app never calls.

Hunting notes

This class of bug hides in the app file itself, so the entry point is always the APK: decompile it, then search for long random-looking strings and for the naming patterns of common providers.

The report itself keeps the impact claim modest, acknowledging that abuse is possible but rarely profitable, and that server-side filtering is the practical mitigation.

Glossary

  • API: the set of addresses and rules a program uses to talk to a company's servers, like a service counter where requests are made.
  • API key: a long string of characters that identifies an app to a server, like a membership card that gets the holder served.
  • Token: a credential, similar in role to an API key, that a program presents to a server to prove it is allowed to make a request.
  • APK: the single file an Android app is distributed in, containing its code and resources; it is copied onto every user's phone.
  • Decompile: turn a packed, machine-readable program file back into something a person can read and search.
  • DEX bytecode: the compiled form in which an Android app's logic is stored inside the APK.
  • Hardcoded string: a value written directly into the code as fixed text, identical in every copy of the app.
  • Cleartext storage of sensitive information: keeping secrets in a form anyone can read, with no protection around them.
  • Sensitive information: data that should not be public, such as credentials that grant access to systems or data.
  • Credential: any value used to prove identity or permission, such as a key, token or password.
  • Server-side: happening on the company's servers rather than on the user's device.
  • Server-side filter: a rule on the server that restricts what requests made with a given key are allowed to do.
  • Endpoint: a specific address on a server that a program sends requests to.
  • Scope: the set of things a credential is allowed to reach or do.
  • Revoke: cancel a credential so it no longer works.
  • Runtime: the moment the app is actually running on a device, as opposed to build time when the app is compiled.
  • Build time: the moment the developer compiles the app into its distributable file.
  • SDK: a bundle of code from another company that a developer adds to an app to get a feature, such as maps or analytics.
  • Proof of concept: a demonstration, often screenshots or recorded responses, showing that a finding is real.
  • Reconnaissance: the early information-gathering stage of a security test.
  • Impersonation: making requests that appear to come from someone or something else, here from the app itself.
  • Bounty: a payment made by a company to a researcher who reports a valid security issue.
  • Severity: a rating of how serious a finding is, here recorded as medium.

More from Zenly

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.