WebView Cleartext / Mixed-Content Transport Downgrade
← Native / WebView Bridge (JS <-> Native)
webview_cleartext_mixed_content_downgrade MEDIUM
| Category | Native / WebView Bridge (JS <-> Native) |
| OWASP Mobile (2024) | M5 |
| MASVS | MASVS-NETWORK-1MASVS-PLATFORM-2 |
| MASWE | MASWE-0026MASWE-0035 |
| MASTG (v2 tests) | iOSNone publishedAndroidMASTG-TEST-0235MASTG-TEST-0237 |
| CWE | CWE-319CWE-311CWE-829 |
| Platform | AndroidiOS |
Description
A WebView opts out of cleartext blocking (android:usesCleartextTraffic / relaxed network-security-config) and relaxes the Mixed Content Policy (setMixedContentMode(MIXED_CONTENT_ALWAYS_ALLOW)), then loads HTTP or mixed content, so a network attacker injects script / downgrades HTTPS->HTTP and escalates to phishing or full app takeover - a WebView-transport failure distinct from app-level cleartext and from WebView XSS (USENIX Security 2026 large-scale HTTP-in-WebView study).
How it works
The WebView opts out of cleartext blocking (usesCleartextTraffic / relaxed network-security-config) and relaxes mixed content (setMixedContentMode(MIXED_CONTENT_ALWAYS_ALLOW)), then loads an http:// page (or an http:// subresource on an https page). A network attacker on the path downgrades HTTPS->HTTP and injects a script that runs in the WebView and exfiltrates the session token (USENIX Security 2026 HTTP-in-WebView study class). This loads a real http:// page in a real WebView with mixed content allowed (the in-memory panel is the offline contrast). The secure path blocks cleartext and sets mixed-content to BLOCK so the http load / mixed subresource is refused.
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:mitmproxy,Burp Suite,Wireshark,testssl.sh· Android:jadx. - Locate the target. From the home index, open WebView Cleartext / Mixed-Content Transport Downgrade (
webview_cleartext_mixed_content_downgrade). 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.
- Map it back. Cross-reference the MASTG v2 test(s) MASTG-TEST-0235, MASTG-TEST-0237 for the canonical procedure and remediation.
Tools (optional)
Android
Real-world references
Concrete public disclosures that match this vulnerability class: