datasette PR #2689: Replace token-based CSRF with Sec-Fetch-Site header protection
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Datasette developers no longer need CSRF token hidden inputs in templates; browser-based protection via Sec-Fetch-Site headers simplifies forms and removes a plugin hook.
Datasette, an open-source tool for exploring data, has replaced its old protection against CSRF attacks, tricks where malicious websites trick a user's browser into unwanted actions. The old method required hidden code fields in every form; the new one reads a browser-supplied header instead. Developers building on Datasette can delete those token fields. The approach follows research by Filippo Valsorda adopted in Go 1.25.
Datasette maintainers replaced token-based CSRF defence with a header check based on Filippo Valsorda's research, already shipped in Go 1.25. Teams embedding or extending Datasette should review the upgrade guide: the skip_csrf plugin hook is removed and templates no longer need token inputs. The change was largely implemented by Claude Code across ten commits, reviewed by GPT-5.4 and the maintainer. No cost figures are given.
Datasette PR #2689 removes asgi-csrf token-based CSRF protection and replaces it with middleware checking the Sec-Fetch-Site header, per Filippo Valsorda's August 2025 research adopted in Go 1.25's net/http. All csrftoken hidden inputs are stripped from templates, the skip_csrf(datasette, scope) plugin hook is deleted with its tests, and docs plus the upgrade guide were updated. Claude Code wrote most of the ten commits, cross-reviewed by GPT-5.4.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Datasette Sec-Fetch-Site Go 1.25 asgi-csrf Claude Code GPT-5.4
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.