White paper: Root of Trust in the software-defined vehicle

Insights · 2026-06-28

Securing the diagnostic channel: ISO 21434, UN R155 and UDS 0x29

In brief

  1. 01

    UN R155 (CSMS) and R156 (SUMS) are mandatory for new vehicle type approvals in EU/UNECE markets, with R155 applying to all new vehicles since July 2024.

  2. 02

    ISO/SAE 21434:2021 is the engineering standard behind the regulation; its TARA process will flag the diagnostic channel as a high-risk asset.

  3. 03

    The diagnostic channel can flash firmware, unlock functions and read sensitive data, making it a prime attack surface that must be access-controlled.

  4. 04

    UDS 0x27 SecurityAccess relies on seed-key shared secrets, authenticates no session and is one-directional; reverse-engineering one ECU can expose a whole family.

  5. 05

    UDS 0x29 Authentication (ISO 14229-1, since the 2020 edition) uses certificate-based PKI and mutual authentication; signed firmware, rollback protection and an HSM complete the secure update chain.

  6. 06

    Moving from 0x27 to 0x29 is as much a PKI project as a diagnostics one: security levels mapped to certificate rights, a rule for time in the ECU, short-lived tester certificates and a negative test for every authentication NRC.

UDS 0x29 Authentication is the diagnostic service, introduced in ISO 14229-1:2020, that replaces seed-key SecurityAccess (0x27) with certificate-based authentication: the tester presents a certificate that the ECU validates against a trusted certificate authority, and the check can run in both directions. Type approval now turns on cyber-security, and the diagnostic channel is one of the most exposed surfaces a vehicle carries. This is what the regulations demand, and why the industry is making that move.

What UN R155 and ISO/SAE 21434 ask of diagnostics

Two UNECE regulations now sit behind every new vehicle type approval in the EU and in the other markets that apply them. UN R155 requires a certified Cyber Security Management System (CSMS) covering the whole vehicle lifecycle; UN R156 requires a Software Update Management System (SUMS) governing how software reaches a vehicle, whether over the air or through a workshop tool. In the EU, R155 has applied to new vehicle types since July 2022 and, since July 2024, to all new vehicles. A vehicle cannot be registered there without it.

Underneath the regulation sits the engineering standard, ISO/SAE 21434:2021, which specifies cyber-security engineering across the full lifecycle of electrical and electronic systems, from concept and development through production, operation, maintenance and decommissioning. It introduces Threat Analysis and Risk Assessment (TARA) as the structured method for identifying attack paths and justifying the controls that answer them. The diagnostic interface is precisely the kind of asset a TARA is built to scrutinise.

Why the diagnostic channel is a prime attack surface

Diagnostics is not a read-only window. Through the off-board interface a tester can flash firmware, run a bootloader, unlock restricted routines, change configuration and read out sensitive data. That is exactly the privilege set an attacker wants. A diagnostic session that can reprogram an ECU is, in security terms, a remote code execution path with a connector on the end of it.

Because the same off-board protocol stack is used legitimately by every workshop and OEM tool, the bar for protecting it is high: the channel has to be open enough for authorised diagnostics everywhere, yet closed to anyone who simply plugs in. A 21434 risk assessment that takes flashing and unlock services seriously will almost always flag the access-control mechanism on the diagnostic channel as a top-rated item.

The limits of 0x27 SecurityAccess

For decades, that access control has been UDS service 0x27, SecurityAccess (defined in ISO 14229-1). The tester requests a seed, applies a secret algorithm and returns a key; if the key matches, the ECU unlocks. The weaknesses are well documented. The seed-key relationship is often a fixed algorithm with shared secret constants reused across an entire ECU family, so reverse-engineering one unit can compromise the whole range. Implementations frequently leak through static seeds or easily invertible functions.

More fundamentally, 0x27 authenticates a one-off unlock, not a session, and it is unidirectional: the ECU never verifies the tester’s identity, and the tester never verifies the ECU. Once unlocked, the channel offers no continuous proof of who is talking. That is a poor fit for a 21434 world in which provenance and integrity must be demonstrable, not assumed.

What UDS 0x29 Authentication brings

ISO 14229-1:2020 introduced service 0x29, Authentication, as the modern answer. In its certificate-exchange mode (Authentication with PKI Certificate Exchange, APCE) it replaces the shared secret with asymmetric cryptography: the tester presents an X.509 certificate that the ECU validates against a trusted certificate authority, with a signed challenge-response proving possession of the private key. A challenge-response mode (ACR) using pre-installed keys, asymmetric or symmetric, is also available where full PKI is impractical.

The improvements map directly onto what the regulations want. Authentication can be bidirectional, so tester and ECU mutually verify identity, defeating a class of man-in-the-middle attacks that 0x27 could not address. Roles and rights can be bound to the certificate, and revocation removes a compromised tool without re-keying every ECU in the field. The result is a diagnostic channel whose access decisions are based on verifiable identity rather than a secret that, once leaked, unlocks everything.

Illustration: a rugged diagnostic laptop and an ECU on a dark lab bench at dusk, linked by two parallel thin orange lines
Illustration

The nine 0x29 sub-functions

ISO 14229-1:2020 gives service 0x29 nine sub-functions. Two serve both modes; the rest belong to either the certificate-exchange mode (APCE) or the challenge-response mode (ACR).

Both modes
0x00 deAuthenticate
Ends the authenticated state; the ECU falls back to the rights of an unauthenticated tester.
0x08 authenticationConfiguration
The ECU reports the method it supports: APCE, or ACR with asymmetric or symmetric cryptography.
APCE · certificate exchange
0x01 verifyCertificateUnidirectional
The tester sends its certificate; the ECU checks it and returns a challenge.
0x02 verifyCertificateBidirectional
As 0x01, plus a challenge from the tester; the ECU answers with its own certificate and proof.
0x03 proofOfOwnership
The tester proves it holds the private key behind its certificate by signing the ECU's challenge.
0x04 transmitCertificate
Sends a further certificate, for example one that carries additional rights.
ACR · challenge-response
0x05 requestChallengeForAuthentication
The tester asks the ECU for a challenge.
0x06 verifyProofOfOwnershipUnidirectional
The tester returns its proof over that challenge.
0x07 verifyProofOfOwnershipBidirectional
As 0x06, plus a challenge from the tester that the ECU must answer.
Service 0x29 Authentication, ISO 14229-1:2020

How an APCE exchange runs

In the unidirectional case the ECU verifies the tester, in four steps:

  1. Tester to ECU: 1 0x29 0x08 Optional: which method does the ECU support?

  2. ECU to tester: The method it supports, here APCE.

  3. Tester to ECU: 2 0x29 0x01 The tester's certificate.

  4. The ECU checks the certificate against its trust anchor: signature, chain of trust, validity period, type and scope.

  5. ECU to tester: A random challenge.

  6. 3 The tester signs the challenge with the private key that belongs to its certificate.

  7. Tester to ECU: 0x29 0x03 The signature.

  8. 4 The ECU checks the signature with the public key in the certificate.

  9. ECU to tester: If it holds, the ECU grants the rights the certificate carries, and it can return information for a session key that protects the rest of the session.

Unidirectional APCE: the ECU verifies the tester

The bidirectional case, 0x29 0x02, adds the other direction to the same messages. The tester sends a challenge of its own along with its certificate, and the ECU answers with its certificate, its signature over the tester’s challenge and a challenge for the tester. The tester verifies the ECU before it sends its proof with 0x03, so each side knows who it is talking to.

ACR follows the same logic without exchanging certificates. The tester requests a challenge (0x05) and answers it with a proof made with a key the ECU already trusts (0x06); in the bidirectional form (0x07) it asks the ECU for proof in return. ACR suits ECUs too small for certificate parsing, at the price of distributing keys in advance.

When 0x29 refuses: the authentication NRCs

Alongside the general negative response codes, such as 0x12 sub-function not supported, 0x13 incorrect message length or invalid format, 0x22 conditions not correct, 0x24 request sequence error and 0x31 request out of range, ISO 14229-1 defines a block of codes for authentication. They are what a test suite should provoke on purpose.

NRC Meaning
0x50 Certificate verification failed: invalid time period
0x51 Certificate verification failed: invalid signature
0x52 Certificate verification failed: invalid chain of trust
0x53 Certificate verification failed: invalid type
0x54 Certificate verification failed: invalid format
0x55 Certificate verification failed: invalid content
0x56 Certificate verification failed: invalid scope
0x57 Certificate verification failed: invalid certificate (revoked)
0x58 Ownership verification failed
0x59 Challenge calculation failed
0x5A Setting access rights failed
0x5B Session key creation or derivation failed
0x5C Configuration data usage failed
0x5D DeAuthentication failed

Moving from 0x27 to 0x29

The service is the easy part. Most of the work is in decisions that 0x27 never forced anyone to make.

  • Map security levels to rights. Every 0x27 level protects a set of services, data identifiers and routines. Turn each level into a role or right a certificate can carry, such as development, end-of-line or workshop, and write that mapping into the diagnostic specification so that tester and ECU apply the same rules.
  • Choose APCE or ACR per ECU class. APCE needs certificate parsing and chain validation in the ECU, best done with keys and checks inside a Hardware Security Module. ACR is lighter, but brings key distribution back.
  • Decide what time means in the ECU. A certificate has a validity period, and NRC 0x50 exists because the ECU has to judge it. An ECU without a trustworthy clock needs a defined rule for that check.
  • Keep tester certificates short-lived. Distributing revocation lists to ECUs in the field is hard. Certificates issued for hours or days by a backend, after the user has signed in, limit what a lost laptop can do and leave revocation (NRC 0x57) for the exceptions.
  • Keep the root offline. Hold the root certificate authority offline, issue from intermediate authorities per tool class, and define how the trust anchor stored in the ECU is rotated.
  • Run both during the transition. ECUs already in the field keep 0x27 for years, so testers and workshop tools need both mechanisms, selected per ECU variant.
  • Test every refusal. An expired, wrongly signed, wrongly scoped or revoked certificate, and a wrong proof, each have their own NRC. Give each one a negative test in the diagnostic regression suite.

Secure software update and the role of the HSM

Authentication controls who may talk; UN R156 and 21434 also demand control over what gets installed. Secure software update means firmware images are cryptographically signed and verified before they are accepted, with version identification (RxSWIN) so type-approval-relevant software can be tracked, and rollback protection so an attacker cannot force a downgrade to a vulnerable older build. Secure boot then extends that chain of trust to start-up, refusing to run code that fails verification.

These guarantees rest on keys, and keys must be protected. A Hardware Security Module gives the ECU a tamper-resistant home for private keys and a place to perform signature checks and certificate validation in isolation from application code. The practical engineering challenge is that HSM hardware varies widely between silicon vendors. Abstracting the cryptographic and key-storage layer behind a stable interface, as Diadrom does with Encrypt and the Autotech Bootloader against the AUTOSAR Crypto Service Manager API, lets the same secure-boot and secure-download logic move across platforms without re-validating the security argument each time.

The whole chain, from the hardware anchor through secure boot and OTA to access control and key management, is set out in our white paper Root of Trust in the software-defined vehicle.

Working on this in a programme of your own? Talk to the team behind this article.

Standards cited here last checked against the issuing bodies on .

Ask us

Have a question about this?

Two fields, straight to the engineers. We reply within one business day.

Subscribe to Diadrom Insights

Brief and technical, once a month.

Diagnostics and secure ECU programming, and the standards that decide what a programme has to deliver. Go deeper with our white paper Root of Trust in the software-defined vehicle.