M1: Improper Credential Usage in Mobile Apps
Every install of the app carried the company's SMS gateway key.
What Is M1: Improper Credential Usage in Mobile Apps?
An API key compiled into a mobile app ships to everyone who installs it. You'll watch an attacker decompile a public app, lift its SMS gateway key and send phishing texts under the company's name, then revoke the key and move the secret behind the app's own backend.
What You'll Learn in M1: Improper Credential Usage in Mobile Apps
- Recognise that any secret compiled into a mobile app can be recovered by anyone who downloads and decompiles it.
- Revoke and rotate a leaked third-party API key first, before changing any code in the app.
- Move calls that need a secret behind the app's own backend, which authenticates the user and holds the key.
- Prove the fix by checking that the new build contains no key and the old key is rejected.
M1: Improper Credential Usage in Mobile Apps — Training Steps
-
Pull the app apart
Ridlowe is a ride-hailing app with a share-my-trip feature: a rider taps a button and a contact gets a text with a live link to the ride. Bob has no account with Ridlowe and no access to anything it runs. He has what every rider has: the app. He downloaded the Android build from a public APK mirror and now unpacks it back into readable source.
-
Look for anything secret
Bob does not read 4,000 files. He searches them for the names developers give to credentials: key, token, secret, and the names of the services an app like this would talk to.
-
Ask the gateway who he is
A key alone could be a test key or a dead one. Bob asks the SMS gateway what account it belongs to and what it is allowed to do, exactly as the app would.
-
Find the audience
Campaign access means Ridlowe's rider lists live on the gateway. Bob lists them.
-
Text every rider as Ridlowe
Bob writes one message: a fake failed-payment notice with a link to his own card-capture page. He sends it to the whole rider list, from Ridlowe's sender name, billed to Ridlowe's account.
-
Where the key came from
-
A text from your own app
Alice builds the Ridlowe apps for Android and iOS, and her own test phone is signed up as a rider. A text has just arrived on it, in the Ridlowe thread.
-
A message from Priya
Before the details land in her inbox, Priya Nandakumar messages Alice directly.
-
The gateway sees it too
A few minutes later the security lead writes. The SMS gateway has flagged the campaign.
-
Read the build like an attacker
Alice does not need the source tree to know what is in the app. She looks at the shipped APK the way anyone with a copy could.
Security Framework Coverage
OWASP Mobile Top 10
- M1:2024 Improper Credential Usage
OWASP MASVS
- MASVS-AUTH-1 The app uses secure authentication and authorization protocols and follows the relevant best practices.
CWE
- CWE-798 Use of Hard-coded Credentials
CIS Controls
- CIS 16 Application Software Security
NIST CSF
- PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
- PR.PS Platform Security
NICE Framework
- DD-WRL-003 Secure Software Development