Shared WebView Mini-App Isolation Failure (Cross-Tenant Cookies)
← Native / WebView Bridge (JS <-> Native)
shared_webview_miniapp_isolation HARD
| Category | Native / WebView Bridge (JS <-> Native) |
| OWASP Mobile (2024) | M4 |
| MASVS | MASVS-PLATFORM-2MASVS-STORAGE-2 |
| MASWE | MASWE-0034 |
| CWE | CWE-346CWE-668CWE-200 |
| Platform | AndroidiOS |
Description
A super-app hosts multiple mini-programs in ONE shared WebView instance (shared cookie jar / localStorage), so one mini-app reads another mini-app’s cookies and storage - a cross-tenant isolation failure enabling data exfiltration between mini-apps (WeChat/Alipay/TikTok/Baidu cross-mini-program cookie-sharing research).
How it works
A super-app hosts multiple mini-programs in one shared WebView instance with a single shared cookie jar / localStorage keyed loosely, so mini-app A reads mini-app B’s cookies and storage, a cross-tenant isolation failure enabling data exfiltration between mini-apps (WeChat / Alipay / TikTok / Baidu cross-mini-program cookie-sharing research). This loads two mini-apps in one real shared WebView so mini-app A reads B’s cookie/storage from the shared jar (the in-memory panel is the offline contrast). The secure path partitions storage per mini-app origin, so A cannot see B’s cookie while B still reads its own.
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 Native / WebView Bridge (JS <-> Native) 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:r2frida,frida,objection,sqlite3· Android:jadx,adb· iOS:ipsw,ifuse. - Locate the target. From the home index, open Shared WebView Mini-App Isolation Failure (Cross-Tenant Cookies) (
shared_webview_miniapp_isolation). 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. Reach the JS<->native bridge (or the framework/plugin API) from untrusted web content / a cross-origin iframe / a malicious provider, and confirm the privileged native call fires with no main-frame/origin, callback-id, or permission gate in between.
- 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
Real-world references
Concrete public disclosures that match this vulnerability class: