In addition to all the [
RFC 6819], the security considerations in [
RFC 7515], [
RFC 7516], [
RFC 7518], and [
RFC 8725] need to be considered. Also, there are several academic papers such as [
BASIN] that provide useful insight into the security properties of protocols like OAuth.
In consideration of the above, this document advises taking the following security considerations into account.
When sending the Authorization Request Object through the
request parameter, it
MUST be either signed using [
RFC 7515] or signed and then encrypted using [
RFC 7515] and [
RFC 7516], respectively, with algorithms considered appropriate at the time.
The source of the authorization request
MUST always be verified. There are several ways to do it:
- (a)
- Verifying the JWS Signature of the Request Object.
- (b)
- Verifying that the symmetric key for the JWE encryption is the correct one if the JWE is using symmetric encryption. Note, however, that if public key encryption is used, no source authentication is enabled by the encryption, as any party can encrypt to the public key.
- (c)
- Verifying the TLS Server Identity of the Request Object URI. In this case, the authorization server MUST know out-of-band that the client uses the Request Object URI and only the client is covered by the TLS certificate. In general, this is not a reliable method.
- (d)
- When an authorization server implements a service that returns a Request Object URI in exchange for a Request Object, the authorization server MUST perform client authentication to accept the Request Object and bind the client identifier to the Request Object URI it is providing. It MUST validate the signature, per (a). Since the Request Object URI can be replayed, the lifetime of the Request Object URI MUST be short and preferably one-time use. The entropy of the Request Object URI MUST be sufficiently large. The adequate shortness of the validity and the entropy of the Request Object URI depends on the risk calculation based on the value of the resource being protected. A general guidance for the validity time would be less than a minute, and the Request Object URI is to include a cryptographic random value of 128 bits or more at the time of the writing of this specification.
- (e)
- When a trusted third-party service returns a Request Object URI in exchange for a Request Object, it MUST validate the signature, per (a). In addition, the authorization server MUST be trusted by the third-party service and MUST know out-of-band that the client is also trusted by it.
Although this specification does not require them, research such as [
BASIN] points out that it is a good practice to explicitly state the intended interaction endpoints and the message position in the sequence in a tamper-evident manner so that the intent of the initiator is unambiguous. It is
RECOMMENDED by this specification to use this practice for the following endpoints defined in [
RFC 6749], [
RFC 6750], and [
RFC 8414]:
- (a)
- Protected resources (protected_resources)
- (b)
- Authorization endpoint (authorization_endpoint)
- (c)
- Redirection URI (redirect_uri)
- (d)
- Token endpoint (token_endpoint)
Further, if dynamic discovery is used, then this practice also applies to the discovery-related endpoints.
In [
RFC 6749], while the redirection URI is included in the authorization request, others are not. As a result, the same applies to the Authorization Request Object.
The introduction of
request_uri introduces several attack possibilities. Consult the security considerations in
Section 7 of
RFC 3986 for more information regarding risks associated with URIs.
A set of malicious clients can launch a DoS attack to the authorization server by pointing the
request_uri to a URI that returns extremely large content or is extremely slow to respond. Under such an attack, the server may use up its resource and start failing.
Similarly, a malicious client can specify a
request_uri value that itself points to an authorization request URI that uses
request_uri to cause the recursive lookup.
To prevent such an attack from succeeding, the server should a) check that the value of the
request_uri parameter does not point to an unexpected location, b) check that the media type of the response is
application/oauth-authz-req+jwt, c) implement a timeout for obtaining the content of
request_uri, and d) not perform recursive GET on the
request_uri.
The value of
request_uri is not signed; thus, it can be tampered with by a man-in-the-browser attacker. Several attack possibilities arise because of this. For example, a) an attacker may create another file that the rewritten URI points to, making it possible to request extra scope, or b) an attacker may launch a DoS attack on a victim site by setting the value of
request_uri to be that of the victim.
To prevent such an attack from succeeding, the server should a) check that the value of the
request_uri parameter does not point to an unexpected location, b) check that the media type of the response is
application/oauth-authz-req+jwt, and c) implement a timeout for obtaining the content of
request_uri.
Unless the protocol used by the client and the server is locked down to use an OAuth JWT-Secured Authorization Request (JAR), it is possible for an attacker to use
RFC 6749 requests to bypass all the protection provided by this specification.
To prevent this kind of attack, this specification defines new client metadata and server metadata values, both named
require_signed_request_object, whose values are both booleans.
When the value of it as client metadata is
true, then the server
MUST reject the authorization request from the client that does not conform to this specification. It
MUST also reject the request if the Request Object uses an
alg value of
none when this server metadata value is
true. If omitted, the default value is
false.
When the value of it as server metadata is
true, then the server
MUST reject the authorization request from any client that does not conform to this specification. It
MUST also reject the request if the Request Object uses an
alg value of
none. If omitted, the default value is
false.
Note that even if
require_signed_request_object metadata values are not present, the client
MAY use signed Request Objects, provided that there are signing algorithms mutually supported by the client and the server. Use of signing algorithm metadata is described in
Section 4.
Given that OAuth parameter values are being sent in two different places, as normal OAuth parameters and as Request Object claims, implementations must guard against attacks that could use mismatching parameter values to obtain unintended outcomes. That is the reason that the two client ID values
MUST match, the reason that only the parameter values from the Request Object are to be used, and the reason that neither
request nor
request_uri can appear in a Request Object.
As described in
Section 2.8 of
RFC 8725, attackers may attempt to use a JWT issued for one purpose in a context that it was not intended for. The mitigations described for these attacks can be applied to Request Objects.
One way that an attacker might attempt to repurpose a Request Object is to try to use it as a client authentication JWT, as described in
Section 2.2 of
RFC 7523. A simple way to prevent this is to never use the client ID as the
sub value in a Request Object.
Another way to prevent cross-JWT confusion is to use explicit typing, as described in
Section 3.11 of
RFC 8725. One would explicitly type a Request Object by including a
typ Header Parameter with the value
oauth-authz-req+jwt (which is registered in
Section 9.4.1). Note, however, that requiring explicitly typed Request Objects at existing authorization servers will break most existing deployments, as existing clients are already commonly using untyped Request Objects, especially with OpenID Connect [
OpenID.Core]. However, requiring explicit typing would be a good idea for new OAuth deployment profiles where compatibility with existing deployments is not a consideration.
Finally, yet another way to prevent cross-JWT confusion is to use a key management regime in which keys used to sign Request Objects are identifiably distinct from those used for other purposes. Then, if an adversary attempts to repurpose the Request Object in another context, a key mismatch will occur, thwarting the attack.