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

Cross-site request forgery

15

An attacker sends an unsolicited callback to a victim’s browser, causing the client to connect to resources chosen by the attacker.

RFC 9700 · § 4.7DEFENSE
3 / 3
03
Accept only the expected response.

Validate the binding and consume one-time values.

Cross-site request forgeryAn attacker sends an unsolicited callback to a victim’s browser, causing the client to connect to resources chosen by the attacker. Current state: Accept only the expected response..Cross-site request forgeryClientpending browser transactionstate B · callback Bresponse B · state BcallbackMatching response accepted once

Key idea: Bind the response to the initiating browser.

Terms

Look up a term in the glossary ↗

Rules & examples
  • Clients MUST prevent CSRF. Use a one-time, session-bound state token unless PKCE or OIDC nonce provides the protection.
  • Before relying on PKCE for CSRF, clients MUST ensure server support. Without that support, use state or nonce.
  • If application state integrity matters, protect state from tampering and swapping.

PKCE protects against CSRF even with an attacker who reads authorization responses. Leaked state can be replayed; nonce exposed in a front-channel ID Token has related limits.

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 ↗