OAuth Misconfiguration: The Settings That Decide Whether It Holds
OAuth is only as strong as its configuration. The redirect URI rules, PKCE, grant types to retire and token restrictions that RFC 9700 actually requires.

OAuth rarely breaks because the protocol is wrong. It breaks because someone registered an application with a redirect URI ending in a wildcard, or left the implicit grant enabled for a single-page app built in 2017, or granted a third-party integration permission to read every mailbox in the tenant and then forgot it existed.
In January 2025 the IETF published RFC 9700, "Best Current Practice for OAuth 2.0 Security", which updates RFC 6749, RFC 6750 and RFC 6819. It is unusually direct for a standards document: things that used to be described as options are now stated as requirements, and two grant types are effectively retired. If you run an OAuth deployment, the gap between that document and your configuration is a reasonable definition of your exposure.
What OAuth is for
RFC 6749 calls it the OAuth 2.0 Authorization Framework, and the word authorization is doing work. The problem it solves is delegation: letting an application act on your behalf against some resource without the application ever seeing your password.
The flow involves four parties. The resource owner is you. The client is the application asking for access. The authorization server authenticates you and issues tokens. The resource server holds the data and accepts those tokens.
The authorization code grant, which is the one you should be using, runs like this: the client sends your browser to the authorization server, you authenticate and approve, the authorization server redirects your browser back to the client with a short-lived authorization code, and the client exchanges that code for tokens over a direct back-channel request.
Everything that goes wrong in practice is a failure to protect one of those steps. OAuth is not an authentication protocol, and treating a successful token issuance as proof of who the user is, without an identity layer designed for that purpose, is a recurring design error rather than a configuration one.
The redirect URI is the whole ballgame
The authorization code is delivered by redirecting the browser to a URI the client registered in advance. Whoever receives that redirect receives the code. Consequently, how strictly the authorization server matches the requested redirect URI against the registered one determines whether the credential reaches the client or an attacker.
RFC 9700 leaves no room here. "When comparing client redirection URIs against pre-registered URIs, authorization servers MUST utilize exact string matching except for port numbers in localhost redirection URIs of native apps."
Exact string matching rules out every convenient shortcut: wildcards in the host, prefix matching that lets an attacker append a path, ignoring the query string, treating subdomains as equivalent. Each of those has been the root cause of real credential-leak findings, and each exists because somebody wanted one registration to serve several environments.
The specification also closes a related gap that is easy to miss. "Clients and authorization servers MUST NOT expose URLs that forward the user's browser to arbitrary URIs obtained from a query parameter (open redirectors)," because an open redirector on an otherwise correctly registered host turns exact matching into a formality. The code arrives at the right place and is immediately forwarded onward.
The practical review
List every registered application in your identity provider and read the redirect URIs. You are looking for four things: wildcards of any kind, http rather than https for anything that is not a native app on localhost, hostnames nobody recognizes, and applications nobody owns. The last category is usually the largest, and stale registrations with live redirect URIs pointing at decommissioned infrastructure are a genuine risk if someone else can claim that hostname.
PKCE, and why it is no longer optional
An authorization code is useful to an attacker who intercepts it only if they can exchange it. Proof Key for Code Exchange, RFC 7636, makes that exchange require something the interceptor does not have. The client generates a random verifier, sends only its hash in the authorization request, and presents the original verifier when redeeming the code. A stolen code without the verifier is worthless.
RFC 9700 sets out the requirements plainly. Public clients, meaning anything that cannot keep a secret such as a mobile app or a browser application, must use PKCE. Confidential clients should use it. Authorization servers must support it. Where a code_challenge is present, the server must enforce correct usage of the code_verifier at the token endpoint. The recommended challenge method is S256, since it is the only one that does not expose the verifier in the authorization request.
There is a subtlety in there worth implementing deliberately. A server that enforces PKCE only when the client asks for it can be downgraded: an attacker strips the challenge from the authorization request and supplies their own verifier at the token endpoint. RFC 9700 addresses this by requiring servers to reject a token request containing a code_verifier when the authorization request had no code_challenge.
The grant types to stop using
The resource owner password credentials grant must not be used. RFC 9700 is categorical, and gives its reasons: the grant insecurely exposes the resource owner's credentials to the client, increases the attack surface because credentials can now leak in more places than the authorization server, trains users to enter credentials in places other than the authorization server, and is not designed to work with two-factor authentication or login processes requiring multiple interaction steps. It also notes that cryptographic credentials such as WebAuthn may be impossible to implement with it, since those are bound to a specific web origin.
That last point is the one with teeth. An application still using the password grant cannot be covered by passkeys. Our pieces on what a passkey is and passkeys against phishing explain why that matters, and this grant type quietly prevents it.
The implicit grant should not be used unless access token injection is prevented and the leakage vectors are mitigated. The problem is structural: it returns tokens in the URL fragment, which puts them in browser history and exposes them to referrer leakage, and it provides no back-channel exchange where a client could prove anything. RFC 9700 devotes separate sections to credential leakage via referrer headers and via browser history, which is the specific harm. The authorization code grant with PKCE replaces it with no loss of function.
Restricting what a token can do
A stolen token is inevitable at some point, so its privileges are a design decision about blast radius rather than an administrative detail.
RFC 9700 states that "the privileges associated with an access token SHOULD be restricted to the minimum required for the particular application or use case," and then makes two specific demands.
Audience restriction. Access tokens should be audience-restricted to a specific resource server, or to a small set of them if that is not feasible. The enforcement half is the part that gets skipped: "every resource server is obliged to verify, for every request, whether the access token sent with that request was meant to be used for that particular resource server. If it was not, the resource server MUST refuse to serve the respective request." A token accepted by any API in the estate turns one compromised service into access to all of them.
Resource and action restriction. Tokens should also be limited to particular resources and actions, with the same per-request verification obligation on the resource server.
Alongside this, RFC 9700 recommends sender-constraining access tokens so that a copied token cannot be used without a key held by the legitimate client, naming mutual TLS and DPoP as the mechanisms. For refresh tokens, which are the more valuable theft target because they renew access, the requirement is firmer: refresh tokens for public clients must be sender-constrained or use refresh token rotation. Our explainer on session and token theft covers why that distinction decides whether a theft is an incident or a standing compromise.
Client authentication and the mix-up problem
Authorization servers should enforce client authentication where it is feasible to issue and protect client credentials, and RFC 9700 recommends asymmetric cryptography for it, naming mutual TLS and signed JWTs using a private key. The reasoning is operational as much as cryptographic: with asymmetric methods, the authorization server does not need to store sensitive symmetric keys, so a breach of the server does not hand over client secrets.
A distinct failure affects clients that talk to more than one authorization server, such as an application supporting several identity providers. In a mix-up attack, a response from one server is presented to the client as though it came from another, and the client sends the code to the wrong token endpoint. RFC 9700 requires a defense: clients must store the issuer for each authorization request, and if the issuer received in the response does not match, they must abort the interaction. The recommended countermeasure is issuer identification using the iss parameter from RFC 9207, with distinct redirect URIs per issuer as a fallback only when the better options are unavailable.
The specification also recommends that authorization servers publish authorization server metadata and that clients consume it, on the grounds that it reduces misconfiguration, including endpoint URLs that might belong to an attacker, and helps with key rotation.
Consent, which is a configuration problem too
The attack that needs no vulnerability at all is persuading a user to approve an application the attacker controls. The identity provider then issues genuine tokens, scoped to whatever the user agreed to. MITRE ATT&CK catalogs this as stealing an application access token, and the detection signal is not a sign-in anomaly but a consent event.
Three configuration decisions reduce it substantially. Restrict which users may consent to third-party applications and for which permission levels. Require administrator review for anything requesting broad access to mail, files or directory data. And audit existing grants, because the risk in most tenants is historical rather than new: integrations approved years ago, holding permissions far beyond what they need, belonging to vendors nobody has a contract with any more.
For federated and single sign-on environments, NIST and CISA published joint implementation recommendations in NIST IR 8587 covering key management, token verification and token lifecycle controls. It is addressed to federal agencies and cloud service providers, and the architectural advice applies anywhere.
Consent prompts are a phishing surface. A request to approve an application is worth the same suspicion as a login page. Paste a suspicious link into CyberWatch AI Scan for a free check before approving anything.
The short version
OAuth's security rests on configuration choices that are easy to get wrong for convenience. Match redirect URIs exactly and expose no open redirectors. Enforce PKCE, including rejecting downgrade attempts. Retire the password grant entirely and the implicit grant in all but narrow cases. Keep token privileges minimal, audience-restrict them, and have resource servers actually check the audience on every request. Prevent mix-up attacks if you support more than one identity provider. Then go and look at who already has consent in your tenant.
RFC 9700 is the authoritative list, and reading it against your own identity provider settings is one of the higher-yield exercises available. For the broader authorization failures that sit alongside these, see our explainer on broken access control.
Frequently asked questions
Is OAuth an authentication protocol?
No. RFC 6749 defines it as an authorization framework: a way for a user to let an application access a resource on their behalf without handing over their password. Authentication layers such as OpenID Connect are built on top of it, and treating raw OAuth as a login mechanism is a common source of flaws.
Why does redirect URI validation matter so much?
Because the redirect is where the authorization code or token is delivered. If an attacker can get the authorization server to send it to a URI they control, they receive the credential. RFC 9700 requires exact string matching against pre-registered URIs, with the only exception being port numbers in localhost redirect URIs for native apps.
What is PKCE and who needs it?
Proof Key for Code Exchange, defined in RFC 7636. The client generates a secret, sends a hash of it with the authorization request, and presents the original when exchanging the code. RFC 9700 requires public clients to use PKCE, recommends it for confidential clients, and requires authorization servers to support it.
Should we still use the implicit grant?
RFC 9700 says clients SHOULD NOT use the implicit grant unless access token injection is prevented and the leakage vectors are mitigated, and recommends the authorization code grant instead. The implicit grant returns tokens in the URL fragment, which leaks them into browser history and referrer headers.
What about the password grant?
RFC 9700 states that the resource owner password credentials grant MUST NOT be used. It exposes the user's password to the client, trains people to type credentials outside the authorization server, and is not designed to work with two-factor authentication or multi-step login.
What is consent phishing?
Persuading a user to grant an attacker-controlled application access to their account. Nothing is stolen; the user authorizes it, and the identity provider issues real tokens. MITRE ATT&CK tracks the technique as stealing an application access token, and detection relies on watching consent grants rather than sign-ins.
What is a mix-up attack?
An attack on clients that work with more than one authorization server, where a response from one is fed to the client as if it came from another. RFC 9700 requires clients in that situation to prevent it, to store the issuer for each request, and to abort the interaction if the issuer in the response does not match.
How do we limit the damage if a token is stolen?
Restrict what it can do. RFC 9700 says access token privileges should be the minimum required, that tokens should be audience-restricted to a specific resource server, and that resource servers must refuse requests carrying a token not meant for them.
Where should we start on an existing deployment?
Inventory the registered applications and their redirect URIs, remove entries nobody owns, eliminate wildcards, confirm PKCE is enforced, retire the implicit and password grants, and review which third-party applications hold consent in your tenant. That list finds most real problems.
Sources
- RFC 9700: Best Current Practice for OAuth 2.0 Security, IETF
- RFC 6749: The OAuth 2.0 Authorization Framework, IETF
- RFC 7636: Proof Key for Code Exchange by OAuth Public Clients, IETF
- RFC 9207: OAuth 2.0 Authorization Server Issuer Identification, IETF
- RFC 9449: OAuth 2.0 Demonstrating Proof of Possession (DPoP), IETF
- RFC 8705: OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens, IETF
- Steal Application Access Token, Technique T1528, MITRE ATT&CK
- NIST IR 8587, Protecting Tokens and Assertions from Forgery, Theft, and Misuse, US National Institute of Standards and Technology


