Many diagnostic operations can change an ECU's configuration, behavior or software. Examples include writing protected data, executing restricted routines and programming ECU memory. These operations should not be available to every diagnostic client without authorization.
The UDS SecurityAccess service (SID 0x27) provides a standardized diagnostic exchange through which an ECU can grant a configured level of security access. A common implementation uses a seed-and-key challenge-response procedure.
This article explains the service structure, request sequence, security levels, negative responses, tester implementation and practical validation. It also explains what UDS does not define: the actual seed-to-key algorithm and the secret material remain specific to the vehicle manufacturer's security design.
1. Why is SecurityAccess required?
An ECU may expose diagnostic functions that are safe for ordinary service operations and other functions that require additional authorization.
Examples of operations that may be protected include:
- ECU reprogramming.
- Writing selected configuration or coding data.
- Executing restricted routines.
- Accessing selected memory areas.
- Changing calibration values.
SecurityAccess helps an ECU decide whether a diagnostic tester has been granted a configured access level. It is only one part of a complete cybersecurity design. It does not replace secure boot, software integrity verification, secure communication, authorization policy, key management or other vehicle cybersecurity controls.
Important: A successful SecurityAccess exchange confirms that one configured diagnostic access procedure succeeded. It does not prove that the ECU or vehicle is secure as a whole.
2. What is the seed-key mechanism?
A common SecurityAccess procedure has two main stages:
- The tester requests a seed from the ECU for a configured security level.
- The tester calculates a key using an authorized, ECU-specific algorithm and submits it to the ECU.
The ECU validates the submitted key. If it is accepted, the ECU grants the configured security access level.
The seed is a challenge value. It is not itself the secret key. The key calculation algorithm and secret material are not one universal public formula defined for every ECU by UDS.
The actual implementation may also include:
- A required diagnostic session.
- Vehicle-state preconditions.
- An attempt counter.
- A delay or lockout policy.
- Security-level-specific permissions.
- Relocking behavior after reset, session changes or other configured events.
3. SecurityAccess request structure
The service identifier is 0x27. A sub-function identifies the requested operation and security level.
A common convention is:
- An odd sub-function requests a seed.
- The following even sub-function sends the corresponding key.
For example, an ECU project may configure sub-function 0x01 to request a seed and 0x02 to submit the corresponding key.
This odd/even pairing is a common pattern, not a substitute for the ECU diagnostic specification. The actual supported sub-functions, security-level mapping and request/response lengths must be obtained from the ECU definition.
Request format
A simplified seed request:
27 01
A simplified key-send request:
27 02 <key bytes...>
The bytes shown are illustrative. The key length and permitted sub-functions are ECU-specific.
4. Seed request and positive response
The tester sends a seed request:
Tester -> ECU: 27 01
A positive response begins with 0x67 and includes the echoed sub-function and seed data:
ECU -> Tester: 67 01 <seed bytes...>
Interpretation:
0x67— positive response SID for request0x27.0x01— echoed seed-request sub-function.- Remaining bytes — seed data, with length and interpretation defined by the ECU implementation.
The tester should:
- Confirm the intended security level and request sub-function.
- Validate the response SID and echoed sub-function.
- Validate the seed length.
- Preserve the specified byte order and data representation.
- Use only the approved algorithm for that ECU and security level.
- Observe the applicable timing and attempt policies.
Zero-seed behavior
Some UDS implementations use an all-zero seed to indicate that the requested security level is already unlocked. A tester must interpret this only according to the applicable ISO 14229 edition and ECU diagnostic profile. Do not assume that every zero-valued seed has the same meaning across all implementations.
5. Key calculation and submission
After receiving the seed, the tester's authorized security component calculates the key. The tester then sends the key using the paired sub-function.
Example:
Tester -> ECU: 27 02 <key bytes...>
A positive response begins with:
ECU -> Tester: 67 02
A positive response indicates that the requested SecurityAccess operation was accepted. The tester should then proceed only with the operation authorized by that access level and the ECU's other preconditions.
The key calculation must be implemented and controlled according to the vehicle manufacturer's security process. Do not use guessed formulas, publicly shared keys or generic seed-to-key assumptions on a production ECU.
What UDS standardizes — and what it does not
| Defined by the UDS service | Defined by the ECU/OEM security implementation |
|---|---|
| Service identifier and request/response framework | Seed-to-key algorithm |
| Sub-function-based service operation | Secret key material and provisioning |
| Positive and negative response structure | Security-level permissions |
| Diagnostic exchange behavior | Attempt limits and configured delay policy |
| Applicable protocol timing behavior | Project-specific preconditions and recovery process |
This separation is essential when developing a tester. A generic UDS stack can implement the service exchange, but it cannot legitimately invent the ECU's key algorithm or credentials.
6. Security levels and diagnostic sessions
An ECU can define multiple security levels for different groups of protected functions.
For example, a project may use one level for a restricted diagnostic routine and another for programming operations. The actual meaning of each level is defined by the ECU diagnostic specification.
Security level is not the same as diagnostic session:
- Diagnostic session: determines the diagnostic operating context and which services or behaviors are available.
- Security access level: determines whether a configured protected access permission has been granted.
An ECU may require a specific session before it accepts a SecurityAccess request. It may also require additional vehicle-state conditions.
A typical sequence could be:
10 03 Enter Extended Diagnostic Session
27 01 Request seed for configured level
67 01 ... ECU returns seed
27 02 ... Submit calculated key
67 02 ECU accepts the key
This is an illustrative sequence. The required session and sub-functions must be verified for the target ECU.
7. Negative responses and lockout behavior
Common negative response codes relevant to SecurityAccess include:
| NRC | Name | General meaning |
|---|---|---|
0x12 | subFunctionNotSupported | Requested sub-function is not supported |
0x13 | incorrectMessageLengthOrInvalidFormat | Request length or format is invalid |
0x22 | conditionsNotCorrect | Required ECU or vehicle conditions are not met |
0x24 | requestSequenceError | Request is not valid in the current sequence |
0x33 | securityAccessDenied | Security access is denied |
0x35 | invalidKey | Submitted key is invalid |
0x36 | exceedNumberOfAttempts | Configured attempt limit has been exceeded |
0x37 | requiredTimeDelayNotExpired | Required delay has not elapsed |
The exact response depends on the failure condition, standard edition and ECU implementation.
Example: invalid key
Tester -> ECU: 27 02 <incorrect key>
ECU -> Tester: 7F 27 35
Interpretation:
0x7F— negative response.0x27— original request service.0x35—invalidKey.
Attempt counters and delay behavior
An ECU may implement attempt counters and delay periods to limit repeated guessing. After a configured number of invalid attempts, it may reject further attempts or require a delay before another attempt is accepted.
A tester should not repeatedly retry keys without understanding the ECU's attempt counter and lockout behavior. Doing so may trigger a delay or temporary denial of access.
The attempt policy, persistence across resets and recovery procedure are project-specific. Validate them only with an approved test plan and an agreed recovery procedure.
8. Tester-side SecurityAccess state machine
A robust tester should model SecurityAccess as a stateful sequence rather than sending isolated requests without tracking context.
The diagram is conceptual. The exact state transitions, persistence and relocking rules must match the ECU specification.
Recommended tester sequence
- Select the configured security level for the intended operation.
- Confirm the required diagnostic session and ECU preconditions.
- Send the seed request using the configured sub-function.
- Validate the response SID, echoed sub-function and seed length.
- Interpret a zero seed only according to the applicable standard and ECU profile.
- Obtain the key only through the authorized project security component.
- Send the key using the paired sub-function and correct length.
- Validate the positive response or classify the NRC.
- Do not retry blindly after a failed attempt; apply the ECU's delay and attempt policy.
- Record the result without exposing secret key material.
Tester implementation checks
- Validate the response SID and sub-function before using the seed.
- Handle transport errors separately from UDS negative responses.
- Apply the correct request/response timing.
- Prevent a stale seed from being reused outside the allowed sequence.
- Associate each seed request and key submission with the intended ECU and security level.
- Avoid concurrent SecurityAccess sequences to the same ECU unless the implementation explicitly supports them.
- Track session changes, ECU resets and configured relocking behavior.
9. SecurityAccess testing considerations
Validate more than the successful path. A useful test plan includes:
| Test case | Expected validation |
|---|---|
| Supported seed request | Correct positive response and seed length |
| Unsupported security sub-function | Appropriate negative response |
| Incorrect request length | Request format rejected |
| Invalid key | Access not granted; expected NRC behavior |
| Key without preceding seed request | Sequence handling verified |
| Key for the wrong security level | Correct level/sequence behavior |
| Repeated invalid attempts | Attempt counter and delay policy verified |
| Request in unsupported session | Session dependency enforced |
| Required vehicle conditions not met | Preconditions enforced |
| ECU reset during or after access | State and relocking behavior verified |
| Session timeout/change | Access state behaves as specified |
| Zero seed response | Tester interprets it according to the ECU profile |
Test lockout and attempt-counter behavior carefully. Use an approved development ECU, test credentials and recovery process. Avoid running brute-force or uncontrolled retry tests against production vehicles.
10. Security engineering best practices
A seed-key exchange should not be treated as a complete cybersecurity solution.
A robust ECU security design should also consider:
- Strong, appropriately designed cryptographic mechanisms.
- Secure generation and handling of challenge values.
- Protection of secret keys and provisioning processes.
- Rate limiting and attempt monitoring.
- Secure diagnostic access over external interfaces.
- Authentication and authorization policy.
- Secure boot and software integrity.
- Security event logging where required.
- Lifecycle management of credentials and keys.
For tester and tool developers:
- Never hard-code production keys in test scripts or source repositories.
- Do not print seed/key material into ordinary test reports or logs.
- Separate development credentials from production credentials.
- Protect the key-derivation component and its inputs.
- Restrict access to security plug-ins, libraries and configuration.
- Define credential rotation, revocation and lifecycle handling with the OEM.
- Test reset, power-loss and session-transition behavior.
The design should be assessed against the vehicle's cybersecurity requirements and applicable standards and processes, including the relevant ISO/SAE 21434 engineering activities.
11. Common misconceptions
UDS defines one standard seed-key algorithm for every ECU.
No. The service defines the diagnostic exchange; the ECU/OEM security implementation defines the algorithm and secret material.
Entering Extended Session unlocks all protected functions.
No. Session selection and security access are separate controls.
A positive SecurityAccess response means the whole ECU is secure.
No. It confirms a particular configured access procedure, not the security of the entire ECU.
A failed key can be retried indefinitely.
Not necessarily. The ECU may enforce attempt limits and delay behavior.
Every odd sub-function can be paired with the next even value on every ECU.
Do not assume this. The supported sub-functions and their mapping must be taken from the ECU diagnostic specification.
12. Key takeaways
- SecurityAccess uses SID
0x27. - A common procedure requests a seed and submits a calculated key.
- Odd/even sub-function pairing is common, but exact support is ECU-specific.
- The key algorithm and secret are not universal UDS values.
- Diagnostic session and security access level are separate controls.
- Attempt counters, delays and lockout behavior must be handled correctly.
- SecurityAccess is only one element of ECU cybersecurity.
- Tester implementations should protect credentials and avoid exposing seed/key material in logs.
13. Check your understanding
- Which SID is used for SecurityAccess?
- What does the ECU provide when a seed is requested successfully?
- Does ISO 14229 define one universal seed-key algorithm for all ECUs?
- What is the difference between a diagnostic session and a security level?
- What does NRC
0x35indicate? - What may happen after repeated invalid key attempts?
- Why should a tester avoid logging production key material?
- Why must the tester validate the seed response before calculating a key?
Answers
0x27.- A seed value for the requested supported security level, subject to the ECU's response definition.
- No. The algorithm and secret material are defined by the ECU/OEM security implementation.
- A session controls the diagnostic operating context; a security level controls configured protected access.
invalidKey.- The ECU may reject further attempts or enforce a delay, according to its implementation.
- Logs can expose sensitive credentials or security-related material and should follow the project's information-protection policy.
- To confirm the response belongs to the expected service and level and that the seed length and format are valid.
Related UDS articles
- UDS Protocol Explained
- UDS Services and Service Identifiers
- Diagnostic Session Control
- UDS DTC Management
- UDS ECU Flashing
References and further reading
- ISO 14229-1:2026 — Road vehicles: Unified diagnostic services, application layer
- ISO — Standards catalogue
- ISO/SAE 21434 — Road vehicles cybersecurity engineering
- AUTOSAR — Classic Platform
Standards note: ISO 14229-1:2026 (Edition 4, published June 2026) is the current published application-layer edition at the time this article was reviewed. Existing ECU programs may be contractually based on earlier editions. Always follow the project/OEM diagnostic specification and identify the exact edition used for conformance.
