CVE-2023-21102 Overview
CVE-2023-21102 is a local privilege escalation vulnerability in the Android kernel's EFI runtime wrapper (__efi_rt_asm_wrapper in efi-rt-wrapper.S). The vulnerability exists due to a logic error that allows bypassing shadow stack protection, a critical security mechanism designed to prevent return-oriented programming (ROP) attacks. Successful exploitation enables local attackers to escalate privileges without requiring additional execution privileges or user interaction.
Critical Impact
Local privilege escalation via shadow stack protection bypass in Android kernel EFI runtime services, requiring no user interaction for exploitation.
Affected Products
- Google Android (kernel component)
- Android devices using vulnerable kernel versions
- Systems with EFI runtime wrapper implementations
Discovery Timeline
- 2023-05-15 - CVE-2023-21102 published to NVD
- 2025-01-24 - Last updated in NVD database
Technical Details for CVE-2023-21102
Vulnerability Analysis
This vulnerability is classified under CWE-754 (Improper Check for Unusual or Exceptional Conditions), indicating that the affected code fails to properly validate or handle specific runtime conditions. The flaw resides in the __efi_rt_asm_wrapper function within efi-rt-wrapper.S, which is responsible for wrapping EFI (Extensible Firmware Interface) runtime service calls in the Android kernel.
Shadow stack protection is a hardware-assisted security feature that maintains a separate "shadow" copy of return addresses to detect and prevent stack-based exploitation techniques. When a function returns, the processor compares the return address on the regular stack with the one stored in the shadow stack. If they differ, execution is halted to prevent potential exploitation.
The logic error in this wrapper function creates a condition where shadow stack verification can be circumvented, effectively neutralizing this protection mechanism. This is particularly concerning as shadow stack is considered a critical defense-in-depth measure against advanced exploitation techniques.
Root Cause
The root cause is a logic error in the EFI runtime assembly wrapper code that improperly handles shadow stack state during EFI runtime service transitions. When the kernel invokes EFI runtime services, the wrapper must correctly manage the shadow stack to maintain security invariants. The flawed implementation contains a code path that fails to properly preserve or restore shadow stack state, creating a window where an attacker can manipulate return addresses without triggering the shadow stack protection mechanism.
Attack Vector
The attack vector is local, requiring an attacker to have existing code execution capability on the target Android device. The exploitation path involves:
- Triggering specific EFI runtime service calls through legitimate kernel interfaces
- Exploiting the timing or state of the vulnerable wrapper function
- Manipulating stack contents during the window when shadow stack protection is ineffective
- Redirecting execution flow to achieve privilege escalation
The vulnerability does not require any additional execution privileges beyond what a normal application possesses, and no user interaction is necessary, making it particularly dangerous for devices where applications may have limited initial permissions.
The vulnerability manifests in the assembly wrapper function that handles EFI runtime service calls. The logic error occurs in how the wrapper manages shadow stack state during transitions between kernel and EFI runtime contexts. For technical implementation details, refer to the Android Security Bulletin May 2023.
Detection Methods for CVE-2023-21102
Indicators of Compromise
- Unusual EFI runtime service invocations from user-space applications
- Unexpected kernel crash patterns related to stack validation failures
- Anomalous process privilege changes without corresponding authorization events
- Suspicious activity in kernel logs related to efi-rt-wrapper or shadow stack exceptions
Detection Strategies
- Monitor kernel logs for shadow stack violation alerts that were unexpectedly bypassed
- Implement kernel integrity monitoring to detect unauthorized privilege changes
- Deploy endpoint detection solutions capable of monitoring EFI runtime service interactions
- Utilize SentinelOne's behavioral AI to detect anomalous privilege escalation patterns
Monitoring Recommendations
- Enable detailed kernel auditing for EFI runtime service calls
- Configure alerting for any processes gaining elevated privileges unexpectedly
- Monitor for kernel module loading or memory manipulation attempts
- Review Android security patch levels across managed device fleet
How to Mitigate CVE-2023-21102
Immediate Actions Required
- Apply the Android security patches from the May 2023 Security Bulletin immediately
- Audit all managed Android devices for current security patch levels
- Prioritize patching for devices in high-security environments
- Implement additional access controls to limit local code execution where possible
Patch Information
Google addressed this vulnerability in the Android Security Bulletin May 2023. The fix corrects the logic error in the __efi_rt_asm_wrapper function to properly maintain shadow stack protection during EFI runtime service calls. Organizations should ensure all Android devices are updated to security patch levels dated 2023-05-01 or later.
The vulnerability is tracked internally by Google as Android ID: A-260821414, with references to upstream kernel patches that address the underlying issue.
Workarounds
- Restrict installation of untrusted applications that could serve as initial exploitation vectors
- Implement application allowlisting where feasible to reduce attack surface
- Enable additional kernel hardening options if available on specific device implementations
- Consider network segmentation for devices that cannot be immediately patched
# Check Android security patch level
adb shell getprop ro.build.version.security_patch
# Verify current kernel version
adb shell uname -r
# Review device for security patch compliance (example)
# Ensure output shows 2023-05-01 or later
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


