Skip to content

csrf-protection-demo: demonstrate modern CSRF defenses using Sec-Fetch-Site headers#94

Merged
simonw merged 1 commit intomainfrom
claude/csrf-protection-demo-0eGTy
Mar 14, 2026
Merged

csrf-protection-demo: demonstrate modern CSRF defenses using Sec-Fetch-Site headers#94
simonw merged 1 commit intomainfrom
claude/csrf-protection-demo-0eGTy

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Mar 14, 2026

Clone https://gist.github.com/b7fb3dcc34571f3568d7f67f1ebe31aa.git to /tmp and read both markdown files

Then create a demo app in FastAPI python which can be used to test these approaches

Run “uvx rodney –help” to learn about the rodney tool. Start two dev servers and ensure foo.localhost and bar.localhost can be used to access then via HTTP so you can test cross-domain requests

Run “uvx showboat –help” to learn snowboat, then start the README.md file as a showboat document

Your goal is to concousivelt demonstrate the new techniques used for CSRF protection described in the gist articles - and also demonstrate how CSRF attacks work without them but fail if those measure are in place - using snowboat and Rodney and your own demo servers

The end result should both teach people about CSRF and then explain the new measures in derail and demonstrate them working

Interactive demo showing how modern browsers provide Sec-Fetch-Site and Origin
headers that let servers reject cross-origin requests without CSRF tokens.
Includes a vulnerable bank app, an attacker site, and a protected endpoint
implementing Filippo Valsorda's recommended algorithm (as used in Go 1.25).
Built with FastAPI, rodney (browser automation), and showboat (executable docs).

https://claude.ai/code/session_01SBdyDC8RLnYayfQYKbCrqx

…h-Site headers

Interactive demo showing how modern browsers provide Sec-Fetch-Site and Origin
headers that let servers reject cross-origin requests without CSRF tokens.
Includes a vulnerable bank app, an attacker site, and a protected endpoint
implementing Filippo Valsorda's recommended algorithm (as used in Go 1.25).
Built with FastAPI, rodney (browser automation), and showboat (executable docs).

https://claude.ai/code/session_01SBdyDC8RLnYayfQYKbCrqx
@simonw simonw merged commit 36f1263 into main Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants