[█████████] Hardcoded credentials in Android App
Hardcoded HTTP credentials were found in the decompiled Android app, and after discovering a related subdomain, the credentials gave access to a clone of the main admin panel. The company shut down the domain shortly after the researcher logged in.
Originally disclosed on HackerOne
- Fixed in 14 hours
- Paid in 6 days
- Disclosed after 12 days
Summary by the program
Authorization credentials for one of our development environments were hard coded in our Android App. We changed it as soon as this was reported.
Thanks @gerben_javado for reporting this.
Summary by the researcher
After decompiling the Zomato app I found basic HTTP credentials in the app. This sort of happend on accident since I was looking for new endpoints to the API instead of looking for credentials. After finding the credentials I didn't know what do with them since the domain they belonged to returned a 503 error. Doing a subdomain bruteforce however discovered a subdomain where the credentials would expose a clone of the main admin panel.
Zomato shutdown this domain 5 minutes after I logged in.
What the report shows
The target was the Zomato Android app. The researcher, gerben_javado, decompiled the app and found basic HTTP credentials embedded in it. He was not looking for credentials: he was hunting for new API endpoints, and the credentials turned up by accident.
The report gives no file path, class name, string resource or code snippet, so the exact place in the app where the credentials sat is not described. What it does say is that the credentials were basic HTTP credentials, meaning a username and password pair sent with HTTP Basic authentication rather than a token or key.
His first problem was that the domain the credentials belonged to returned a 503 error, so he could not use them directly. He then ran a subdomain bruteforce against that domain. This uncovered a subdomain where the same credentials gave access to a clone of the main admin panel. He logged in, and Zomato shut the domain down five minutes later.
The program's summary confirms the finding: authorisation credentials for one of their development environments were hard coded in the Android app, and they changed them as soon as the report arrived. The report was rated critical and paid a 500 USD bounty. It was disclosed on 19 July 2017.
Root cause
The mistake is likely that a development environment's credentials were placed in client-side code, where anyone who downloads the app can read them. Android apps ship as packages that can be decompiled, and string constants, configuration values and embedded resources survive that process. A credential that only makes sense for an internal or development system is still a credential once it is inside an APK, and the report shows the same credentials worked on a subdomain found by bruteforce.
Impact
The report's own account is narrow: the credentials exposed a clone of the main admin panel on a subdomain that the main domain did not obviously point to. The researcher does not describe what the panel allowed him to do, and the report does not say what data or actions were reachable. The program calls the credentials authorisation credentials for a development environment, which suggests the blast radius was bounded by what that environment contained, but the report does not state this either. The speed of the shutdown indicates the program treated the exposure as serious.
How this kind of bug works
Mobile clients are distributed to untrusted devices, so anything compiled into them should be treated as public. Developers often need the app to talk to a backend during development, and the quickest route is to embed a username and password, an API key or a token in the build. If that build reaches production, or if the same credential is valid against a reachable host, the secret is effectively published.
HTTP Basic authentication makes this worse because the credential is a reusable pair that keeps working until it is rotated. Anyone who extracts it can authenticate from anywhere until it is rotated. The usual defences are to keep secrets out of the client entirely, to issue short-lived per-user tokens instead, and to make sure development environments are not reachable from the internet.
How to test for it
- Obtain the app package and decompile it.
- Search the decompiled sources and resources for strings that look like credentials or endpoints: URLs, hostnames,
Authorizationheaders, base64 blobs, and keys named likeuser,pass,secret,tokenorapi_key. - For each candidate host, resolve it and check what it returns. A 503 or a parked page does not mean the credential is dead; it may mean the host is misconfigured or the service sits elsewhere.
- Enumerate subdomains of the parent domain with a wordlist or certificate transparency data, and test the credential against each host that presents an authentication prompt.
- A positive result is a successful login, or any response that differs from the unauthenticated one in a way that shows the credential was accepted.
Common false positives: placeholder values, test strings that look like credentials but authenticate nowhere, keys that are valid only for a public service with no privileges, and credentials that work but grant access to nothing sensitive. Confirm access to something meaningful before reporting.
How it is fixed
Remove the credential from the client and rotate it immediately, since it must be assumed compromised. Replace it with a mechanism that does not require a shared secret in the app: per-user authentication, short-lived tokens issued at runtime, or a backend-for-frontend that holds the secret server-side. Restrict development and staging environments so they are not publicly reachable, and add secret scanning to the build pipeline so embedded credentials are caught before release.
Hunting notes
Hard-coded credentials hide in mobile apps, JavaScript bundles, desktop clients, firmware and public repositories. Recon signals worth watching are strings that reference internal hostnames, staging or development subdomains, and authentication headers in client code. When a host returns an error, do not stop: enumerate siblings of the domain and retry the credential there, as this report shows.
What happened, in plain words
Zomato is a restaurant discovery and food delivery service. It has an Android app that people install on their phones, and behind that app sits a set of servers that the app talks to. This report is about a mistake in how the app was built: a username and password for one of Zomato's internal systems were written directly into the app itself.
The researcher, gerben_javado, was not even looking for passwords. He was exploring the app to find new parts of Zomato's API, the set of addresses the app uses to fetch data from the servers. To do that, he took the app apart, a process called decompiling, which turns the installed package back into readable code and resources. While reading through it, he came across a pair of basic HTTP credentials by accident.
Basic HTTP credentials are simply a username and password that a browser or app sends to a server to prove who it is. The server replies with a prompt asking for them, and the client sends them along. It is like showing a membership card at a door: the card is the same every time and does not expire on its own.
His first attempt to use them failed. The domain, the website address, that the credentials belonged to returned a 503 error. A 503 is the server saying it is temporarily unable to handle the request, which can mean the service is down, overloaded or simply not configured to answer. So the credentials seemed useless at first.
Instead of giving up, he ran a subdomain bruteforce. A subdomain is a prefix added to a main domain, for example shop.example.com next to example.com. A bruteforce here means trying a long list of common names as prefixes and seeing which ones exist. This uncovered a subdomain where the same credentials worked, and they opened a clone of the main admin panel, the control interface used to manage the service.
He logged in. Zomato shut the domain down five minutes later.
The program's own summary confirms the finding: authorisation credentials for one of their development environments were hard coded in the Android app, and they changed them as soon as the report arrived. The report was rated critical and paid a 500 USD bounty. It was disclosed on 19 July 2017.
Why this matters
An Android app is a file that anyone can download and inspect. Whatever is written inside it, including passwords, can be read by anyone who takes the time to unpack it. A password that only makes sense for an internal or development system is still a password once it is inside that file, and here it turned out to work on a subdomain found by bruteforce.
The report's own account is narrow: the credentials exposed a clone of the main admin panel on a subdomain that the main domain did not obviously point to. The researcher does not describe what the panel allowed him to do, and the report does not say what data or actions were reachable. The program calls them authorisation credentials for a development environment, which suggests the damage was limited by what that environment contained, though the report does not state this either. The speed of the shutdown shows the program treated the exposure as serious.
In general, how this kind of bug works
Mobile apps are handed out to devices the developer does not control, so anything compiled into them should be treated as public. Developers often need the app to talk to a backend while building it, and the quickest route is to embed a username and password, an API key or a token in the build. If that build reaches production, or if the same credential is valid against a reachable host, the secret is effectively published.
HTTP Basic authentication makes this worse because the credential is a reusable pair that keeps working until it is changed. Anyone who extracts it can authenticate from anywhere until it is changed. The usual defences are to keep secrets out of the client entirely, to issue short-lived per-user tokens instead, and to make sure development environments are not reachable from the internet.
In general, how to test for it
- Obtain the app package and decompile it.
- Search the decompiled sources and resources for strings that look like credentials or endpoints: URLs, hostnames,
Authorizationheaders, base64 blobs, and keys named likeuser,pass,secret,tokenorapi_key. - For each candidate host, resolve it and check what it returns. A 503 or a parked page does not mean the credential is dead; it may mean the host is misconfigured or the service sits elsewhere.
- Enumerate subdomains of the parent domain with a wordlist or certificate transparency data, and test the credential against each host that presents an authentication prompt.
- A positive result is a successful login, or any response that differs from the unauthenticated one in a way that shows the credential was accepted.
Common false positives: placeholder values, test strings that look like credentials but authenticate nowhere, keys that are valid only for a public service with no privileges, and credentials that work but grant access to nothing sensitive. Confirm access to something meaningful before reporting.
In general, how it is fixed
Remove the credential from the client and change it immediately, since it must be assumed compromised. Replace it with a mechanism that does not require a shared secret in the app: per-user authentication, short-lived tokens issued at runtime, or a backend-for-frontend that holds the secret server-side. Restrict development and staging environments so they are not publicly reachable, and add secret scanning to the build pipeline so embedded credentials are caught before release.
In general, where to look while hunting
Hard-coded credentials hide in mobile apps, JavaScript bundles, desktop clients, firmware and public repositories. Recon signals worth watching are strings that reference internal hostnames, staging or development subdomains, and authentication headers in client code. When a host returns an error, do not stop: enumerate siblings of the domain and retry the credential there, as this report shows.
Glossary
- API: the set of addresses and rules an app uses to request data from a server.
- Android app package (APK): the file format in which an Android app is distributed and installed.
- Admin panel: a web interface used to manage and control a service.
- Authorisation credentials: a username and password (or similar pair) used to prove permission to access a system.
- Basic HTTP authentication: a login method where the client sends a username and password with each request, encoded but not encrypted on its own.
- Bounty: a reward paid by a company for a valid security report.
- Bruteforce: trying a long list of guesses automatically until one works.
- Certificate transparency data: public logs of issued website certificates, useful for discovering subdomains.
- Clone: a copy of a system, here a duplicate of the main admin panel.
- Critical: the highest severity rating, meaning the issue could cause serious harm.
- Decompiling: turning a compiled app back into readable code and resources.
- Development environment: a separate setup used by developers to build and test, not meant for public use.
- Domain: a website address such as
example.com. - Endpoint: a specific address on a server that an app can call.
- False positive: a finding that looks like a problem but is not one in practice.
- Hard coded: written directly into the source or build of a program rather than supplied at runtime.
- Header: extra information sent alongside a web request or response, such as authentication details.
- Host: a single server or website address.
- HTTP: the protocol browsers and apps use to talk to web servers.
- Rotate: replace a credential with a new one, invalidating the old.
- Secret scanning: automatically checking code and builds for passwords, keys and tokens.
- Staging environment: a test setup that mirrors production, used before release.
- Subdomain: a prefix on a domain, such as
shop.example.com. - Token: a value issued to a user or app to prove identity, often with an expiry.
- 503 error: an HTTP response meaning the server is temporarily unable to handle the request.