All android 8+ devices that are licensed for Google apps are mandated to provision Trusted Execution Environment (TEE). In Samsung devices, Knox is a discrete EAL 6+ TEE chip mounted on the SoC. It stores cryptographic secrets and fingerprint data in encrypted form inside its isolated storage. Similarly, in Google Pixel, this discrete TEE chip Is called Titan M. Lower end Samsung Exynos and Qualcomm Snapdragon SoCs are also equipped with integrated TEE.
Android interacts with TEE using Keymaster Hardware Abstraction Layer (HAL) which is a stable userspace ABI that communicates with TEE. HALs are implemented by the vendor and are part of android specification so they are natively supported by all android 8+ devices.
Apps use BiometricManager API to support fingerprint authentication natively. BiometricManager communicates with FingerprintService
which is a system service that handles communication with Biometric HAL which communicates with the fingerprint sensor driver inside TEE. Fingerprint sensor communicates directly with the sensor driver through Serial Peripheral Interface (SPI) channel so even android cannot read fingerprint data during transit or even if the root access is acquired on the OS. The driver then computes the fingerprint data and TEE verifies if enough of the mathematically drivedderived values match with the enrolled fingerprint data.
TEE only replies with success or failure response and lets the app know about authentication result through system keystore service
. Based on the result, password managers can request TEE to decrypt the master key only if user authentication succeeds. This is how it's done in practice, fingerprint authentication is usually cryptographically bound to some key (or session token) that needs to be decrypted by TEE only after successful user authentication.
Using memory corruption to fake the authentication result for the calling app will not decrypt the master key. TEE refuses decryption if the master key which is bound to user authentication and requires successful user authenticationto authenticate. If the password manager is compromised, that still won't be enough for the attacker to access the master key. It is also possible for apps to verify if the TEE itself is not fraudulent by using hardware-backed key attestation.
It may look secure but fingerprints can be accurately copied and if the clone is accurate enough, the attacker will be able to succeed authentication under 3 attempts without compromising the device.