[PR #1026] [MERGED] Invalidate biometric on change #2712

Closed
opened 2025-11-26 23:23:04 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1026
Author: @Hinton
Created: 7/28/2020
Status: Merged
Merged: 8/9/2020
Merged by: @kspearrin

Base: masterHead: feature/invalidate-biometrics


📝 Commits (10+)

  • 599ec12 Initial working version for Android
  • edfcf52 Add a fallback for when upgrading from older app version.
  • 0ec88e5 Ensure biometric validity is re-checked on focus
  • ece776b Only setup biometric integrity key if biometric is turned on.
  • d84a8bf Fix styling according to comments
  • 3a0cb3c Fallback for Android 5.
  • 17f251c Improve comment
  • 8088b60 Add boilerplate for iOS
  • 61357f9 Change BiometricService to public
  • da4a83c Untested iOS implementation.

📊 Changes

12 files changed (+218 additions, -20 deletions)

View changed files

📝 src/Android/Android.csproj (+1 -0)
📝 src/Android/MainApplication.cs (+2 -0)
src/Android/Services/BiometricService.cs (+90 -0)
📝 src/App/Pages/Accounts/LockPage.xaml (+5 -1)
📝 src/App/Pages/Accounts/LockPageViewModel.cs (+19 -2)
📝 src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs (+3 -0)
📝 src/App/Resources/AppResources.en-GB.resx (+20 -17)
📝 src/App/Resources/AppResources.resx (+3 -0)
src/Core/Abstractions/IBiometricService.cs (+10 -0)
src/iOS.Core/Services/BiometricService.cs (+62 -0)
📝 src/iOS.Core/Utilities/iOSCoreHelpers.cs (+2 -0)
📝 src/iOS.Core/iOS.Core.csproj (+1 -0)

📄 Description

This PR implements additional verification to ensure the biometrics on devices has not been modified. This is to prevent potential attack vectors where adding a fingerprint provides access to the vault.

Android Implementation details

It works by creating a private key which requires authenticated to use. By default these keys also sets setInvalidatedByBiometricEnrollment[0] to true, which invalidates all keys whenever the biometrics has changed.

Screenshot

image

iOS Implementation details

On iOS we use the evaluatedPolicyDomainState[1] to store the state of the biometrics during setup, this state is invalidated whenever the biometrics are changed, allowing us to simply compare if the state is the same as before.

[ 0 ] https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder#setInvalidatedByBiometricEnrollment(boolean)
[ 1 ] https://developer.apple.com/documentation/localauthentication/lacontext/1514150-evaluatedpolicydomainstate


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1026 **Author:** [@Hinton](https://github.com/Hinton) **Created:** 7/28/2020 **Status:** ✅ Merged **Merged:** 8/9/2020 **Merged by:** [@kspearrin](https://github.com/kspearrin) **Base:** `master` ← **Head:** `feature/invalidate-biometrics` --- ### 📝 Commits (10+) - [`599ec12`](https://github.com/bitwarden/android/commit/599ec122c7389c4785043352226a19f0503980bc) Initial working version for Android - [`edfcf52`](https://github.com/bitwarden/android/commit/edfcf52f9f4039eb36d0b0f5ccbd0c0477e0885d) Add a fallback for when upgrading from older app version. - [`0ec88e5`](https://github.com/bitwarden/android/commit/0ec88e58fa00fff508f2afa22ca1f8bb45f64991) Ensure biometric validity is re-checked on focus - [`ece776b`](https://github.com/bitwarden/android/commit/ece776bf591dc5af3d8eb1c5d3a06a42023938c2) Only setup biometric integrity key if biometric is turned on. - [`d84a8bf`](https://github.com/bitwarden/android/commit/d84a8bfe9a289b6f44087633fa9c89733137a33e) Fix styling according to comments - [`3a0cb3c`](https://github.com/bitwarden/android/commit/3a0cb3c9d0a31804bfbaeaebd59024a18e93d3ee) Fallback for Android 5. - [`17f251c`](https://github.com/bitwarden/android/commit/17f251c73895faafed404f9cc0e67c4762d64454) Improve comment - [`8088b60`](https://github.com/bitwarden/android/commit/8088b60dee1643c1f14c0c73cbd40c378d695582) Add boilerplate for iOS - [`61357f9`](https://github.com/bitwarden/android/commit/61357f9e275714a9db941ddc4ee8b7a63cf2ec85) Change BiometricService to public - [`da4a83c`](https://github.com/bitwarden/android/commit/da4a83c6aab1f5bb2b302738286a26b54520c288) Untested iOS implementation. ### 📊 Changes **12 files changed** (+218 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Android.csproj` (+1 -0) 📝 `src/Android/MainApplication.cs` (+2 -0) ➕ `src/Android/Services/BiometricService.cs` (+90 -0) 📝 `src/App/Pages/Accounts/LockPage.xaml` (+5 -1) 📝 `src/App/Pages/Accounts/LockPageViewModel.cs` (+19 -2) 📝 `src/App/Pages/Settings/SettingsPage/SettingsPageViewModel.cs` (+3 -0) 📝 `src/App/Resources/AppResources.en-GB.resx` (+20 -17) 📝 `src/App/Resources/AppResources.resx` (+3 -0) ➕ `src/Core/Abstractions/IBiometricService.cs` (+10 -0) ➕ `src/iOS.Core/Services/BiometricService.cs` (+62 -0) 📝 `src/iOS.Core/Utilities/iOSCoreHelpers.cs` (+2 -0) 📝 `src/iOS.Core/iOS.Core.csproj` (+1 -0) </details> ### 📄 Description This PR implements additional verification to ensure the biometrics on devices has not been modified. This is to prevent potential attack vectors where adding a fingerprint provides access to the vault. ### Android Implementation details It works by creating a private key which requires authenticated to use. By default these keys also sets `setInvalidatedByBiometricEnrollment`[0] to true, which invalidates all keys whenever the biometrics has changed. <details> <summary>Screenshot</summary> ![image](https://user-images.githubusercontent.com/137855/89683053-15f3a700-d8f8-11ea-8656-198d4d4bfd2a.png) </details> ### iOS Implementation details On iOS we use the `evaluatedPolicyDomainState`[1] to store the state of the biometrics during setup, this state is invalidated whenever the biometrics are changed, allowing us to simply compare if the state is the same as before. [ 0 ] https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder#setInvalidatedByBiometricEnrollment(boolean) [ 1 ] https://developer.apple.com/documentation/localauthentication/lacontext/1514150-evaluatedpolicydomainstate --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:23:04 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#2712