M3: Insecure Mobile Authentication/Authorization
The app said he was staff, and the API believed it.
What Is M3: Insecure Mobile Authentication/Authorization?
A mobile app that hides staff features behind a flag on the phone, and an API that believes the role the app reports, lets any customer act as staff. You'll watch an attacker refund his own orders with one header, then switch the endpoint off and make the server take roles from its own verified session.
What You'll Learn in M3: Insecure Mobile Authentication/Authorization
- Recognise that a feature flag or role check inside the app is a display choice, not an access control.
- Identify an API that trusts a role or user value sent by the client instead of reading it from its own session.
- Contain abuse by disabling the affected endpoint and reviewing the actions taken through it.
- Enforce every authorization decision on the server, using the role bound to the authenticated session.
M3: Insecure Mobile Authentication/Authorization — Training Steps
-
Pull the app apart
Mealvane is a food delivery app. Its support agents use the same app as customers: sign in with a staff account and a Support tools screen appears, with a button that refunds any order. Bob is an ordinary customer. He downloaded the Android build and unpacks it back into readable source.
-
Find the staff screen
Bob searches the source for how the app decides who is staff, and what the Support tools screen sends to the server.
-
Refund his own order
Last night Bob ordered dinner, and it arrived. He sends the refund call the Support tools screen would send, with the role header and nothing else: no staff login, no session.
-
Again, and again
It works on any order, so it works on every order Bob has placed. He keeps eating and keeps refunding. Then he lists what the role header has given him.
-
What the server trusted
-
Refunds nobody approved
Alice leads the Mealvane apps and the API behind them. Finance has written to her.
-
Reproduce it
Alice suspects the header the Support tools screen sends. She tests it the way an outsider would: no staff login, just the header, against a test order.
-
Switch off refunds from the app
The endpoint is open to anyone right now. Alice turns off the in-app refund route with its feature flag. Agents can still refund from the back-office console, which has its own staff login.
-
Lock the account
Next, Bob's account. Alice signs out every session he has and freezes the account so finance can claw back the refunds.
-
Open the refund handler
Now the cause, which lives on the server, not in the app. Alice opens the API's refund handler.
Security Framework Coverage
OWASP Mobile Top 10
- M3:2024 Insecure Authentication/Authorization
OWASP MASVS
- MASVS-AUTH-1 The app uses secure authentication and authorization protocols and follows the relevant best practices.
CWE
- CWE-602 Client-Side Enforcement of Server-Side Security
- CWE-863 Incorrect Authorization
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