Skip to content

Commit ef12469

Browse files
Apply suggestions from documentation review
Co-authored-by: Sam Browning <[email protected]>
1 parent 9ad05fe commit ef12469

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.qhelp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
<overview>
77
<p>
8-
Biometric authentication such as fingerprint recognition can be used alongside cryptographic keys stored in the Android <code>KeyStore</code> to protect sensitive parts of the application. However,
9-
when a key generated for this purpose has certain parameters set insecurely, it can allow an attacker with physical access to bypass the
10-
authentication check, using application hooking tools such as Frida.
8+
Biometric authentication, such as fingerprint recognition, can be used alongside cryptographic keys stored in the Android <code>KeyStore</code> to protect sensitive parts of the application. However,
9+
when a key generated for this purpose has certain parameters set insecurely, an attacker with physical access can bypass the
10+
authentication check using application hooking tools such as Frida.
1111
</p>
1212
</overview>
1313

@@ -16,9 +16,9 @@ authentication check, using application hooking tools such as Frida.
1616
When generating a key for use with biometric authentication, ensure that the following parameters of <code>KeyGenParameterSpec.Builder</code> are set:
1717
</p>
1818
<ul>
19-
<li><code>setUserAuthenticationRequired</code> should be set to <code>true</code>; otherwise the key can be used without user authentication.</li>
20-
<li><code>setInvalidatedByBiometricEnrollment</code> should be set to <code>true</code> (the default); otherwise an attacker can use the key by enrolling additional biometrics on the device.</li>
21-
<li><code>setUserAuthenticationValidityDurationSeconds</code>, if used, should be set to <code>-1</code>; otherwise non-biometric (less secure) credentials can be used to access the key. <code>setUserAuthenticationParameters</code> is instead recommended to explicitly set both the timeout and the types of credentials that may be used.</li>
19+
<li><code>setUserAuthenticationRequired</code> should be set to <code>true</code>; otherwise, the key can be used without user authentication.</li>
20+
<li><code>setInvalidatedByBiometricEnrollment</code> should be set to <code>true</code> (the default); otherwise, an attacker can use the key by enrolling additional biometrics on the device.</li>
21+
<li><code>setUserAuthenticationValidityDurationSeconds</code>, if used, should be set to <code>-1</code>; otherwise, non-biometric (less secure) credentials can be used to access the key. We recommend using <code>setUserAuthenticationParameters</code> instead to explicitly set both the timeout and the types of credentials that may be used.</li>
2222
</ul>
2323

2424
</recommendation>
@@ -33,10 +33,10 @@ When generating a key for use with biometric authentication, ensure that the fol
3333

3434
<references>
3535
<li>
36-
WithSecure: <a href="https://labs.withsecure.com/publications/how-secure-is-your-android-keystore-authentication">How Secure is your Android Keystore Authentication?</a>
36+
WithSecure: <a href="https://labs.withsecure.com/publications/how-secure-is-your-android-keystore-authentication">How Secure is your Android Keystore Authentication?</a>.
3737
</li>
3838
<li>
39-
Android Developers: <a href="https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder">KeyGenParameterSpec.Builder</a>
39+
Android Developers: <a href="https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder">KeyGenParameterSpec.Builder</a>.
4040
</li>
4141

4242
</references>

java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Insecurely generated keys for local authentication
3-
* @description Keys used for local biometric authentication should be generated with secure parameters.
3+
* @description Generation of keys with insecure parameters for local biometric authentication can allow attackers with physical access to bypass authentication checks.
44
* @kind problem
55
* @problem.severity warning
66
* @security-severity 4.4

0 commit comments

Comments
 (0)