M4: Insufficient Input/Output Validation in Mobile Apps
A link decided who got paid, and the user never saw it.
What Is M4: Insufficient Input/Output Validation in Mobile Apps?
A payment app that trusts the values in a link lets whoever writes the link decide who gets paid. You'll watch an attacker text a crafted link that makes the app send money with no confirmation and a fake refund notice, then contain it and fix the handler so a link can only pre-fill a payment the user confirms.
What You'll Learn in M4: Insufficient Input/Output Validation in Mobile Apps
- Treat every value arriving through a deep link or intent as untrusted input from whoever wrote the link.
- Recognise when a link handler performs a sensitive action, such as a payment, without the user confirming it.
- Validate link parameters against strict rules and use them only to pre-fill a screen the user must confirm.
- Encode or escape any link value the app displays, so a link cannot forge in-app messages.
M4: Insufficient Input/Output Validation in Mobile Apps — Training Steps
-
Open up the payments app
Halvery is a bill-splitting app: friends split a dinner or a holiday, and anyone can share a link that opens the app on a ready-made payment. Bob has an account like anyone else and the same app everyone downloads. He unpacks the Android build back into readable source to see how those payment links are handled.
-
Read the link handler
The app opens links to its own payment domain directly, without a browser in between. Bob reads the code that receives them.
-
Text the link to thousands
Bob writes one link: £180 to his own handle, bob.r, with confirm=1 and a note that makes the receipt claim the money will be refunded. He wraps it in a text that looks like a normal Halvery payment request and sends it through a bulk SMS service he pays for.
-
Watch the wallet fill
An hour later Bob checks his own Halvery wallet, with his own session token, exactly as the app does.
-
How the money moved
-
Fraud reports overnight
Alice leads mobile development at Halvery. The head of customer support has written to her first thing.
-
The text customers got
Noor's forward has landed on Alice's test phone, which has the current release of Halvery and a sandbox account.
-
Tap it on the test build
Alice reproduces it the way a customer would: one tap on the link.
-
Stop new link payments
Thousands of those texts are still sitting unread. Before touching code, Alice switches off what the link can do in every installed copy of the app, using the remote flag the app checks on launch.
-
Freeze the receiving account
The money has not left Halvery yet. Alice freezes bob.r so none of it can be withdrawn while the payments team reverses it.
Security Framework Coverage
OWASP Mobile Top 10
- M4:2024 Insufficient Input/Output Validation
OWASP MASVS
- MASVS-PLATFORM-1 The app uses IPC mechanisms securely.
- MASVS-CODE-4 The app validates and sanitizes all untrusted inputs.
CWE
- CWE-939 Improper Authorization in Handler for Custom URL Scheme
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