SelfLender / react-native-biometrics

React Native module for iOS and Android biometrics
MIT License
665 stars 229 forks source link

Why shouldn’t you use simplePrompt to log in a user? #148

Closed lustig-bakkt closed 2 years ago

lustig-bakkt commented 3 years ago

This below advice is in the README, but I don’t understand why, after validating a user’s biometrics, it isn’t okay to let them into the application.

NOTE: This only validates a user’s biometrics. This should not be used to log a user in** or authenticate with a server, instead use createSignature. It should only be used to gate certain user actions within an app.

re: https://github.com/SelfLender/react-native-biometrics#simplepromptoptions

ronkot commented 3 years ago

@lustig-bakkt This excellent article describes that in detail: https://blog.nviso.eu/2021/04/06/a-closer-look-at-the-security-of-react-native-biometric-libraries/

In short, using just simplePrompt would be implementing "event-based authentication". Depending on your applications security needs it may not be enough. Below a copy-paste from the beforementioned article:

Biometric authentication

Biometric authentication allows the user to authenticate to an application using their biometric data (fingerprint or face recognition). In general, biometric authentication can be implemented in two different ways:

A well-implemented result-based biometric authentication, on the other hand, will not be bypassable with tools such as Frida. To implement a secure result-based biometric authentication, the application must use hardware-backed biometric APIs.