Redirect URI validation
09A permissive redirect pattern can send a code or token straight to an attacker-controlled address.
This new example uses the exact registered URI; the rejected request above ended without a redirect. PKCE adds another layer against misuse of a leaked code.
Key idea: Match registered redirect URIs exactly.
Rules & examples
Match registered redirect URIs exactly.
- Servers MUST use exact string matching; native localhost redirect ports are the exception.
- Callback hosts MUST NOT expose open redirectors. Prefer code over front-channel access tokens.
- § 4.1.3 permits trusting the URI when request origin and integrity are verified, for example authenticated JAR or PAR.
Wildcards can fail even when their parser is correct: an attacker may take over a permitted subdomain. A fragment such as #_ on onward redirects can prevent browser fragment reattachment; it does not replace redirect validation.
Sources
New to this? Start hereA quick picture + helpful background
A key is different from permission.
An app, a person, and a server have different roles. Follow who asks, who grants permission, and who checks the credential. A key in the drawing is an analogy, not a literal protocol field.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
The framework allowed partial URI registration in some cases. The BCP requires exact string matching, with the native loopback-port exception and the authenticated-request exception described in § 4.1.3.
Read the updated RFC section ↗