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

Referer header leakage

10

External resources or links on OAuth pages can disclose sensitive URL contents through the Referer header.

RFC 9700 · § 4.2DEFENSE
3 / 3
03
Consume codes and state only once.

The server invalidates the code after exchange; the client should invalidate state after callback use. Optional URL cleanup is illustrated too.

Referer header leakageExternal resources or links on OAuth pages can disclose sensitive URL contents through the Referer header. Current state: Consume codes and state only once..Referer header leakageclient.example/cbCallback pageAppToken endpointcode ABC + secretServer: code ABC used → cannot redeem againClient: invalidate state after callback useOptional URL cleanup shown above

Key idea: Keep OAuth pages free of leakage paths.

Terms

Look up a term in the glossary ↗

Rules & examples
  • Authorization and callback pages SHOULD NOT include third-party resources or external links.
  • An appropriate Referrer-Policy, such as no-referrer, suppresses referrer disclosure.
  • Bind codes with PKCE or confidential-client credentials; invalidate codes after use and SHOULD invalidate state after its first use. Form post is another option.

The authorization page can leak state before it is consumed. A callback can leak codes. Single-use codes help after redemption, but a thief can race the legitimate client; duplicate redemption SHOULD trigger revocation of previously issued tokens.

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.

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 ↗