Visual RFC.
ALL RFCs / RFC 9700
Read the RFC ↗
RFC 9700 / ATTACKS & DEFENSES

Authorization code injection

13

An attacker injects a stolen code into their own app session so the legitimate app connects that session to the victim’s resources.

RFC 9700 · § 4.5DEFENSE
3 / 3
03
Reject the code exchange.

The code’s stored challenge does not match the verifier supplied by this client transaction.

Authorization code injectionAn attacker injects a stolen code into their own app session so the legitimate app connects that session to the victim’s resources. Current state: Reject the code exchange..Authorization code injectionAppToken endpointcode A + verifier BStored challenge A ≠ derived challenge BRejected: no tokens or victim resources

Key idea: Bind codes to a client instance and transaction.

Terms

Look up a term in the glossary ↗

Rules & examples
  • 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
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
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.

What changed
RFC 6749 § 10.5RFC 9700 § 4.5.3

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 ↗

All chapters in RFC 9700

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗