Android authentication

Android biometric authentication security testing

A fingerprint prompt looks the same whether it protects a key or just shows a success callback. The difference decides whether it can be bypassed.

Event-bound versus crypto-bound

In an event-bound implementation, the app shows BiometricPrompt and trusts the onAuthenticationSucceeded callback. On a device the attacker controls, that callback can be triggered with an instrumentation tool, so the prompt is a convenience, not a security control.

In a crypto-bound implementation, the app passes a CryptoObject whose Keystore key requires user authentication. The key can only be used after a successful biometric match, so a decrypted token or a signature proves the check happened. Local authentication is covered by MASVS-AUTH.

Static check

What to look for in the code
AreaWhat to check
PromptWhether authenticate is called with a CryptoObject or without one.
Key generationsetUserAuthenticationRequired(true) on the key, and the authentication parameters or validity duration.
Enrollment changesWhether setInvalidatedByBiometricEnrollment has been set to false, which keeps keys valid after a new fingerprint is added.
Authenticator classBIOMETRIC_STRONG is required for crypto-bound use; BIOMETRIC_WEAK or device credential fallbacks change the threat model.
What is unlockedWhether the key protects a real secret, such as a refresh token, or just a local flag.

Runtime check

On a rooted test device, try to trigger the success callback without a matching biometric using an instrumentation framework such as Frida. If the app proceeds to an authenticated state, the check is event-bound. Then add a new fingerprint in system settings and check whether biometric login still works without the password; it should not when keys are invalidated on enrollment.

Rooted-device bypasses are expected for event-bound checks. The useful finding is what the bypass unlocks.

Fix and report

Use a crypto-bound flow: protect the token or a signing key with a Keystore key that requires biometric authentication, and let the server verify the result where possible. Keep enrollment invalidation on. Report the implementation type, what a bypass unlocked and the device used. Key storage mistakes are covered in the cryptography mistakes guide.

Related reading