M3: Insecure Mobile Authentication/Authorization

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

M3: Insecure Mobile Authentication/Authorization — Training Steps

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. What the server trusted

  6. Refunds nobody approved

    Alice leads the Mealvane apps and the API behind them. Finance has written to her.

  7. 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.

  8. 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.

  9. 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.

  10. 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