What Is This Vulnerability
Mobile App Credential Extraction is a compound vulnerability where multiple secrets, API keys, tokens, and credentials can be extracted from a mobile application through reverse engineering. Rather than a single hardcoded key, this finding indicates a systemic pattern of embedding sensitive credentials throughout the app — in source code, configuration files, shared preferences, and bundled resources.
This vulnerability is identified when three or more distinct credentials are found during analysis, suggesting a fundamental architectural issue where the mobile app is treated as a trusted environment.
Why It's Dangerous
Multiple extracted credentials compound the risk exponentially:
- Broad attack surface — each credential opens a different attack vector (database access, payment processing, email sending, cloud storage).
- Lateral movement — credentials for one service often contain information (project IDs, account identifiers) that helps compromise others.
- Difficult remediation — rotating a single key is straightforward; rotating many keys across multiple services requires coordinated effort and can cause downtime.
- Supply chain risk — third-party SDK keys may grant access to shared resources or partner systems.
- Persistent access — attackers can use different credentials as fallbacks if one is rotated, maintaining access until all are revoked.
A typical extraction might yield a Supabase anon key, a Firebase config, a Stripe publishable key, an analytics API key, and a push notification server key — each enabling different types of abuse.
How to Detect
Perform comprehensive static analysis on the mobile binary:
# Full credential scan for Android APK
jadx -d output/ app.apk
# Run a comprehensive secret scan
grep -rn "eyJhbGciOi" output/ # JWT tokens
grep -rn "AIza[0-9A-Za-z_-]\{35\}" output/ # Google/Firebase
grep -rn "sk_live\|sk_test" output/ # Stripe secret keys
grep -rn "pk_live\|pk_test" output/ # Stripe publishable keys
grep -rn "AKIA[0-9A-Z]\{16\}" output/ # AWS Access Keys
grep -rn "sk-[a-zA-Z0-9]\{20,\}" output/ # OpenAI keys
grep -rn "xoxb-\|xoxp-" output/ # Slack tokens
grep -rn "SG\.[a-zA-Z0-9]\{22\}" output/ # SendGrid keys
grep -rn "key-[a-zA-Z0-9]\{32\}" output/ # Mailgun keys
# Check resource and config files
find output/ -name "*.xml" -o -name "*.json" -o -name "*.plist" | xargs grep -l "key\|secret\|token\|password"
AuditYour.app runs over 100 regex patterns against decompiled mobile apps and correlates findings to map out the full credential exposure surface.
How to Fix
Adopt a zero-trust architecture for mobile clients:
// Backend proxy pattern — mobile app never holds sensitive keys
// Mobile app authenticates user, backend handles all privileged operations
// Server-side (Edge Function / API route)
app.post('/api/send-email', authenticate, async (req, res) => {
// SendGrid key stays server-side
const sg = new SendGrid(process.env.SENDGRID_API_KEY);
await sg.send({ to: req.body.to, subject: req.body.subject });
res.json({ success: true });
});
app.post('/api/create-payment', authenticate, async (req, res) => {
// Stripe secret key stays server-side
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const intent = await stripe.paymentIntents.create({
amount: req.body.amount,
currency: 'usd',
customer: req.user.stripeCustomerId,
});
res.json({ clientSecret: intent.client_secret });
});
Establish a credential management checklist:
- Audit every key in the mobile codebase and classify as public (safe to embed) or secret (must be server-side).
- Move all secret keys to environment variables on your backend.
- Implement API proxy endpoints for every third-party service.
- Use platform-specific secure storage (Android Keystore, iOS Keychain) for any runtime tokens.
- Add automated secret scanning to your CI/CD pipeline to catch regressions.
Scan your app for this vulnerability
AuditYourApp automatically detects security misconfigurations in Supabase and Firebase projects. Get actionable remediation in minutes.
Run Free ScanRelated
vulnerabilities
Hardcoded API Keys in APK
API keys and secrets found in decompiled Android APK files through static analysis.
vulnerabilities
Hardcoded API Keys in IPA
API keys and secrets found in iOS application bundles through static analysis of IPA files.
vulnerabilities
Service Role Key in Mobile Binary
Supabase service_role key found in a mobile app, granting full admin access that bypasses all RLS policies.