Security gateways have become a key component in modern vehicle electronic architectures, acting as a protective layer between external diagnostic tools and the vehicle’s internal networks. Their primary purpose is to prevent unauthorized access to critical functions such as ECU programming, actuator activation, and configuration changes. In vehicles that use UDS (Unified Diagnostic Services), access to protected functions typically requires establishing a diagnostic session and completing a security authentication process known as Security Access (Service 0x27).
For example, a diagnostic tool may request security access by sending the following CAN frame:
ID: 0x7E0
DATA: 02 27 01 00 00 00 00 00
where 27 represents the Security Access service and 01 indicates a Seed Request. The ECU may respond with:
ID: 0x7E8
DATA: 06 67 01 12 34 56 78 00
In this response, 67 is the positive response to service 27, 01 identifies the requested security level, and 12 34 56 78 is the seed generated by the ECU. The diagnostic tool then calculates a Key using a manufacturer-specific algorithm and sends it back:
ID: 0x7E0
DATA: 06 27 02 AB CD EF 12 00
If the key is correct, the ECU responds:
ID: 0x7E8
DATA: 02 67 02 00 00 00 00 00
At this point, the gateway grants access to protected functions. If the key is incorrect, the ECU may return a negative response:
ID: 0x7E8
DATA: 03 7F 27 35 00 00 00 00
where 35 means Invalid Key.
Another common example is switching to an extended diagnostic session before requesting security access:
ID: 0x7E0
DATA: 02 10 03 00 00 00 00 00
Response:
ID: 0x7E8
DATA: 06 50 03 00 32 01 F4 00
Once the extended session has been established, the gateway allows the authentication process to continue. In newer vehicles from manufacturers such as Mercedes-Benz, Volkswagen, BMW, and Stellantis, security gateways may implement additional authentication mechanisms using digital certificates and cloud-based authorization systems, commonly referred to as Secure Gateway (SGW). Analyzing these communication frames helps engineers and technicians understand how modern vehicles protect their electronic systems and how automotive cybersecurity continues to evolve against emerging threats.