Overview

This test evaluates whether an Android app implements a HostnameVerifier that uses verify(...)) in an unsafe manner, effectively turning off hostname validation for the affected connections.

Such unsafe implementations can allow an attacker to run a [MITM attack](../../../Document/0x04f-Testing-Network-Communication.md#intercepting-network-traffic-through-mitm) with a valid (or self-signed) certificate and intercept or tamper with the app's traffic.

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 HostnameVerifier is used.

Evaluation

The test case fails if the app does not properly validate that the server's hostname matches the certificate.

Further Validation Required:

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