Skip to content
IAM Insights

Briefing · Article · source · published · Boston Identity

OAuth's resource indicators RFC says servers should bind tokens to a resource, but requires it of neither side

RFC 8707, published in February 2020 by Brian Campbell, John Bradley and Hannes Tschofenig, adds a resource parameter that tells an OAuth authorization server where a token will be used, so the server can limit the token to that place. Both halves stay optional in the text. The security section is blunter about bearer tokens with several audiences: any one of those resources can use the token at the others.

RFC Editor · Brian Campbell, John Bradley, Hannes Tschofenig · February 1, 2020 · read

share
3,506 words. With Brian Campbell, author, Ping Identity; John Bradley, author, Yubico; Hannes Tschofenig, author, Arm Limited.
01

What's happening

Finding3
BI-FIND-2020-0005Lead finding

RFC 8707 gives an OAuth client a resource parameter for naming where it will use a token, and makes that step mandatory for neither client nor server.

RFC 8707 gives an OAuth client a resource parameter for naming where it will use a token, and makes the step mandatory for neither side. A client MAY send the parameter, and the authorization server SHOULD then limit the audience of the access tokens it issues to the resources named. If the client leaves it out, the server may process the request with no specific resource or with a predefined default, or it may reject the request with an invalid_target error. The authors' motivation notes that scope is sometimes overloaded to carry a resource's location, while other scope values say only what kind of access is wanted.

high confidencebest source: independent researchobserved Feb 2020EvidenceThe resource parameter and invalid_targetSection 1
flag a problem with BI-FIND-2020-0005
BI-FIND-2020-0006

A bearer token with several audiences can be used by any one of those resources to access any of the others, the RFC's security section warns.

The RFC's security section warns that a bearer token with several audiences "can be used by any one of those resources to access any of the others." It encourages a single resource value per token request, says tokens with several audiences need a high degree of trust between the parties, and tells multi-tenant servers to put the tenant in the resource URI so a token issued for one tenant fails at another. Where the resource value is an abstract identifier rather than a network address, the client has to check out of band that every endpoint it sends tokens to is the intended audience.

high confidencebest source: independent researchobserved Feb 2020EvidenceSecurity and privacy considerations
flag a problem with BI-FIND-2020-0006
Fig. 1

A token limited to one resource is refused when that resource replays it elsewhere; a bearer token naming two audiences works for either resource at the other.

Drawn from RFC 8707, Sections 2 and 3Source dated February 1, 2020Passage: Security and privacy considerations

Swipe for the full figure →

BI-FIND-2020-0007

In the authorization-code case, a client asking for a subset of its grant gets an access token for the subset, but any refresh token keeps the full grant.

At the token endpoint the parameter works for all grant types, and the RFC reads a request with several scopes and several resources as asking for "the cartesian product of all the scopes at all the target services." Which resources the server accepts is "at its sole discretion", and the text says that, where possible, it should downscope each access token to what that resource can process and needs to know, a lowercase should that is not one of the RFC's formal requirement keywords. In the authorization-code case, a client asking for a subset of the original grant gets an access token for the subset, while any refresh token returned stays bound to the full original grant.

high confidencebest source: independent researchobserved Feb 2020EvidenceSection 3
flag a problem with BI-FIND-2020-0007
02

Section by section

4

showing 4 of 4

[1]

Why a client must say where a token will be used

Brian Campbell, Ping Identity · John Bradley, Yubico · Hannes Tschofenig, Arm Limited

Standards

Campbell, Bradley and Tschofenig write that years of OAuth deployment showed a need, at authorization servers serving many different resources, for the client to say where it will use a token. Knowing the resource lets the server build the token for it, for example by encrypting it to that resource, and restrict its audience. Scope is sometimes overloaded to carry that location, and other scope values carry only the type of access. The RFC offers a standard alternative to the proprietary parameters some deployments already use.

technical artifactfrom published text

[2]

The resource parameter and invalid_target

Brian Campbell, Ping Identity · John Bradley, Yubico · Hannes Tschofenig, Arm Limited

Standards

Section 2 defines the resource parameter as an absolute URI that MUST NOT include a fragment and SHOULD NOT include a query, and a client can repeat it to name several resources. The authorization server SHOULD restrict tokens to the resources named, which a JWT carries in its aud claim and an introspection response can also report. A server may accept a request without the parameter or reject it with invalid_target. Clients SHOULD use the most specific URI they can, normally the API's base URI.

technical artifactfrom published text

[3]

Resource on the token request, refresh and downscoping

Brian Campbell, Ping Identity · John Bradley, Yubico · Hannes Tschofenig, Arm Limited

Standards

The same parameter works at the token endpoint for every grant type. The server alone decides which resources it will accept, and for code and refresh grants it may hold them to the original grant or a subset. A request for several scopes at several resources asks for every scope at every resource, and the RFC says the server should cut each token down to what its resource needs.

technical artifactfrom published text

[4]

Security and privacy considerations

Brian Campbell, Ping Identity · John Bradley, Yubico · Hannes Tschofenig, Arm Limited

Standards

Audience restriction stops a resource that receives a token from replaying it at another one. Multi-tenant servers should put the tenant in the resource URI, and the RFC encourages a single resource value per request because a bearer token with several audiences lets each of those resources reach the others. When the resource is an abstract identifier, the client is responsible for checking out of band where its tokens go. On privacy, the parameter may let the authorization server track behaviour in finer detail when introspection is not used.

technical artifactfrom published text

Terms used

Resource Indicators for OAuth 2.0
An OAuth extension (RFC 8707) letting a client name the resource server a token is for, via a resource parameter, so the token works at one audience only.
OAuth
The web's standard framework for delegated authorization — letting one application act at another on a user's (or machine's) behalf without sharing passwords.
Bearer token
A token that works for whoever holds it, so a stolen copy can be replayed until it expires.
Access token
An OAuth 2.0 credential, usually an opaque string, representing a specific scope and lifetime of access that the resource server enforces when a client presents it.
RFC
Request for Comments: the numbered document series in which the Internet Engineering Task Force publishes internet specifications, from standards such as RFC 8693 to informational notes. A draft is not an RFC.
URI
Uniform Resource Identifier, the general form of a web address. Identity specs use URIs to name things unambiguously: an issuer, an audience, a resource, or a workload's identity in SPIFFE.
Refresh token
An OAuth 2.0 credential issued with an access token that the client presents only to the authorization server to get a new access token of identical or narrower scope.
JWT
A compact, signed token that carries claims (who, for what, until when) between systems. It is the usual shape of an OAuth access token.

Read next

Shares JWT-Secured Authorization Request (JAR, RFC 9101), RFC 6750 (OAuth 2.0 Bearer Token Usage) and Uniform Resource Identifier (URI): Generic Syntax (RFC 3986) with Signed OAuth requests can be bypassed until the server refuses unsigned ones, and RFC 9101 leaves that off by default.

Shares JWT-Secured Authorization Request (JAR, RFC 9101), RFC 6750 (OAuth 2.0 Bearer Token Usage) and Uniform Resource Identifier (URI): Generic Syntax (RFC 3986) with OpenID Connect Core says only issuer plus subject identify a user; email must never be the key.

Shares JWT-Secured Authorization Request (JAR, RFC 9101), RFC 6750 (OAuth 2.0 Bearer Token Usage) and Resource Indicators for OAuth 2.0 with RFC 9700 bans OAuth's password grant and loose redirect matching; binding access tokens stays a SHOULD.

Was this briefing useful?

Share this briefing

Every finding, forecast and open question on this site has a permanent ID. If we reword one, its ID stays the same, so a citation keeps pointing to the same claim.

Follow us on LinkedInRSS feed

Working on an identity problem this research touches? Talk to Boston Identity