Multi-Account Isolation Failure
← Insecure Authentication / Authorization
multi_account_isolation_failure MEDIUM
| Category | Insecure Authentication / Authorization |
| OWASP Mobile (2024) | M3 |
| MASVS | MASVS-AUTH-1MASVS-STORAGE-1 |
| MASWE | MASWE-0024 |
| CWE | CWE-459CWE-200CWE-613 |
| Platform | AndroidiOS |
Description
Switching accounts (or logging out and into account B) does not fully clear account A’s cached credentials, tokens, keys, or on-disk/in-memory data, so account B can read or act with account A’s data - and old sessions survive logout. The isolation boundary between accounts on one device fails. The secure path scopes all per-account state to the active principal and wipes/rotates it on switch and logout.
How it works
Account A signs in on the device, then the user switches to account B. Because the app caches credentials in process-wide slots and never tears them down, switching (or logging out and back in) does not clear account A’s token, private note, or live session, so account B reads and acts with account A’s data, and A’s old session survives. Each account’s token is also persisted to the SharedPreferences XML and not purged on switch, so account A’s token lingers on disk and is pullable with adb. The secure path scopes all per-account state to the active principal and wipes or rotates it, including the on-disk token, on every switch and logout.
How to exercise it. DVMA is the harness - open this module from the home index and tap the demo action. The screen ships the malicious input and simulates the attacker (e.g. the companion app, crafted intent, or scanned payload) in-process, and the evidence panel prints the proof. The Tools (optional) and Attack inputs below are only needed to reproduce the exploit end-to-end on a real device.
Exploit steps
- Set up. Build DVMA with a flavor that enables the Insecure Authentication / Authorization category (e.g.
--dart-define-from-file=config/flavors/dev.json) and run on an emulator/simulator you control. The demo needs no external tooling; for the optional on-device reproduction the relevant tools are:mitmproxy,sqlite3,frida· Android:adb,run-as· iOS:objection,plutil. - Locate the target. From the home index, open Multi-Account Isolation Failure (
multi_account_isolation_failure). The How it works section above describes this module’s specific weakness; the screen states the intended-secure behavior and exposes the vulnerable action. - Exploit. Drive the authentication/authorization path, capture the token / assertion / decision, then replay or tamper with it (mitmproxy, a WebAuthn test harness, or by editing the value) and confirm the server-side check accepts the manipulated request.
- Observe the evidence. Trigger the vulnerable action and read the evidence panel - it prints the concrete proof (leaked value, accepted replay, executed payload, or unauthorized result).
- Contrast with the secure path. Run the module’s secure/hardened action (where provided) and confirm the same attack is rejected - this is what a correct implementation should do.
Tools (optional)
Android
iOS
Attack inputs
Payloads/artifacts you author for the on-device attack. The demo already ships and simulates these in-process (e.g. the malicious companion app / crafted intent is emulated inside the screen), so you only need to craft them to reproduce the exploit on a real device:
account switch sequence
Real-world references
Concrete public disclosures that match this vulnerability class: