Overview

This test checks for references to WebViewClient URL interception methods that override the default page navigation behavior in WebViews. The default and safest behavior on Android is to let the default web browser open any link that the user clicks inside the WebView. However, this can be modified by configuring a WebViewClient with custom URL handling logic.

The following interception callback methods are relevant:

If these methods are implemented without proper URL validation, the app may load content from untrusted sources or navigate users to malicious websites.

See MASTG-KNOW-0018 for more information on URL loading in WebViews.

Steps

  1. Use MASTG-TECH-0013 to reverse engineer the app.
  2. Use MASTG-TECH-0014 to look for the relevant APIs.

Observation

The output should contain a list of locations where WebViewClient URL loading handlers are used, including:

Evaluation

The test case fails if a WebViewClient URL interception method is implemented without properly restricting navigation to trusted content.

Further Validation Required:

Inspect each reported code location using MASTG-TECH-0023, looking for cases such as:

Note that using a WebViewClient is not inherently insecure. The test fails only when the URL handling logic does not properly restrict navigation to trusted content.