CVE-2021-39741

7.8 HIGH

📋 TL;DR

This vulnerability in Android's Keymaster component allows local attackers to write data beyond allocated memory boundaries due to missing bounds checking. It enables local privilege escalation to System-level access on affected Android devices without requiring user interaction. Only Android 12L devices with Keymaster implementations are affected.

💻 Affected Systems

Products:
  • Android devices with Keymaster implementation
Versions: Android 12L
Operating Systems: Android
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects devices running Android 12L with Keymaster hardware security module; requires System execution privileges for initial access.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete device compromise with System privileges, allowing installation of persistent malware, data theft, and bypassing security controls.

🟠

Likely Case

Local attacker gains System privileges to install malicious apps, modify system files, or access protected data.

🟢

If Mitigated

Attack fails due to patched systems or lack of local access; minimal impact with proper access controls.

🌐 Internet-Facing: LOW - Requires local access to device; not directly exploitable over network.
🏢 Internal Only: MEDIUM - Malicious apps or users with physical/network access could exploit locally.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires System execution privileges for initial access; out-of-bounds write could be leveraged for privilege escalation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Android Security Bulletin March 2022 or later

Vendor Advisory: https://source.android.com/security/bulletin/android-12l

Restart Required: Yes

Instructions:

1. Check for Android system updates in Settings > System > System update. 2. Install March 2022 or later security patch. 3. Reboot device after installation.

🔧 Temporary Workarounds

Restrict local access

all

Limit physical and network access to devices to reduce attack surface

Disable unnecessary privileges

android

Review and remove System execution privileges from unnecessary apps

🧯 If You Can't Patch

  • Isolate affected devices from critical networks and data
  • Implement strict app installation policies and monitor for suspicious activity

🔍 How to Verify

Check if Vulnerable:

Check Android version in Settings > About phone > Android version. If it shows Android 12L and security patch level is before March 2022, device is vulnerable.

Check Version:

adb shell getprop ro.build.version.release && adb shell getprop ro.build.version.security_patch

Verify Fix Applied:

Verify Android version is 12L with security patch level March 2022 or later in Settings > About phone.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Keymaster service crashes
  • Privilege escalation attempts in system logs
  • Unexpected System-level process creation

Network Indicators:

  • None - local exploitation only

SIEM Query:

source="android_system" AND (event="keymaster_crash" OR process="escalation_attempt")

🔗 References

📤 Share & Export