Skip to content

Commit 71c0c55

Browse files
authored
Merge branch 'main' into tl/issue_117
2 parents 36c141e + d9d7275 commit 71c0c55

File tree

1 file changed

+101
-35
lines changed

1 file changed

+101
-35
lines changed

draft-ietf-oauth-attestation-based-client-auth.md

Lines changed: 101 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ author:
2727
2828
-
2929
fullname: Paul Bastian
30-
30+
organization: Bundesdruckerei
31+
3132
-
3233
fullname: Christian Bormann
3334
organization: SPRIND
@@ -36,6 +37,7 @@ author:
3637

3738
normative:
3839
RFC3986: RFC3986
40+
RFC6750: RFC6750
3941
RFC7591: RFC7591
4042
RFC7519: RFC7519
4143
RFC7800: RFC7800
@@ -125,7 +127,7 @@ Please note that the protocol details for steps (2) and (4), particularly how th
125127

126128
{::boilerplate bcp14-tagged}
127129

128-
# Terminology
130+
# Terminology {#terminology}
129131

130132
Client Attestation JWT:
131133
: A JSON Web Token (JWT) generated by the Client Attester which is bound to a key managed by a Client Instance which can then be used by the instance for client authentication.
@@ -142,6 +144,9 @@ Client Instance Key:
142144
Client Attester:
143145
: An entity that authenticates a Client Instance and attests it by issuing a Client Attestation JWT.
144146

147+
Challenge:
148+
: A String that is the input to a cryptographic challenge-response pattern. This is traditionally called a nonce within OAuth.
149+
145150
# Relation to RATS
146151

147152
The Remote Attestation Procedures (RATS) architecture defined by {{RFC9334}} has some commonalities to this document. The flow specified in this specification relates to the "Passport Model" in RATS. However, while the RATS ecosystem gives explicit methods and values how the RATS Attester proves itself to the Verifier, this is deliberately out of scope for Attestation-Based Client Authentication. Additionally, the terminology between RATS and OAuth is different:
@@ -218,10 +223,9 @@ The following content applies to the JWT Header:
218223
The following content applies to the JWT Claims Set:
219224

220225
* `iss`: REQUIRED. The `iss` (subject) claim MUST specify client_id value of the OAuth Client.
221-
* `exp`: REQUIRED. The `exp` (expiration time) claim MUST specify the time at which the Client Attestation PoP is considered expired. The authorization server MUST reject any JWT with an expiration time that has passed, subject to allowable clock skew between systems. Note that the authorization server may reject JWTs with an "exp" claim value that is unreasonably far in the future.
222226
* `aud`: REQUIRED. The `aud` (audience) claim MUST specify a value that identifies the authorization server as an intended audience. The {{RFC8414}} issuer identifier URL of the authorization server MUST be used as a value for an "aud" element to identify the authorization server as the intended audience of the JWT.
223-
* `jti`: REQUIRED. The `jti` (JWT identifier) claim MUST specify a unique identifier for the Client Attestation PoP. The authorization server MAY ensure that JWTs are not replayed by maintaining the set of used "jti" values for the length of time for which the JWT would be considered valid based on the applicable "exp" instant.
224-
* `nonce`: OPTIONAL. The `nonce` (nonce) claim MUST specify a String value that is provided by the authorization server to associate the Client Attestation PoP JWT with a particular transaction and prevent replay attacks.
227+
* `jti`: REQUIRED. The `jti` (JWT identifier) claim MUST specify a unique identifier for the Client Attestation PoP. The authorization server can utilize the `jti` value for replay attack detection, see [](#security-consideration-replay).
228+
* `challenge`: OPTIONAL. The `challenge` (challenge) claim MUST specify a String value that is provided by the authorization server for the client to include in the Client Attestation PoP JWT.
225229
* `iat`: OPTIONAL. The `iat` (issued at) claim MUST specify the time at which the Client Attestation PoP was issued. Note that the authorization server may reject JWTs with an "iat" claim value that is unreasonably far in the past.
226230
* `nbf`: OPTIONAL. The `nbf` (not before) claim MUST specify the time before which the Client Attestation PoP MUST NOT be accepted for processing.
227231

@@ -246,10 +250,9 @@ The following example is the decoded header and payload of a JWT meeting the pro
246250
{
247251
"iss": "https://client.example.com",
248252
"aud": "https://as.example.com",
249-
"nbf": 1300815780,
250-
"exp": 1300819380,
253+
"nbf":1300815780,
251254
"jti": "d25d00ab-552b-46fc-ae19-98f440f25064",
252-
"nonce" : "5c1a9e10-29ff-4c2b-ae73-57c0957c09c4"
255+
"challenge": "5c1a9e10-29ff-4c2b-ae73-57c0957c09c4"
253256
}
254257
~~~
255258

@@ -314,6 +317,8 @@ To validate an HTTP request which contains the client attestation headers, the r
314317
2. There is precisely one OAuth-Client-Attestation-PoP HTTP request header field, where its value is a single well-formed JWT conforming to the syntax outlined in [](client-attestation-pop-jwt).
315318
3. The signature of the Client Attestation PoP JWT obtained from the OAuth-Client-Attestation-PoP HTTP header verifies with the Client Instance Key contained in the `cnf` claim of the Client Attestation JWT obtained from the OAuth-Client-Attestation HTTP header.
316319

320+
An error parameter according to Section 3 of {{RFC6750}} SHOULD be included to indicate why a request was declined. If the Client Attestation is absent or not using an expected server-provided challenge, the value `use_attestation_challenge` can be used to indicate that an attestation with a server-provided challenge was expected. If the attestation and proof of possession was present but could not be successfully verified, the value `invalid_client_attestation` is used.
321+
317322
## Client Attestation at the Token Endpoint {#token-endpoint}
318323

319324
While usage of the the client attestation mechanism defined by this draft can be used in a variety of different HTTP requests to different endpoints, usage within the token request as defined by {{RFC6749}} has particular additional considerations outlined below.
@@ -424,32 +429,59 @@ To validate a client attestation using the concatenated serialization form, the
424429
2. After the '~' character, there exists precisely a single well-formed JWT conforming to the syntax outlined in [](client-attestation-pop-jwt).
425430
3. The signature of the Client Attestation PoP JWT obtained after the '~' character verifies with the Client Instance Key contained in the `cnf` claim of the Client Attestation JWT obtained before the '~' character.
426431

427-
# Nonce Retrieval {#nonce-retrieval}
428-
429-
This specification defines header fields that allow a Client to request a fresh nonce value to be used in the OAuth-Client-Attestation-PoP. The nonce is opaque to the client.
432+
# Challenge Retrieval {#challenge-retrieval}
430433

431-
An Authorization Server compliant with this specification SHOULD signal via the metadata entry `client_attestation_pop_nonce_required` which endpoints support and expect a server-provided nonce. The client MUST retrieve a nonce before other calls to this endpoint and MUST use this nonce for the Client Attestation PoP.
434+
This section defines an optional mechanism that allows a Client to request a fresh Challenge from the Authorization Server to be included in the Client Attestation PoP JWT. This construct may be similar or equivalent to a nonce, see [](terminology). The value of the challenge is opaque to the client.
432435

433-
A Request to an endpoint supporting the server-provided nonce MUST include the `attestation-nonce-request` field name with the value `true` and use the HTTP method of type OPTIONS (without payload) to actively request a nonce. The server answers with an HTTP Response with status code 200 without body, but sets the header field `attestation-nonce` to the nonce.
436+
An Authorization Server MAY offer a challenge endpoint for Clients to fetch Challenges in the context of this specification. If the Authorization Server supports metadata as defined in {{RFC8414}}, it MUST signal support for the challenge endpoint by including the metadata entry `challenge_endpoint` containing the URL of the endpoint as its value. If the Authorization Server offers a challenge endpoint, the Client MUST retrieve a challenge and MUST use this challenge in the OAuth-Attestation-PoP as defined in (#client-attestation-pop-jwt).
434437

435-
The client MUST use this nonce in the OAuth-Attestation-PoP as defined in (#client-attestation-pop-jwt).
438+
A request for a Challenge is made by sending an HTTP POST request to the URL provided in the challenge_endpoint parameter of the Authorization Server metadata.
436439

437440
The following is a non-normative example of a request:
438441

439442
~~~
440-
OPTIONS /as/par HTTP/1.1
443+
POST /as/challenge HTTP/1.1
441444
Host: as.example.com
442-
attestation-nonce-request: true
445+
Accept: application/json
443446
~~~
444447

445-
the following is a non-normative example of a response:
448+
The Authorization Server provides a Challenge in the HTTP response with a 200 status code and the following parameters included in the message body of the HTTP response using the application/json media type:
449+
* attestation_challenge: REQUIRED if the authorization server supports Client Attestations and server provided challenges as described in this document. String containing a Challenge to be used in the OAuth-Attestation-PoP as defined in (#client-attestation-pop-jwt). The intention of this element not being required in other circumstances is to preserve the ability for the challenge endpoint to be used in other applications unrelated to client attestations.
450+
451+
The Authorization Server MUST make the response uncacheable by adding a `Cache-Control` header field including the value `no-store`. The Authorization Server MAY add additional challenges or data.
452+
453+
The following is a non-normative example of a response:
446454

447455
~~~
448456
HTTP/1.1 200 OK
449457
Host: as.example.com
450-
attestation-nonce: AYjcyMzY3ZDhiNmJkNTZ
458+
Content-Type: application/json
459+
460+
{
461+
"attestation_challenge": "AYjcyMzY3ZDhiNmJkNTZ"
462+
}
451463
~~~
452464

465+
## Providing Challenges on Previous Responses
466+
467+
The Authorization Server MAY provide a fresh Challenge with any HTTP response using a HTTP header-based syntax. The HTTP header field parameter MUST be named "OAuth-Client-Attestation-Challenge" and contain the value of the Challenge. The Client MUST use this new Challenge for the next OAuth-Client-Attestation-PoP.
468+
469+
The following is a non-normative example of an Authorization Response containing a fresh Challenge:
470+
471+
~~~
472+
HTTP/1.1 200 OK
473+
Content-Type: application/json
474+
Cache-Control: no-store
475+
OAuth-Client-Attestation-Challenge: AYjcyMzY3ZDhiNmJkNTZ
476+
477+
{
478+
"access_token": "2YotnFZFEjr1zCsicMWpAA",
479+
"token_type": "Bearer",
480+
"expires_in": 3600
481+
}
482+
~~~
483+
484+
453485
# Implementation Considerations
454486

455487
## Reuse of a Client Attestation JWT
@@ -468,6 +500,16 @@ Because the Client Attestation and Client Attestation PoP are communicated using
468500

469501
This specification does not provide a mechanism to rotate the Client Instance Key in the Client Attestation JWT's "cnf" claim. If the Client Instance needs to use a new Client Instance Key for any reason, then it MUST request a new Client Attestation JWT from its Client Attester.
470502

503+
## Replay Attack Detection {#implementation-consideration-replay}
504+
505+
Authorization Servers implementing measures to detect replay attacks as described in [](#security-consideration-replay) require efficient data structures to manage large amounts of challenges for use cases with high volumes of transactions. To limit the size of the data structure, the Authorization Server should use a sliding window, allowing Client Attestation PoPs within a certain time window, in which the seen `challenge` or `jti` values are stored, but discarded afterwards. To ensure security, Client Attestation PoPs outside this time window MUST be rejected by the Authorization Server. The allowed window is determined by the `iat` of the Client Attestation PoP and the sliding window time duration chosen by the Authorization Server. These data structures need to:
506+
507+
- search the data structure to validate whether a challenge form a Client Attestation PoP has been previously seen
508+
- insert the new challenges from the Client Attestation PoP if the search returned no result
509+
- delete the challenges after the Client Attestation PoP has passed the sliding time window
510+
511+
A trie (also called prefix tree), or a patricia trie (also called radix tree) is a RECOMMENDED data structures to implement such a mechanism.
512+
471513
# Privacy Considerations
472514

473515
## Client Instance Tracking Across Authorization Servers
@@ -478,26 +520,50 @@ Implementers should be aware that using the same client attestation across multi
478520

479521
The guidance provided by {{RFC7519}} and {{RFC8725}} applies.
480522

481-
## Replay Attack Detection
523+
## Replay Attacks {#security-consideration-replay}
524+
525+
An Authorization Server SHOULD implement measures to detect replay attacks by the Client Instance. In the context of this specification, this means to detect that an attacker is resending the same Client Attestation PoP JWT in multiple requests. The following options are RECOMMENDED for this client authentication method:
482526

483-
The following mechanisms exist within this client authentication method in order to allow an authorization server to detect replay attacks for presented client attestation PoPs:
527+
- The Authorization Server manages a list of witnessed `jti` values of the Client Attestation PoP JWT for the time window of which the JWT would be considered valid. This sliding time window is based on the `iat` of the Client Attestation PoP and and the duration chosen by the Authorization Server. If any Client Attestation PoP JWT would be replayed, the Authorization Server would recognize the `jti` value in the list and respond with an authentication error. Details how to implement such a data structure to maintain `jti` values is given in [](#implementation-consideration-replay).
528+
- The Authorization Server provides a challenge as an `OAuth-Client-Attestation-Challenge` in the challenge endpoint to the Client Instance and the Client uses it as a `challenge` value in the Client Attestation PoP JWT. The Authorization Server may chose to:
529+
- manage a list of witnessed `challenge` values, similar to the previously described `jti` approach. Details how to implement such a data structure to maintain `challenge` values is given in [](#implementation-consideration-replay). This guarantees stronger replay protection with a challenge chosen by the Authorization Server itself, at the potential cost of an additional round-trip.
530+
- use self-contained challenges while not storing the seen challenges. This approach scales well, while only guaranteeing freshness, but no replay protection within the limited time-window chosen by the Authorization Server.
531+
- The Authorization Server generates a challenge that is bound to the Client Instance's session, such that a specific `challenge` in the Client Attestation PoP JWT is expected and validated. The Authorization Server may either:
532+
- send the challenge as part of another previous response to the Client Instance of providing the challenge explicitly
533+
- reuse an existing artefact of the Client Instance's session, e.g. the authorization code. This MUST be communicated out-of-band between Authorization Server and Client.
484534

485-
- The client uses "jti" (JWT ID) claims for the Client Attestation PoP JWT and the authorization server maintains a list of used (seen) "jti" values for the time of which the JWT would be considered valid based on the applicable "exp" claim. If any Client Attestation PoP JWT would be replayed, the authorization server would recognize the "jti" and respond with an authentication error.
486-
- The authorization server provides a nonce for the particular transaction and the client uses it for the "nonce" claim in the Client Attestation PoP JWT. The authorization server validates that the nonce matches for the transaction. This approach may require an additional roundtrip in the protocol. The authorization server MUST ensure that the nonce provides sufficient entropy.
487-
- The authorization server may expect the usage of a nonce in the Client Attestation PoP JWT, but instead of providing the nonce explicitly, the client may implicitly reuse an existing artefact, e.g. the authorization code. The authorization server MUST ensure that the nonce provides sufficient entropy.
535+
Because clock skews between servers and clients may be large, Authorization Servers MAY limit Client Attestation PoP lifetimes by using server-provided challenge values containing the time at the server rather than comparing the client-supplied iat time to the time at the server. Challenges created in this way yield the same result even in the face of arbitrarily large clock skews.
488536

489-
The approach using a nonce explicitly provided by the authorization server gives stronger replay attack detection guarantees, however support by the authorization server is OPTIONAL to simplify mandatory implementation requirements. The "jti" method is mandatory and hence acts as a default fallback.
537+
In any case the Authorization Server SHOULD ensure the freshness of the Client Attestation PoP by checking either the iat claim or if present the server provided challenge, is within an acceptable time window.
538+
539+
The approach using a challenge explicitly provided by the Authorization Server gives stronger replay attack detection guarantees, however support by the Authorization Server is OPTIONAL to simplify mandatory implementation requirements. The `jti` value is mandatory and hence acts as a default fallback.
490540

491541
# Appendix A IANA Considerations
492542

493543
## OAuth Parameters Registration
494544

495545
This specification requests registration of the following values in the IANA "OAuth Authorization Server Metadata" registry {{IANA.OAuth.Params}} established by {{RFC8414}}.
496546

497-
* Metadata Name: client_attestation_pop_nonce_required
498-
* Metadata Description: An array of URLs that specify the endpoints supporting the nonce retrieval and expecting a Client Attestation bound to a server-provided nonce.
547+
* Metadata Name: challenge_endpoint
548+
* Metadata Description: URL of the authorization servers challenge endpoint which is used to obtain a fresh challenge for usage in client authentication methods such as client attestation.
549+
* Change Controller: IETF
550+
* Reference: [](#challenge-retrieval) of this specification
551+
552+
## OAuth Extensions Error Registration
553+
554+
This specification requests registration of the following values in the IANA "OAuth Extensions Error Registry" registry of {{IANA.OAuth.Params}} established by {{RFC6749}}.
555+
556+
* Name: use_attestation_challenge
557+
* Usage Location: token error response, resource access error response
558+
* Protocol Extension: OAuth 2.0 Attestation-Based Client Authentication
559+
* Change Controller: IETF
560+
* Reference: this specification
561+
562+
* Name: invalid_client_attestation
563+
* Usage Location: token error response, resource access error response
564+
* Protocol Extension: OAuth 2.0 Attestation-Based Client Authentication
499565
* Change Controller: IETF
500-
* Reference: [](#nonce-retrieval) of this specification
566+
* Reference: this specification
501567

502568
## Registration of attest_jwt_client_auth Token Endpoint Authentication Method
503569

@@ -522,22 +588,22 @@ This section requests registration of the following scheme in the "Hypertext Tra
522588

523589
<br/>
524590

525-
* Field Name: attestation-nonce-request
526-
* Status: permanent
527-
* Reference: [](#nonce-retrieval) of this specification
528-
529-
<br/>
530-
531-
* Field Name: attestation-nonce
591+
* Field Name: OAuth-Client-Attestation-Challenge
532592
* Status: permanent
533-
* Reference: [](#nonce-retrieval) of this specification
593+
* Reference: [](#challenge-retrieval) of this specification
534594
--- back
535595

536596
# Document History
537597

538598
-06
539599

540600
* clarify usage of client attestation outside of oauth2 applications
601+
* add oauth error response values `invalid_client_attestation` and `use_attestation_challenge`
602+
* revert the HTTP OPTIONS mechanism to fetch nonces and add a dedicated challenge endpoint
603+
* rename nonce to challenge
604+
* rewrite security consideration on replay attacks
605+
* add implementation consideration on replay attacks
606+
* remove `exp` from Client Attestation PoP JWT
541607

542608
-05
543609

0 commit comments

Comments
 (0)