Third-Party SDK Data Leakage

← Insecure Data Storage

third_party_sdk_data_leakage   MEDIUM

CategoryInsecure Data Storage
OWASP Mobile (2024)M9
MASVSMASVS-STORAGE-2MASVS-PRIVACY-1
MASWEMASWE-0069
MASTG (v2 tests)iOSNone publishedAndroidMASTG-TEST-0318MASTG-TEST-0319
MASTG demosiOSNone publishedAndroidMASTG-DEMO-0081
CWECWE-200CWE-359
PlatformAndroidiOS

Description

A stand-in analytics SDK phones home more data than its stated purpose.

How it works

A bundled analytics SDK claims to just count screen views, but every event it sends to its endpoint is enriched with email, ad/device IDs, precise location, installed apps, and contact counts, none of which the feature needs. A pentester sees this in mitmproxy.

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

  1. 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: mitmproxy, Burp Suite, Wireshark, MobSF.
  2. Locate the target. From the home index, open Third-Party SDK Data Leakage (third_party_sdk_data_leakage). The How it works section above describes this module’s specific weakness; the screen states the intended-secure behavior and exposes the vulnerable action.
  3. Exploit. Exercise the flow that persists data, then inspect on-device storage (adb shell run-as <pkg> / pull the app sandbox, or objection’s android keystore/ios nsuserdefaults helpers) and confirm the sensitive value is present in cleartext or without hardware backing.
  4. 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).
  5. 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.
  6. Map it back. Cross-reference the MASTG v2 test(s) MASTG-TEST-0318, MASTG-TEST-0319 for the canonical procedure and remediation.

Tools (optional)