Sensitive Data in Logs
sensitive_data_in_logs EASY
| Category | Insecure Data Storage |
| OWASP Mobile (2024) | M9 |
| MASVS | MASVS-STORAGE-2 |
| MASWE | MASWE-0005 |
| MASTG (v2 tests) | iOSMASTG-TEST-0296MASTG-TEST-0297AndroidMASTG-TEST-0203MASTG-TEST-0231 |
| MASTG demos | iOSMASTG-DEMO-0065AndroidMASTG-DEMO-0006 |
| CWE | CWE-532 |
| Platform | AndroidiOS |
Description
PII, tokens, and passwords printed to system logs.
How it works
The login handler writes the username, plaintext password, and auth token straight to the system log (Logcat on Android, the unified log on iOS). This emits a log line that anyone with the system-log reader (adb logcat on Android, idevicesyslog/Console on iOS) can harvest with zero effort.
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 Data Storage 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: Android:adb logcat· iOS:idevicesyslog,Console.app. - Locate the target. From the home index, open Sensitive Data in Logs (
sensitive_data_in_logs). 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. Exercise the flow that persists data, then inspect on-device storage (
adb shell run-as <pkg>/ pull the app sandbox, orobjection’sandroid keystore/ios nsuserdefaultshelpers) and confirm the sensitive value is present in cleartext or without hardware backing. - 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.
- Map it back. Cross-reference the MASTG v2 test(s) MASTG-TEST-0203, MASTG-TEST-0231, MASTG-TEST-0296, MASTG-TEST-0297 for the canonical procedure and remediation.
Tools (optional)
Android
iOS