Overview

This test checks if the app configures cryptographic keys with an extended validity duration that allows keys to remain unlocked beyond the immediate operation. When using biometric authentication with CryptoObject, the authentication validity duration determines how long a key remains usable after successful authentication.

On Android, developers can configure this behavior using setUserAuthenticationParameters(int timeout, int type)) or the deprecated setUserAuthenticationValidityDurationSeconds(int)) when generating keys with KeyGenParameterSpec.Builder:

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 include a list of locations where the relevant APIs are used.

Evaluation

The test case fails if the app configures keys used for sensitive operations with:

Note

A non-zero authentication validity duration is not inherently a vulnerability. Short durations in the range of seconds may be acceptable for certain use cases where multiple related operations need to be performed in quick succession. However, for high-security applications and sensitive operations, requiring authentication per use (duration = 0) provides the strongest protection against unauthorized key usage and runtime attacks.

Lingitud teemad