Android platform checks

Android WebView security testing

A WebView puts a browser inside the app, with access to app data and code. The risk depends on what content it loads and what that content is allowed to reach.

Why WebViews need their own review

Apps use WebView to show help pages, checkout flows, login forms and entire hybrid screens. Unlike a browser, the WebView runs inside the app process and can be given access to app files and to Java or Kotlin objects through a JavaScript bridge.

If an attacker can influence the content a WebView loads, those extra capabilities become the attack surface. These checks belong to MASVS-PLATFORM.

Settings to inventory

WebView settings and what they change
Setting or APIWhy it matters
setJavaScriptEnabled(true)Required by most web content. It becomes a risk together with untrusted content or a bridge.
addJavascriptInterfaceExposes annotated app methods to every page loaded in that WebView, including third-party or injected pages.
setAllowFileAccess, setAllowFileAccessFromFileURLs, setAllowUniversalAccessFromFileURLsControl whether loaded content can read local files and other origins. The defaults have become stricter over Android versions; record the effective value for the target SDK.
onReceivedSslError calling proceed()Accepts invalid certificates, which removes TLS protection for that WebView.
setWebContentsDebuggingEnabled(true)Allows remote debugging of the WebView; it should not be enabled in release builds.

See the Android WebView guide and the security risks documentation for the current defaults.

Follow where the URL comes from

The most important question is who controls the loaded URL. Trace each loadUrl and loadData call back to its source. A hardcoded HTTPS URL to the app owner's domain is low risk. A URL taken from an intent extra, a deep link parameter or a server response without validation is a signal worth testing.

Check shouldOverrideUrlLoading: does the app restrict navigation to an allowlist of hosts, and does the check compare the parsed host rather than a substring of the URL? A check such as url.contains("example.com") also matches attacker.test/?example.com.

Runtime check

On an authorized test device, reach the WebView through its normal entry point and through any exported activity or deep link that leads to it. If a URL can be supplied from outside, try loading a page you control on a test domain and observe whether it opens inside the app.

If it does and the WebView has a JavaScript bridge, record which bridge methods the page can call and what they return or do. For certificate handling, route traffic through an intercepting proxy with an untrusted certificate and check whether the WebView still loads the page. Use test accounts only; never point a bridge at production data.

Example: a deep link that opens any URL

Suppose a manifest exports an activity with an intent filter for myapp://open, and the code passes the url query parameter straight to loadUrl in a WebView that exposes a bridge returning the session token.

The configuration alone is a candidate. In an authorized session, opening myapp://open?url=https://test-page.example from another test app and observing the page read the token through the bridge is observed evidence. If the app rejects hosts outside its allowlist, record the check as performed with no bypass observed.

This example describes an assessment method, not a finding measured by AppBreach on a customer app.

Report it with the evidence

Include the WebView location in the code, the effective settings, the URL source, the bridge methods exposed and the observed result. Recommend loading only trusted HTTPS content, validating hosts with a parsed allowlist, exposing the smallest possible bridge and never overriding certificate errors.

The deep links guide covers the most common way untrusted URLs reach a WebView. Use the report evidence guide to structure the finding.

Related reading