CVE-2024-31317

7.8 HIGH

📋 TL;DR

This vulnerability allows local privilege escalation on Android devices through unsafe deserialization in ZygoteProcess.java. An attacker with WRITE_SECURE_SETTINGS permission can execute arbitrary code as any app, potentially gaining elevated privileges. All Android users with affected versions are vulnerable.

💻 Affected Systems

Products:
  • Android OS
Versions: Android versions prior to June 2024 security patch
Operating Systems: Android
Default Config Vulnerable: ⚠️ Yes
Notes: Requires WRITE_SECURE_SETTINGS permission which is typically restricted to system apps, but can be obtained through other vulnerabilities or on rooted devices.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete device compromise allowing attacker to install persistent malware, access sensitive data, and control device functions.

🟠

Likely Case

Local attacker gains elevated privileges to access other apps' data or install malicious applications.

🟢

If Mitigated

Attack limited to sandboxed environment with minimal impact due to proper app isolation.

🌐 Internet-Facing: LOW - This is a local privilege escalation requiring physical or local access to the device.
🏢 Internal Only: HIGH - Malicious apps or users with local access can exploit this to escalate privileges.

🎯 Exploit Status

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

Exploitation requires local access and WRITE_SECURE_SETTINGS permission. No user interaction needed once initial access is obtained.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: June 2024 Android Security Patch

Vendor Advisory: https://source.android.com/security/bulletin/2024-06-01

Restart Required: Yes

Instructions:

1. Check for system updates in Settings > System > System update. 2. Install June 2024 Android security patch. 3. Reboot device after installation.

🔧 Temporary Workarounds

Restrict WRITE_SECURE_SETTINGS permission

android

Limit which apps have WRITE_SECURE_SETTINGS permission through device policy or app permissions management.

🧯 If You Can't Patch

  • Implement strict app vetting process to prevent malicious apps from obtaining WRITE_SECURE_SETTINGS permission
  • Use mobile device management (MDM) solutions to enforce security policies and monitor for suspicious activity

🔍 How to Verify

Check if Vulnerable:

Check Android security patch level in Settings > About phone > Android version. If patch level is before June 2024, device is vulnerable.

Check Version:

adb shell getprop ro.build.version.security_patch

Verify Fix Applied:

Verify security patch level shows 'June 5, 2024' or later in Settings > About phone > Android version.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Zygote process activity
  • Multiple app launches with elevated permissions
  • WRITE_SECURE_SETTINGS permission abuse logs

Network Indicators:

  • Unusual network traffic from system processes
  • Suspicious app installation traffic

SIEM Query:

process_name:zygote AND (permission:WRITE_SECURE_SETTINGS OR privilege_escalation:true)

🔗 References

📤 Share & Export