Two hardcoded values trigger the biometric prompt. Every other value falls into the else branch, fetches the matching private key, and returns it with no check at all.
What goes wrong
The auth gate was written for the happy path. Someone handled the two key types they expected, wrapped those in a biometric prompt, and let the else branch catch everything else. That else branch still resolves an alias and returns the private key. It just skips the prompt. Pass any third value and you get a key with no authentication.
There's a second problem in the branch that does prompt. The check is a generic "is the user present" prompt, not one bound to the specific key it releases. A successful auth for one operation can be reused to release a different key. Binding the prompt to the exact key is the entire reason the hardware exists.
This is what happens when authorization keys off input values instead of a positive allowlist. The default case should be denial. Here it is release.
The pattern
function getPrivateKey(account):
alias = aliasFor(account)
if (account == "type-a" || account == "type-b"):
if (!biometricOk()): // generic presence prompt
return DENIED
return load(alias)
else:
return load(alias) // no auth at allfunction getPrivateKey(account, request):
if (!isAllowedType(account)):
return REJECTED // deny unknown selectors
alias = aliasFor(account)
if (!callerOwns(alias)):
return FORBIDDEN
// prompt bound to this exact key
key = load(alias, boundBiometric(alias))
if (key == null):
return DENIED
return keyGrounding 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
Returning a private key to the caller is close to the worst outcome a key store can have. Once the key leaves the secure boundary, every signature and decryption it can produce is up for grabs, and rotation is your only recovery. An authorization scheme that protects two named cases and waves the rest through is not protecting anything. Default to deny, then allow only what you can name.
Check your own code
- Find authorization built on if/else over input values and check what the else branch does.
- Confirm the default case is denial, not the protected operation.
- Verify biometric or hardware prompts are bound to the specific key, rather than to general user presence.
- Never let a private key cross the API boundary if you can sign or decrypt inside it instead.