Menu

πŸͺ CSRF in 2026: Why SameSite Isn't Your Fix (and What Is)
πŸ“°

πŸͺ CSRF in 2026: Why SameSite Isn't Your Fix (and What Is)

DEV Community: appsecΒ·Krishna KumarΒ·6 days ago
#kKUSFiZy
#devtoappsec#devto#dev#origin#csrf
Reading 0:00
15s threshold

A lot of teams quietly retired CSRF from their threat model a few years ago. Browsers started treating cookies as SameSite=Lax by default, the thinking went, so cross-site form posts can't carry the session anymore. Problem solved.

It isn't. SameSite narrows CSRF, but it doesn't close it, and the gaps sit in exactly the places real apps have: a GET that changes state, a framework that honours _method=POST , a sibling subdomain you don't fully control, a cookie someone set to SameSite=None to make an embed work.

This post is a fix guide. We'll look at where SameSite stops helping, then put a real defense in place in Django, Express and Go, and finish with tests that prove the fix holds.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.