CVE-2023-35658 Overview
CVE-2023-35658 is a use after free vulnerability in the Android Bluetooth stack, specifically within the gatt_process_prep_write_rsp function of gatt_cl.cc. This memory corruption flaw enables privilege escalation and could lead to remote code execution from an adjacent network position without requiring any user interaction or additional execution privileges.
Critical Impact
This vulnerability allows attackers within Bluetooth range to achieve remote code execution on affected Android devices without user interaction, potentially leading to complete device compromise.
Affected Products
- Google Android 11.0
- Google Android 12.0
- Google Android 12.1
- Google Android 13.0
Discovery Timeline
- 2023-09-11 - CVE-2023-35658 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2023-35658
Vulnerability Analysis
This vulnerability exists in the Generic Attribute Profile (GATT) client implementation within Android's Bluetooth stack. The gatt_process_prep_write_rsp function in gatt_cl.cc contains a use after free condition that occurs during the processing of prepared write responses. When a malformed or specially crafted GATT response is received, the function may attempt to access memory that has already been freed, leading to memory corruption.
The vulnerability is particularly dangerous because it can be exploited from an adjacent network position (within Bluetooth range) without requiring any privileges on the target system and without needing user interaction. Successful exploitation grants the attacker the ability to execute arbitrary code in the context of the Bluetooth process, which can then be leveraged for further privilege escalation.
Root Cause
The root cause is a CWE-416 (Use After Free) memory safety issue in the GATT client code. The vulnerability occurs when the gatt_process_prep_write_rsp function fails to properly manage memory lifecycle during the handling of prepared write responses. After certain memory is freed during the response processing workflow, subsequent code paths may still reference this deallocated memory, creating a classic use after free condition that can be exploited to achieve code execution.
Attack Vector
The attack vector is via Adjacent Network, meaning an attacker must be within Bluetooth communication range of the target device. The exploitation flow involves:
- The attacker establishes a Bluetooth connection with the target Android device
- A malicious GATT server sends specially crafted prepared write responses
- The vulnerable gatt_process_prep_write_rsp function processes these responses
- The use after free condition is triggered, allowing memory corruption
- The attacker gains code execution within the Bluetooth process context
Since no user interaction is required and no additional execution privileges are needed, this vulnerability presents a significant risk in environments where Android devices may be exposed to untrusted Bluetooth connections.
Detection Methods for CVE-2023-35658
Indicators of Compromise
- Unexpected Bluetooth service crashes or restarts on Android devices
- Anomalous Bluetooth GATT traffic patterns from unrecognized devices
- System log entries indicating memory corruption in the Bluetooth stack
- Unusual processes spawned from the Bluetooth service context
Detection Strategies
- Monitor Android system logs for Bluetooth-related segmentation faults or memory errors
- Implement network-level Bluetooth traffic analysis for anomalous GATT responses
- Deploy endpoint detection solutions capable of monitoring Bluetooth stack behavior
- Review crash reports for patterns indicating exploitation attempts against gatt_cl.cc
Monitoring Recommendations
- Enable detailed Bluetooth debugging logs on high-value Android devices
- Implement Bluetooth connection monitoring to track unexpected device pairings
- Configure alerts for repeated Bluetooth service restarts within short timeframes
- Monitor for privilege escalation attempts following Bluetooth activity
How to Mitigate CVE-2023-35658
Immediate Actions Required
- Update all affected Android devices to the September 2023 security patch level or later
- Disable Bluetooth on devices that cannot be immediately patched when not actively needed
- Restrict Bluetooth discoverable mode to reduce attack surface
- Implement mobile device management (MDM) policies to enforce security patch compliance
Patch Information
Google has released a security patch for this vulnerability as part of the Android Security Bulletin September 2023. The fix is available in the Android Bluetooth Module Update. Organizations should ensure all Android devices running versions 11.0 through 13.0 are updated to the September 2023 security patch level (2023-09-01 or later).
Workarounds
- Disable Bluetooth functionality on devices that cannot be patched immediately
- Limit Bluetooth use to trusted environments where unknown devices cannot establish connections
- Configure devices to reject pairing requests from unknown devices
- Use Bluetooth in non-discoverable mode when connectivity is required
# ADB commands to disable Bluetooth on unpatched devices
adb shell settings put global bluetooth_on 0
adb shell svc bluetooth disable
# Verify current Android security patch level
adb shell getprop ro.build.version.security_patch
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

