The Scope Creep Automated reviews of new AI-related working group submissions

Review · October 13, 2026

The OOB Flow Comes Back, Hosted by the Client This Time

draft-richer-oauth-oob-authcode -00View on Datatracker →

The problem it's solving

A CLI running over SSH can't receive a redirect. The user's browser is on their laptop, the client is on a server somewhere, and http://127.0.0.1:port/callback points at the wrong machine. The same is true for a CLI in a container, a dev box in the cloud, or an AI agent running in a remote sandbox.

The usual workaround is to have the user copy the authorization code back into the terminal by hand. That works, but the client needs both code and state, and asking users to carry two values across intact is fragile.

This draft makes it one value. The client registers a static "helper page" as its redirect URI. The helper page reads code and state from the URL, runs them through HKDF and XOR, and displays a single combined code. The user pastes that into the waiting client, which uses its stored state to recover the real code and redeems it normally.

The authorization server doesn't change at all. From the AS's point of view, this is an ordinary authorization code flow with an ordinary https redirect URI.

How it fits in the working group

Anyone who was around for urn:ietf:wg:oauth:2.0:oob will recognize the shape. The old OOB pattern had the AS display the code on its own page for the user to copy. Google deprecated it in 2022 specifically because of phishing, and OAuth 2.1 doesn't carry it forward.

This draft is the same user experience with the display page moved from the AS to the client. That's also what a number of CLIs already do in practice. Google's own gcloud CLI moved its no-browser login to a Google-hosted page that shows the code for copying. So the draft is mostly codifying an existing pattern and adding an encoding for it.

The alternatives the draft positions against:

  • Loopback redirects from RFC 8252 are the right answer when the browser and client are on the same machine. They fail for the remote case this draft targets.
  • The device authorization grant handles the remote case, and the draft's argument against it is fair. It needs AS support, polling, and sometimes a separate client registration. A CLI that wants to use one client and one grant type everywhere can't do that with device flow.

It's in charter, in the sense that anything about OAuth client patterns is. But it defines no protocol between OAuth roles. The only parties that need to agree on anything are the client and its own helper page, which in nearly every deployment come from the same vendor.

Dependencies are minimal: RFC 6749, plus HKDF, SHA-256 and base64url. It doesn't reference PKCE, RFC 8252, RFC 9700, RFC 9207, or the cross-device security BCP, and all of them matter here.

What the mechanism actually does

The encoding fits in five lines:

  1. Take the code as bytes.
  2. Derive a keystream of the same length with HKDF, using state as the input key material, an empty salt, and an INFO string.
  3. XOR the code with the keystream.
  4. Take the first 3 bytes of SHA-256 of the code as a checksum.
  5. Output base64url(checksum) followed by base64url(XORed code).

The client reverses it with its stored state, recomputes the checksum, and fails if it doesn't match. A wrong state produces garbage that fails the checksum.

Section 3.3 adds a fallback. If the helper page can't run JavaScript, the client SHOULD let the user paste the entire helper page URL instead and pull code and state out of it directly.

So what does PKCE already do?

This is the question the draft needs to answer, and PKCE isn't mentioned anywhere in it.

The XOR step binds the pasted value to the client's state. That's a code injection defense: an attacker can't hand the user a combined code that decodes to the attacker's code without knowing the victim client's state. That's a real property.

It's also exactly what PKCE does. An injected code was issued against the attacker's code_challenge, so the victim client's code_verifier fails at the token endpoint. RFC 9700 says PKCE is sufficient for CSRF and code injection protection when the AS supports it, and OAuth 2.1 requires it. For any client following current guidance, the HKDF binding adds nothing on the security side.

The draft's own security considerations say as much: "This process provides no additional security protections beyond that already provided by the basic authorization code grant." I agree with that sentence. It's the strongest argument for simplifying the mechanism.

The phishing problem doesn't go away

The attack that killed OOB at Google works like this. The attacker starts a flow using a legitimate public client's client_id, sends the authorization URL to the victim, and talks them into sending back the code they see on screen. "Paste the code into this support chat to finish verification." The attacker holds the code_verifier and the state, so neither PKCE nor this encoding stops them from redeeming it. This is the same class of attack that hit device code flows in Microsoft 365 phishing campaigns.

This draft is equally exposed. The attacker started the flow, so the attacker knows state and can decode the combined code.

The difference from the old OOB pattern is who can see it. When the AS hosted the display page, the AS knew it was an out-of-band flow. It could add warnings, apply risk scoring, or turn it off, which is what Google did. With a client-hosted helper page, the AS sees a normal web redirect. "No changes or participation by the AS is required" is presented as a feature. From the AS's side it means a pattern the ecosystem deliberately shut down comes back somewhere the AS has no visibility into.

ASes that review redirect URIs at registration keep some control. ASes that rely on Dynamic Client Registration or Client ID Metadata Documents, which is most of the MCP ecosystem, are accepting whatever the client declares.

A few things would help:

  • Point to the cross-device security BCP and adopt its guidance. The helper page should tell the user plainly that this code goes into a terminal they started themselves, and nowhere else.
  • Consider an optional client metadata flag so the AS knows a redirect URI is an OOB helper page and can apply cross-device protections. That gives up the "zero AS changes" property, but only for ASes that opt in.
  • Be honest about AI agents. Training users to paste authorization codes into chat windows is training the exact habit phishing relies on, and chat windows are where prompt-injected content shows up.

Significant interoperability concerns

The INFO parameter has no default value. Section 2 says the client "does need to know the value of the INFO parameter," and nothing says what it is. That's fine when the client and helper page come from the same vendor, but then no interoperability is required. If the goal is a generic helper page that many clients can share, INFO needs a fixed value in the spec.

Section 3.4 drops iss. That disables RFC 9207 mix-up defense. A CLI that talks to one AS doesn't care. An MCP client that talks to arbitrary authorization servers does. The suggestion to fold iss into INFO only works when the client already knows the AS returns it. The helper page could just carry iss in the combined value whenever it's present.

The helper page receives the code in the query string, so it ends up in the static host's access logs, CDN logs, and caches. Section 4 acknowledges this. Recommending response_mode=fragment where the AS supports it would keep the code out of every server log, and the helper page can clear the URL with history.replaceState after reading it.

The flow diagram skips half the out-of-band transfer. Step 2 has the client "send" the authorization URI to the browser. In the SSH case, the user copies that URL out of the terminal and into their laptop's browser. That leg is also out of band and has its own failure modes, like line-wrapped URLs in terminals.

Mechanisms that could be removed

The HKDF and XOR. Their only security property duplicates PKCE, and they require a high-entropy, never-reused state that the client otherwise wouldn't need. A reused state produces the same keystream twice, which the draft notes as a uniqueness requirement without spelling out why.

What's left once those go is "combine code and state into one string with a separator." That's simple enough that it may not need a spec at all. The checksum is the one piece with independent value, since it catches truncated pastes before the client makes a token request. Even there, the token endpoint returns invalid_grant for a mangled code anyway.

Section 3.3's fallback, pasting the entire helper page URL, is arguably the cleanest version of the whole idea. It needs no JavaScript, no shared INFO, and carries iss along for free.

Writing quality

Short and readable, nine pages including boilerplate. The step-by-step algorithm blocks are easy to follow and the security considerations are candid about what the mechanism doesn't do.

There are rough edges for a -00:

  • The third paragraph of the introduction is missing its verb: "Instead of using a different grant type, an out-of-band mechanism, such as ..., to deliver the authorization code and state value."
  • Section 2.2 step 4 says "the combined code and the HKDF output are XORed." It should be the encoded value E, not the combined code.
  • The indexing notation mixes byte and character offsets. [0..2] means 3 bytes in one place and CC[0..3] means 4 characters in the next.
  • "parmeters" in step 10.

The bigger gap is context. A draft that reintroduces a deprecated pattern should say so up front and explain why the phishing concern doesn't apply, or how it's mitigated. This one doesn't mention the old OOB URN at all.

Background of the author

Sole author, Justin Richer of MongoDB. His Datatracker profile lists 8 RFCs, including Dynamic Client Registration (RFC 7591 and 7592), Token Introspection (RFC 7662), Rich Authorization Requests (RFC 9396), HTTP Message Signatures (RFC 9421), and GNAP (RFC 9635 and RFC 9767). He has two active drafts, this one and draft-richer-oauth-httpsig, and 16 expired ones going back to the early days of the working group.

He knows the threat model better than almost anyone, which makes the omissions stand out more. The draft reads like a careful write-up of a pattern he's built for real clients. The conversation it needs is on the mailing list: whether the working group wants to document client-hosted OOB at all after collectively deprecating AS-hosted OOB, and if so, whether that belongs in its own document or as a section of the cross-device security BCP with the phishing guidance attached.