WebView Safe Browsing Disabled
← Native / WebView Bridge (JS <-> Native)
webview_safe_browsing_disabled EASY
| Category | Native / WebView Bridge (JS <-> Native) |
| OWASP Mobile (2024) | M8 |
| MASVS | MASVS-PLATFORM-2 |
| MASWE | MASWE-0035 |
| MASTG (v2 tests) | iOSNoneAndroidMASTG-TEST-0399 |
| MASTG demos | iOSNoneAndroidMASTG-DEMO-0156 |
| CWE | CWE-1188CWE-693CWE-829 |
| Platform | Android |
Description
The WebView disables Google Safe Browsing (android:usesCleartextTraffic aside, EnableSafeBrowsing=false / setSafeBrowsingEnabled(false)), stripping the browser-originated malware/phishing protection, so attacker-controlled navigation to a known-bad URL is loaded with no warning. Distinct from XSS: the app deliberately removes a platform protection from its embedded browser (Android WebView MASTG-TEST-0399 class).
How it works
The WebView turns off Google Safe Browsing (setSafeBrowsingEnabled(false) / manifest EnableSafeBrowsing=false), stripping the browser-originated malware/phishing protection that normally shows a full-page interstitial before a known-bad navigation. With it disabled, the app silently loads a known phishing/malware URL with no warning. This is not XSS; it is a deliberately removed platform protection (Android WebView MASTG-TEST-0399 class). This navigates a real WebView to the known-bad URL (the in-memory panel is the offline contrast). The secure path keeps Safe Browsing on, blocks known-bad hosts with an interstitial, and still allows benign URLs.
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 Android emulator you control. The demo needs no external tooling; for the optional on-device reproduction the relevant tools are:jadx,apktool. - Locate the target. From the home index, open WebView Safe Browsing Disabled (
webview_safe_browsing_disabled). 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-0399 for the canonical procedure and remediation.
Tools (optional)
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:
phishing/malware URL
Real-world references
Concrete public disclosures that match this vulnerability class: