MASWE-0008: Missing Device Secure Lock Verification Implementation
Content in BETA
This content is in beta and still under active development, so it is subject to change any time (e.g. structure, IDs, content, URLs, etc.).
Draft Weakness
This weakness hasn't been created yet and it's in draft. But you can check its status or start working on it yourself. If the issue has not yet been assigned, you can request to be assigned to it and submit a PR with the new content for that weakness by following our guidelines.
Check our GitHub Issues for MASWE-0008
Initial Description or Hints¶
The app may not check for a secure device lock (e.g. device passcode) and may allow for unauthorized access to sensitive data. On iOS enforcing device lock security (i.e., ensuring a passcode is set) has an additional benefit which is that it is tightly coupled with data encryption, assuming the app leverages the correct data protection APIs.
Relevant Topics¶
- user set a device passcode via
isDeviceSecure()
on Android better than only ensuring that the secure screen lock is set viaKeyguardManager.isKeyguardSecure()
- before attempting to authenticate, test to make sure that you actually have the ability to do so by calling the
LAContext.canEvaluatePolicy(_:error:)
method on iOS - to make sure that biometrics can be used, verify that the
kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
or thekSecAttrAccessibleWhenPasscodeSet
protection class is set when theSecAccessControlCreateWithFlags
method is called
References¶
- https://developer.apple.com/documentation/localauthentication/logging_a_user_into_your_app_with_face_id_or_touch_id
- https://grep.app/search?q=isdevicesecure%28&filter[repo][0]=threema-ch/threema-android
- https://developer.android.com/reference/android/hardware/biometrics/BiometricManager#canAuthenticate(int)
MASTG v1 Coverage¶
Tests¶
MASTG-TEST-0248: References to APIs for Detecting Secure Screen Lock MASTG-TEST-0246: Runtime Use of Secure Screen Lock Detection APIs MASTG-TEST-0249: Runtime Use of Secure Screen Lock Detection APIs MASTG-TEST-0247: References to APIs for Detecting Secure Screen Lock