Authorization code injection
13An attacker injects a stolen code into their own app session so the legitimate app connects that session to the victim’s resources.
The code’s stored challenge does not match the verifier supplied by this client transaction.
Key idea: Bind codes to a client instance and transaction.
Rules & examples
Bind codes to a client instance and transaction.
- PKCE rejects injected codes whose challenge does not match this transaction’s verifier.
- Confidential OIDC clients using nonce MUST verify it in the token-endpoint ID Token and disregard all tokens until the check succeeds.
- Keep preventing response leakage: modifying request challenges or nonces and stealing responses can undermine these defenses.
Client authentication alone does not stop injection because the legitimate app authenticates on the attacker’s behalf. Nonce alone does not protect public-client codes from direct redemption.
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 later BCP details code injection into another client session and transaction binding through PKCE or, with extra precautions, OIDC nonce.
Read the updated RFC section ↗