From APK to AWS: How I Chained a Hardcoded Secret to a Full Cloud Takeover
A hardcoded Hasura admin secret in the Android app's strings.xml allowed full database access, and the Hasura console's cron trigger feature was abused to perform SSRF against the AWS metadata service, leaking IAM credentials.
Published on mnmeftekharian.medium.com
Mobile applications are often treated as “black boxes” by developers, with the assumption that users will simply interact with the UI and never look under the hood. However, for a security researcher, an APK file is an open book.
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
Impact
An attacker could read, modify, or delete all customer data and, by extracting AWS IAM credentials via SSRF, potentially access S3 buckets, control EC2 instances, and move laterally within the cloud environment.
What the attacker needed
Access to the APK file; Ability to decompile the APK; Network access to the Hasura endpoint
The fix
Remove hardcoded secrets from the mobile app, avoid granting admin privileges to client-embedded keys, and enforce IMDSv2 to block SSRF to the metadata service.
How it was found
- Extract the APK from the device using ADB.
- Decompile the APK with Apktool.
- Search strings.xml for sensitive keys and endpoints.
- Decode the Base64-encoded Hasura secret.
- Access the Hasura console with the secret to gain admin access.
- Create a cron trigger to send requests to the AWS metadata service and read responses in logs.
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.
The app contained a secret key that gave full control over its database. The attacker used a feature that makes web requests to trick the server into revealing cloud credentials, which could then be used to access other cloud resources.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.