Briefing · Article · source · published · Boston Identity
RFC 8414 tells an OAuth client to discard server metadata whose issuer differs from the URL it started from
RFC 8414, published in June 2018 by Michael Jones, Nat Sakimura and John Bradley, defines the JSON document an OAuth client reads to learn a server's endpoints and keys. It generalizes OpenID Connect Discovery. Only two fields are required outright. If the issuer in the document is not identical to the issuer URL the client fetched from, the data must not be used.
RFC Editor · Michael B. Jones, Nat Sakimura, John Bradley · June 1, 2018 · read
What's happening
Finding4Under RFC 8414, metadata whose issuer is not identical to the one the client built the URL from MUST NOT be used, the client's guard against a fake server.
RFC 8414 makes the issuer value the client's guard against a fake authorization server. The client builds the metadata URL from the issuer identifier, and the "issuer" the document returns MUST be identical to it; if the two differ, the RFC says "the data contained in the response MUST NOT be used." Section 6.2 names the attack this blocks: a document that claims a real server's issuer but lists the attacker's own endpoints and signing keys. Clients MUST also check the TLS certificate, which the authors say prevents man-in-the-middle and DNS-based attacks. Section 4 sets what identical means: strings are compared code point by code point, and Unicode normalization MUST NOT be applied. A client that supports signed metadata MUST let the values in the signed JWT take precedence over the plain JSON ones.
flag a problem with BI-FIND-2018-0001
Figure steps
- The client inserts the well-known string between the host and the issuer's path. OpenID Connect Discovery would append it after the path instead.
- It fetches the document over HTTPS and must check that the TLS certificate is valid for the issuer URL.
- The issuer in the document must be identical to the issuer URL the client started from. If it is not, the client must not use the data.
- Only then does the client use the endpoints and keys the document lists.
A client uses a server's metadata only after two checks: the TLS certificate must fit the issuer URL, and the issuer the document names must be identical to the URL the client started from.
Drawn from RFC 8414, Sections 3, 5 and 6.2Source dated June 1, 2018Passage: Section 2
Swipe for the full figure →
For an issuer with a path, RFC 8414 puts the well-known string between the host and the path, while OpenID Connect Discovery appends it after the path.
For an issuer with a path, such as https://example.com/issuer1, RFC 8414 puts the well-known string between the host and the path, while OpenID Connect Discovery appends it after the path. With no path, the two give the same URL. Section 5 says metadata locations should use the RFC's form going forward. Where the OpenID form is already in use, servers may need to publish at both locations for a transition period. Clients should try the RFC location first and fall back only if that fetch fails, a step the RFC expects to need only when the suffix is openid-configuration.
flag a problem with BI-FIND-2018-0002
Only two server metadata fields are required outright, issuer and response_types_supported, so a client cannot assume most fields are there.
Only two fields are required outright: issuer and response_types_supported. The authorization and token endpoints are required unless the server's grant types do not use them. Most other fields are optional, scopes_supported is RECOMMENDED, and a few become required only when a related value is listed, which means a client cannot assume most fields are there. Some absences carry meaning: a server that omits code_challenge_methods_supported does not support PKCE. New fields go into an IANA registry the RFC creates with 23 initial entries, on a Specification Required basis after a two-week review period. Our briefings on two later OAuth drafts found each adding its own metadata field.
flag a problem with BI-FIND-2018-0003
Section 6.4 puts out of scope the secure choice, for all use cases, of which protected resources a client uses with an authorization server.
Section 6.4 puts the secure choice of which protected resources to use with an authorization server "for all use cases" out of scope. It assumes the client already has a way, calls the means application dependent and gives examples, such as a fixed set of resources or locations the server publishes as metadata. It warns that if a client uses an inappropriate resource, an attacker may be able to act as a man-in-the-middle proxy to a valid one without the server or the client noticing. We read later work as closing that gap from the resource side: our briefing on the MCP authorization spec found it requires MCP servers to publish protected resource metadata naming their authorization server.
flag a problem with BI-FIND-2018-0004
Section by section
4showing 4 of 4
[1]Metadata format and signed metadata
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
Standards
Metadata format and signed metadata
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
RFC 8414 defines a JSON document an OAuth client reads to learn an authorization server's endpoints and capabilities, generalizing OpenID Connect Discovery. Only issuer and response_types_supported are unconditionally REQUIRED; most other fields are optional. Metadata may also be carried as a signed JWT (signed_metadata), which takes precedence if supported.
technical artifactfrom published text
[2]Retrieval, well-known path and OpenID compatibility
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
Standards
Retrieval, well-known path and OpenID compatibility
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
Servers that support metadata MUST serve the document by HTTPS GET at /.well-known/oauth-authorization-server, inserted between the host and any path in the issuer. The issuer the document returns MUST equal the issuer URL used to fetch it. With a path, this differs from OpenID Connect Discovery, which appends the string; during a transition, clients should try the RFC location first and fall back to the OpenID one only if that fails.
technical artifactfrom published text
[3]Security considerations and string comparison
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
Standards
Security considerations and string comparison
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
Clients MUST check the TLS certificate and that the issuer matches the fetch URL, which blocks a rogue metadata document naming an impersonated issuer. Choosing which protected resources suit a server is out of scope. A standard format helps attackers as well as clients. String comparison is code-point exact, with no Unicode normalization.
technical artifactfrom published text
[4]IANA registries and well-known URI
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
Standards
IANA registries and well-known URI
Michael B. Jones, Microsoft · Nat Sakimura, Nomura Research Institute · John Bradley, Yubico
The RFC creates the IANA OAuth Authorization Server Metadata registry, with registration on a Specification Required basis after a two-week review period and 23 initial entries, and registers the oauth-authorization-server well-known suffix. Other specifications add their metadata fields through this registry.
technical artifactfrom published text
