Skip to content

Commit 2ab07d7

Browse files
authored
Merge pull request #27 from oauth-wg/mbj-aaron
Incorporate Aaron Parecki's review suggestions
2 parents 64ebc82 + e8f63bd commit 2ab07d7

File tree

1 file changed

+43
-17
lines changed

1 file changed

+43
-17
lines changed

draft-ietf-oauth-rfc8725bis.md

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,22 @@ informative:
125125
date: December 2023
126126
target: https://openid.net/specs/openid-connect-core-1_0.html
127127
title: OpenID Connect Core 1.0 incorporating errata set 2
128+
OpenID.Backchannel:
129+
author:
130+
- ins: M. Jones
131+
name: Michael B. Jones
132+
- ins: J. Bradley
133+
name: John Bradley
134+
date: December 2023
135+
target: https://openid.net/specs/openid-connect-backchannel-1_0.html
136+
title: OpenID Connect Back-Channel Logout 1.0 incorporating errata set 1
128137
RFC6749:
129138
RFC7159:
130139
RFC7517:
131140
RFC8414:
132141
RFC8417:
142+
RFC9068:
143+
RFC9700:
133144
Sanso:
134145
author:
135146
- ins: A. Sanso
@@ -188,10 +199,10 @@ that contain a set of claims that can be signed and/or encrypted.
188199
The JWT specification has seen rapid adoption because it encapsulates
189200
security-relevant information in one easy-to-protect location, and because
190201
it is easy to implement using widely available tools.
191-
One application area in which JWTs are commonly used is representing digital identity information,
192-
such as OpenID Connect ID Tokens {{OpenID.Core}}
193-
and OAuth 2.0 {{RFC6749}} access tokens and
194-
refresh tokens, the details of which are deployment-specific.
202+
One application area in which JWTs are commonly used is
203+
representing authorization information, such as OAuth 2.0 access tokens {{RFC9068}},
204+
and identity information, such as OpenID Connect ID Tokens {{OpenID.Core}}.
205+
The details of these uses are application- and deployment-specific.
195206

196207
Since the JWT specification was published, there have been several widely published
197208
attacks on implementations and deployments.
@@ -474,11 +485,6 @@ This set will vary over time as new algorithms are introduced
474485
and existing algorithms are deprecated due to discovered cryptographic weaknesses.
475486
Applications MUST therefore be designed to enable cryptographic agility.
476487

477-
That said, if a JWT is cryptographically protected end-to-end by a
478-
transport layer, such as TLS
479-
using cryptographically current algorithms, there may be no need to apply another layer of
480-
cryptographic protections to the JWT.
481-
In such cases, the use of the "none" algorithm can be perfectly acceptable.
482488
The "none" algorithm should only be used when the JWT is cryptographically protected by other means.
483489
JWTs using "none" are often used in application contexts in which the content is optionally signed.
484490
The URL-safe claims representation and processing in this context can be the same in both
@@ -515,7 +521,8 @@ without new algorithm identifiers being required.
515521
All cryptographic operations used in the JWT MUST be validated and the entire JWT MUST be rejected
516522
if any of them fail to validate.
517523
This is true not only of JWTs with a single set of Header Parameters
518-
but also for Nested JWTs in which both outer and inner operations MUST be validated
524+
but also for Nested JWTs, as defined in {{Section 2 of RFC7519}},
525+
in which both outer and inner operations MUST be validated
519526
using the keys and algorithms supplied by the application.
520527

521528
Libraries MUST allow the verifier to distinguish between signed JWTs (JWSes) and encrypted JWTs (JWEs).
@@ -593,17 +600,19 @@ used for the cryptographic operations in the JWT belong to the issuer.
593600
If they do not, the application MUST reject the JWT.
594601

595602
The means of determining the keys owned by an issuer is application-specific.
596-
As one example, OpenID Connect {{OpenID.Core}}
597-
issuer values are "https" URLs
603+
As one example, OAuth 2.0 authorization server "issuer" values {{RFC8414}}
604+
are "https" URLs
598605
that reference a JSON metadata document that contains a "jwks_uri" value that is
599606
an "https" URL from which the issuer's keys are retrieved as a JWK Set {{RFC7517}}.
600-
This same mechanism is used by {{RFC8414}}.
607+
This same mechanism is used by OpenID Connect {{OpenID.Core}}.
601608
Other applications may use different means of binding keys to issuers.
602609

603610
Similarly, when the JWT contains a "sub" (subject) claim, the
604611
application MUST validate that
605612
the subject value corresponds to a valid subject and/or issuer-subject pair at the application.
606613
This may include confirming that the issuer is trusted by the application.
614+
In the OAuth context, {{Section 4.15 of RFC9700}} discusses the possibility of
615+
confusing user identifier and client ID values.
607616
If the issuer, subject, or the pair are invalid, the application
608617
MUST reject the JWT.
609618

@@ -633,16 +642,21 @@ and/or sanitizing the received value.
633642
Similarly, blindly following a "jku" (JWK set URL) or "x5u" (X.509 URL) header,
634643
which may contain an arbitrary URL,
635644
could result in server-side request forgery (SSRF) attacks. Applications SHOULD protect against such
636-
attacks, e.g., by matching the URL to a whitelist of allowed locations
645+
attacks, e.g., by matching the URL to an allowlist of permitted locations
637646
and ensuring no cookies are sent in the GET request.
638647

639-
648+
When such an allowlist is not available, the authorization server SHOULD check what a hostname resolves to
649+
and avoid making a request if it resolves to a loopback or local IP address.
650+
An example of this is when "attacker.example.com/etc/passwd" is used
651+
as the "jwks_uri" value and there is a DNS entry for "attacker.example.com"
652+
that resolves to "127.0.0.1" or other local IP address values.
640653

641654

642655
## Use Explicit Typing {#use-typ}
643656

644-
645-
Sometimes, one kind of JWT can be confused for another. If a particular
657+
When two different uses of JWTs share a common set of claims,
658+
one kind of JWT can be confused for another.
659+
If a particular
646660
kind of JWT is subject to such confusion, that JWT can include an explicit
647661
JWT type value, and the validation rules can specify checking the type.
648662
This mechanism can prevent such confusion.
@@ -651,6 +665,14 @@ For instance, the {{RFC8417}} specification uses
651665
the "application/secevent+jwt" media type
652666
to perform explicit typing of Security Event Tokens (SETs).
653667

668+
An example of an ad-hoc means of preventing confusion
669+
between different kinds of JWTs is the requirement in
670+
Logout Tokens {{OpenID.Backchannel}} prohibiting the inclusion of a "nonce" claim
671+
so that Logout Tokens will fail the validation rules for ID Tokens {{OpenID.Core}}.
672+
The use of explicit typing avoids the need for employing such ad-hoc mechanisms
673+
when the validation rules for both kinds of JWTs include validating the "typ" values
674+
and the acceptable "typ" values for the two kinds of JWTs are distinct.
675+
654676
Per the definition of "typ" in Section 4.1.9 of [RFC7515], it is RECOMMENDED that the "application/" prefix
655677
be omitted from the "typ" Header Parameter value, compared to the associated media type.
656678
Therefore, for example, the "typ" value used to explicitly include a type for a SET SHOULD be "secevent+jwt".
@@ -801,6 +823,10 @@ This document obsoletes RFC 8725 and provides several significant improvements a
801823

802824
[[Note to RFC Editor: please remove before publication.]]
803825

826+
## draft-ietf-oauth-rfc8725bis-02
827+
828+
* Incorporated Aaron Parecki's review suggestions.
829+
804830
## draft-ietf-oauth-rfc8725bis-01
805831

806832
* Applied editorial suggestions by Dan Moore.

0 commit comments

Comments
 (0)