rfc-9101

The OAuth 2.0 Authorization Framework: JWT-Secured Authorization Request (JAR)

N. Sakimura, J. Bradley, M. Jones
date2021-08 streamIETF areasec wgoauth statusPROPOSED STANDARD pages25 canonicalhttps://www.rfc-editor.org/rfc/rfc9101 doi10.17487/RFC9101
The authorization request in OAuth 2.0 described in RFC 6749 utilizes query parameter serialization, which means that authorization request parameters are encoded in the URI of the request and sent through user agents such as web browsers. While it is easy to implement, it means that a) the communication through the user agents is not integrity protected and thus, the parameters can be tainted, b) the source of the communication is not authenticated, and c) the communication through the user agents can be monitored. Because of these weaknesses, several attacks to the protocol have now been put forward. This document introduces the ability to send request parameters in a JSON Web Token (JWT) instead, which allows the request to be signed with JSON Web Signature (JWS) and encrypted with JSON Web Encryption (JWE) so that the integrity, source authentication, and confidentiality properties of the authorization request are attained. The request can be sent by value or by reference.

Extracted elements (28)

design-rationale §9.1

JWT claims 'iss', 'sub', 'aud', 'exp', 'nbf', 'iat', and 'jti' are registered as OAuth parameters not because JAR uses all of them, but to prevent future OAuth extensions from assigning them different meanings — since the Request Object is a JWT, these claims have fixed JWT semantics.

oauth, jose, registry

design-rationale §1

JWT was chosen as the encoding for authorization requests due to its close relationship with JSON (OAuth's response format), developer friendliness, compactness compared to XML, Proposed Standard status, and relative ease of JWS/JWE compared to XML Signature and Encryption.

oauth, jose, json

interoperability-note §4

Some existing deployments may use the media type 'application/jwt' for Request Objects instead of the registered 'application/oauth-authz-req+jwt'. Similarly, requiring explicit typing ('typ':'oauth-authz-req+jwt') would break most existing deployments using OpenID Connect, as existing clients commonly use untyped Request Objects.

oauth, jose, interoperability

normative-requirement §8 MUST

Client implementations supporting the Request Object URI method MUST support TLS per RFC 7525. Confidentiality protection MUST be applied using TLS with a cipher suite providing both confidentiality and integrity. HTTP clients MUST verify the TLS server certificate using DNS-ID to prevent MITM attacks.

oauth, tls, security

normative-requirement §6.1 MUST

If the Request Object is encrypted, the authorization server MUST decrypt it per RFC 7516. If decryption fails, the server MUST return an 'invalid_request_object' error.

oauth, jose, crypto

normative-requirement §4 SHOULD

If the signed Request Object includes 'iss' and 'aud' claims, SHOULD be present with the 'aud' value set to the authorization server's 'issuer' as defined in RFC 8414. The 'request' and 'request_uri' parameters MUST NOT appear inside a Request Object.

oauth, jose

normative-requirement §5 MUST

The Authorization Request Object MUST be either JWS-signed or JWS-signed and JWE-encrypted. 'request' and 'request_uri' parameters MUST NOT be included in Request Objects.

oauth, jose, security

normative-requirement §6.2 MUST

The authorization server MUST validate the JWS signature of the Request Object using a key associated with the client. Algorithm verification MUST be performed per Sections 3.1 and 3.2 of RFC 8725. Signature validation failure MUST result in an 'invalid_request_object' error.

oauth, jose, crypto, security

normative-requirement §6.3 MUST

The authorization server supporting JAR MUST only use the parameters included in the Request Object, even if the same parameter is duplicated in query parameters. The 'client_id' in the query parameter and in the Request Object claim MUST be identical.

oauth, security

normative-requirement §5.2 SHOULD NOT

The entire Request Object URI SHOULD NOT exceed 512 ASCII characters to accommodate mobile device URI length restrictions and low-bandwidth connections.

oauth, interoperability

normative-requirement §4 MUST

The Request Object MUST contain all parameters used to process the OAuth 2.0 authorization request except 'request' and 'request_uri'. Parameter names and string values MUST be included as JSON strings encoded using UTF-8; numerical values MUST be included as JSON numbers.

oauth, jose, json

normative-requirement §5.2.1 MUST

The 'request_uri' MUST have appropriate entropy so the URI is not guessable if publicly retrievable. It is RECOMMENDED that the 'request_uri' be removed after a reasonable timeout unless access control measures are taken.

oauth, security, privacy

normative-requirement §8 MUST

TLS clients MUST support DNS-ID (dNSName in subjectAltName) for server certificate verification. Clients MUST NOT use CN-ID identifiers for authentication. SRV-ID and URI-ID MUST NOT be used for comparison.

tls, pkix, security

normative-requirement §5.2.3 MUST

Upon receipt of an authorization request with 'request_uri', the authorization server MUST send an HTTP GET to retrieve the referenced Request Object unless it can retrieve it securely through other mechanisms.

oauth, http

normative-requirement §4 MUST

When both signature and encryption are applied to a Request Object, the JWT MUST be signed first, then encrypted, producing a Nested JWT as defined in RFC 7519.

oauth, jose, crypto

privacy-consideration §11.2.1

If the authorization request contains potentially sensitive parameters, the client SHOULD encrypt the Request Object using JWE, since URI query parameters can leak through referrer headers and browser history.

oauth, privacy, jose

privacy-consideration §11.2.2

Per-user persistent Request Object URIs should be avoided as they can enable user tracking through browser history correlation. Single-use Request Object URIs are recommended as an alternative.

oauth, privacy

protocol-element §2.1

A Request Object is a JWT whose Claims Set holds JSON-encoded OAuth 2.0 authorization request parameters. It must be either JWS-signed or JWS-signed then JWE-encrypted, and carries the media type 'application/oauth-authz-req+jwt'.

oauth, jose, crypto, security

protocol-element §2.2

A Request Object URI is an absolute URI referencing a Request Object resource. When provided by the client (not by the authorization server), it must be an HTTPS URI; when provided by the authorization server, it must be a URN.

oauth, security

protocol-element §7

JAR defines four new error codes for authorization server responses: 'invalid_request_uri' (request_uri returned error or invalid data), 'invalid_request_object' (invalid Request Object), 'request_not_supported', and 'request_uri_not_supported'.

oauth

registry §9.1

This specification registers 'request' and 'request_uri' as OAuth authorization request parameters, and also registers JWT claims 'iss', 'sub', 'aud', 'exp', 'nbf', 'iat', and 'jti' in the OAuth Parameters registry to prevent future OAuth extensions from reusing them with different meanings.

oauth, registry, jose

registry §9.2

This specification registers 'require_signed_request_object' in both the OAuth Authorization Server Metadata registry and the OAuth Dynamic Client Registration Metadata registry, indicating whether authorization requests must be protected as Request Objects.

oauth, registry

registry §9.4.1

This specification registers the media type 'application/oauth-authz-req+jwt' in the IANA Media Types registry. The encoding is binary (base64url-encoded values separated by period characters), used to indicate content is a JWT containing Request Object claims.

oauth, registry, jose, json

security-consideration §10.4.1

A set of malicious clients can launch DoS attacks against the authorization server by pointing 'request_uri' to large, slow, or recursive URIs. The server should validate URI destinations, check media types, implement timeouts, and prohibit recursive lookups.

oauth, security

security-consideration §10.4.2

The 'request_uri' parameter is not signed and can be tampered with by a man-in-the-browser attacker, enabling scope elevation or DoS attacks. Mitigations include validating the URI points to an expected location, verifying the 'application/oauth-authz-req+jwt' media type, implementing timeouts, and not performing recursive GET on the URI.

oauth, security

security-consideration §10.2

The source of the authorization request MUST always be verified via JWS signature verification, symmetric JWE key verification, TLS server identity verification (with caveats), or client authentication when exchanging Request Objects for URIs. Request Object URIs issued by an AS service MUST have short lifetime (under a minute) and 128-bit minimum entropy.

oauth, security, crypto

security-consideration §10.8

To prevent cross-JWT confusion attacks (using a Request Object as a client authentication JWT), implementers should never use the client ID as the 'sub' value, use explicit typing with 'typ':'oauth-authz-req+jwt' in the header, or use keys identifiably distinct from keys used for other purposes.

oauth, jose, security, crypto

security-consideration §10.5

To prevent downgrade attacks where an attacker bypasses JAR protections using plain RFC 6749 requests, the 'require_signed_request_object' metadata value (boolean) can be set to true on the server, causing it to MUST reject non-JAR requests and requests using 'alg':'none'.

oauth, security