This flow does the protected work first and only shows a biometric prompt if the attempt happens to throw. When nothing throws, nobody is asked anything.
What goes wrong
The control flow is backwards. The protected action is attempted immediately, using a freshly created handle, before any prompt appears. Authentication is wired up as the exception path: if the operation throws the specific error an auth-required key raises, only then does the biometric prompt come up.
That makes the whole guarantee depend on the key throwing. If the key was configured without the authentication requirement, or the operation does not exercise the key in a way that triggers the check, nothing throws and the action just completes. Auth-by-exception fails open by design. The happy path is the bypass.
The pattern
function runProtected(action) {
try {
action(newCryptoHandle()) // runs before any prompt
} catch (e) {
if (isAuthChallenge(e)) showPromptThen(action) // auth only here
else throw e
}
}function runProtected(action) {
showAuthPrompt({
onSuccess: result => action(result.cryptoHandle), // bound handle
onFailure: () => deny()
})
// never attempt the action before the prompt resolves
}Grounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.
Why it matters to you
Fail-open authentication is the worst kind, because everything looks fine in testing. The demo works, the prompt shows up when the key is configured the way the developer expected, and the one misconfigured key or exception-free operation quietly skips it in production.
Authentication should gate the action, not clean up after it. Show the prompt, wait for a bound success, then act. If the order is reversed, assume the check can be skipped.
Check your own code
- Look for protected operations attempted before the auth prompt is shown.
- Reject any design where authentication runs only in a catch block.
- Confirm the key itself enforces authentication, so a config slip cannot open the gate.
- Test with a key that does not throw and assert the action is still blocked.