Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-31327 Overview
CVE-2024-31327 is a race condition vulnerability in Android's MessageQueueBase.h that enables an out-of-bounds write. The flaw affects multiple functions in the Fast Message Queue (FMQ) library and can be triggered locally by an attacker with low privileges. Successful exploitation leads to local privilege escalation without any user interaction. The vulnerability is tracked under [CWE-362] (concurrent execution using shared resource with improper synchronization) and was addressed in the Android Security Bulletin for June 2024.
Critical Impact
Local attackers can achieve privilege escalation on affected Android devices by racing concurrent operations in the shared memory queue implementation, with no additional execution privileges or user interaction required.
Affected Products
- Google Android 12.0
- Google Android 12.1
- Google Android 13.0
- Google Android 14.0
Discovery Timeline
- 2024-07-09 - CVE-2024-31327 published to the National Vulnerability Database (NVD)
- 2024-06-01 - Google releases fix in the Android Security Bulletin for June 2024
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-31327
Vulnerability Analysis
The vulnerability resides in MessageQueueBase.h, a header file in the Android Fast Message Queue (FMQ) library at platform/system/libfmq. FMQ provides a lock-free shared-memory ring buffer used for high-throughput inter-process communication between Android system services and Hardware Abstraction Layer (HAL) components.
Multiple functions in MessageQueueBase.h perform bounds calculations and buffer writes without adequate synchronization between concurrent producers or consumers. An attacker running a local, unprivileged process that shares a queue with a higher-privileged process can race these operations to force a write past the allocated buffer.
The out-of-bounds write corrupts memory in the context of the privileged process consuming the queue, enabling local privilege escalation. Technical details of the fix are available in the Google source code update.
Root Cause
The root cause is a time-of-check to time-of-use (TOCTOU) condition in the FMQ read and write paths. Index and length values read from shared memory are validated once but can be mutated by a concurrent thread before they are used in the subsequent memory copy, breaking the bounds invariant.
Attack Vector
Exploitation requires local code execution on the device with low privileges, such as from an installed application. The attacker opens or shares an FMQ instance with a privileged process and repeatedly manipulates the shared read or write pointers while the victim process operates on the queue. No user interaction is required.
No public proof-of-concept exploit code is available for this issue, and it is not listed in the CISA Known Exploited Vulnerabilities catalog.
Detection Methods for CVE-2024-31327
Indicators of Compromise
- Unexpected crashes or SIGSEGV signals in Android system services or vendor HAL processes that consume FMQ queues.
- Tombstone files under /data/tombstones/ referencing libfmq or MessageQueueBase frames.
- Processes with unusual privilege transitions originating from unprivileged UIDs that recently interacted with HAL services.
Detection Strategies
- Enumerate installed Android build fingerprints across the fleet and flag devices with a security patch level earlier than 2024-06-01.
- Monitor Mobile Device Management (MDM) and Enterprise Mobility Management (EMM) telemetry for devices running Android 12 through 14 without the June 2024 patch.
- Review application behavior for processes that repeatedly open HAL interfaces or FMQ descriptors at high frequency, which is uncommon for benign apps.
Monitoring Recommendations
- Ingest Android security patch level data into your security data lake and alert on devices that fall behind the June 2024 baseline.
- Correlate crash reports from Android system services with application install events to identify potential exploitation attempts.
- Track vendor security bulletins from device OEMs to confirm downstream delivery of the Android Open Source Project (AOSP) patch.
How to Mitigate CVE-2024-31327
Immediate Actions Required
- Apply the Android security patch level 2024-06-01 or later to all affected devices running Android 12, 12.1, 13, or 14.
- Prioritize patching for devices used by privileged users, administrators, and developers with access to sensitive corporate data.
- Restrict sideloading and enforce installation only from vetted application sources through MDM policy.
Patch Information
Google addressed CVE-2024-31327 in the Android Security Bulletin June 2024. The upstream fix for the libfmq library is published as commit 79bbf4aeef4b254c52da670a972e22956c8c659d in the AOSP source tree. Device manufacturers integrate the patch into their vendor builds, so end users must install the OEM update that advertises a security patch level of 2024-06-01 or later.
Workarounds
- No vendor-supplied workaround exists; patching is the only supported remediation.
- Reduce the local attack surface by uninstalling untrusted applications and limiting the number of apps granted sensitive runtime permissions.
- For managed deployments, enforce an MDM compliance policy that quarantines devices without the June 2024 or later Android security patch level.
# Verify the Android security patch level on a connected device
adb shell getprop ro.build.version.security_patch
# Expected output for remediated devices: 2024-06-01 or later
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

