Daily iOS
Security

Biometric authentication

This code sets isUnlocked = true when Face ID succeeds and opens the transfer screen. What's the security weakness in this approach?

let ctx = LAContext()
ctx.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics,
                   localizedReason: "Confirm transfer") { ok, _ in
    if ok { self.isUnlocked = true }
}
How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Success is one Bool in app memory, so a runtime hook or repackaging turns it true without any authentication, and the result guards a gate that protects no secret.

Share a question