frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Cross-Site Request Forgery

https://words.filippo.io/csrf/
131•tatersolid•15h ago

Comments

nchmy•14h ago
i just discovered the Sec-Fetch stuff recently, due to Go 1.25's changelog. Very excited to start using it in some applications where tokens are currently used - what a hassle to deal with those.
jerf•14h ago
Cookies have been truly horrible. I check in on them every couple of years, because I don't do a lot of front-end but when I do it's often security-sensitive, and every single time I check in on them there's some new entry in "SameSite; NoSeriouslySecureHarder; WhoopsTheLastStandardWasNotGoodEnough=BeActuallySecure; AwwShitDidWeGetItRightLastTime=false" parade of attributes you need to send to get actually secure cookies.

No shade on the people implementing this stuff, I understand the backwards compatibility concerns, but I mean, keeping up with this stuff is harder than it should be. And thanks to backwards compatibility most of it still defaults open, though browsers have pecked at that as they can.

pstuart•12h ago
Fortunately the stability and consistency of JS frameworks make light work of that pain!
unethical_ban•12h ago
Your examples made me chuckle. I was thinking "God I hope frameworks deal with all this stuff".
MajesticHobo2•13h ago
Not sure I agree with this part:

> Allow all GET, HEAD, or OPTIONS requests.

> These are safe methods, and are assumed not to change state at various layers of the stack already.

Plenty of apps violate this assumption and do allow GET requests to alter state.

chrisfosterelli•13h ago
IMO apps that do this have a bug, and possibly a security one. This causes issues with prefetching, bot traffic, caching, CSRF, and just plain violates HTTP standards.
pstuart•12h ago
Agreed. Those methods should be treated as idempotent.
almog•12h ago
> Those methods should be treated as idempotent

Idempotency still implies it can change state on the initial call, which to me feels wrong in the context of GET/HEAD/OPTIONS.

Mavvie•11h ago
Indeed, the correct term here is nullipotent.
simonw•11h ago
Those apps are beyond helping already. They need to fix theselves.
nchmy•11h ago
The entire WordPress ecosystem says hello
cryptonector•5h ago
This is on the server side, on the app. If your supposedly-safe methods aren't safe, then CSRF may not be your biggest problem.
paulhodge•4h ago
That’s bad because visiting an evil site can easily trick your browser into performing one of those requests using your own credentials. CORS doesn’t stop the backend state effect from happening.
akersten•13h ago
I'm not really grokking the explanation in the article of why the SameSite cookie attribute doesn't fix CSRF. I thought that was the whole design intent of SameSite=Secure on an HTTPS cookie, was to fix CSRF. Can someone boil it down?

The article seemingly says "these cookies won't be sent with an unsafe request. But that doesn't fix it!" And doesn't elaborate?

MajesticHobo2•13h ago
The problem boils down to the lack of equivalence between a site and an origin. The article explains how https://app.example.com and https://marketing.example.com may sit at very different trust levels, but are considered the same site by the browser. You don't want https://marketing.example.com to be able to make requests to https://app.example.com with your authentication cookies, but SameSite wouldn't prevent that.
edoceo•9h ago
This doesn't match my experience. What am I doing different?

Example I set SameSite=Strict on www.edoceo.com and then visiting app.edoceo.com the cookie is not there? They are different sites, different origins. And the cookie is set to the domain (ie: host, ie: www.edoceo.com)

FiloSottile•9h ago
For CSRF (and for SameSite), you are not looking at what cookies are sent to attacker.example.com, but what cookies are sent to target.example.com if a request is originated from attacker.example.com (or from attacker.com).
FiloSottile•10h ago
Same-Site cookies are, well, same-site. Not same-origin. This is already a deal-breaker for many deployments, because they don't trust blog.example.com and partner.example.com as much as admin.example.com (both in the strict sense of trust, and in the senso of not having XSS vulnerabilities the attacker can pivot off).

Worse, by the original definition http://foo.example.com and https://admin.example.com are same-site, and unless the site uses HSTS with includeSubDomains, any network attacker controls the former. Chrome changed that with Schemeful Same-Site in 2020, but Firefox and Safari never deployed it.

pluto_modadic•7h ago
ah, that explains it.
harg•1h ago
The other replies answer this question, but it’s worth mentioning the public suffix list which contains a list of domain suffixes that have subdomains that are controlled by different people. E.g github.io, wordpress.com

Browser use this list to prevent cookie shared between sites using the suffixes on the list. E.g evil.github.io will not receive cookies from nice.github.io, or any other .github.io origin, regardless of the SameSite attribute

AgentME•12h ago
It's very nice to have an up-to-date writeup like this. I've gotten some odd looks for telling people that classic CSRF tokens are unnecessary work since the Origin header became widely supported, and I'm glad to have a page like this to refer people to.
nchmy•10h ago
A few more links that I collected recently on the topic

https://github.com/golang/go/issues/73626

https://developer.mozilla.org/en-US/docs/Web/Security/Attack...

https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/...

https://web.dev/articles/fetch-metadata

https://appliedgo.net/spotlight/csrf-dont-mess-with-my-site/

And some older ones that focused on Origin header rather than sec-fetch-*

https://www.sjoerdlangkemper.nl/2019/02/27/prevent-csrf-with...

https://www.brandur.org/fragments/origin

https://srungta.github.io/blog/start-right/ui-nonce

fabian2k•11h ago
So am I understanding it right that you don't need any CSRF tokens anymore to fully protect against CSRF attacks?

And if Go is implementing this specific protection, are other ecosystems doing this as well? My specific interest would be .NET/C#, but I am wondering in general how widespread this specific solution is at the moment.

cryptonector•5h ago
> Essentially all applications that use cookies for authentication need to protect against CSRF.

Not just cookies!! Any HTTP authentication. Kerberos, NTLM, OAuth.

todotask2•3h ago
> Same site vs same site vs same origin

I'm lost here.

Arch shares its wiki strategy with Debian

https://lwn.net/SubscriberLink/1032604/73596e0c3ed1945a/
1•lemper•14s ago•0 comments

Social Media Apps Engineered Like Narcotics: The Dopamine Addiction Crisis

https://www.lookatmyprofile.org/blog/social-media-apps-engineered-like-narcotics-the-dopamine-add-1755157203663
1•flixing•2m ago•1 comments

Show HN: I built an agent that applies to VCs for you

https://www.suparaise.com/
1•Princemuichkine•5m ago•0 comments

Small plane (with no radio) lands on aircraft carrier, 7 people saved

https://www.instagram.com/reel/DIwfglLP4NI/
1•asdefghyk•7m ago•1 comments

AI Allergy

http://togelius.blogspot.com/2025/08/ai-allergy.html
1•doubtfuluser•10m ago•0 comments

iPhone DevOps

https://clearsky.dev/blog/iphone-devops-ssh/
1•ustad•11m ago•0 comments

Map Projection Transitions

https://www.jasondavies.com/maps/transition/
1•fanf2•16m ago•0 comments

Rails Versions 7.1.5.2, 7.2.2.2, and 8.0.2.1 have been released

https://rubyonrails.org/2025/8/13/Rails-Versions-8-0-2-1-7-2-2-2-and-7-1-5-2-have-been-released
3•amalinovic•20m ago•0 comments

Senior Microsoft official shares what next major Windows version will be like

https://www.neowin.net/news/senior-microsoft-official-shares-what-next-major-windows-version-will-be-like/
1•defrost•20m ago•0 comments

The first EV powered by a semi-solid-state battery has been cleared for sale

https://electrek.co/2025/08/13/first-ev-with-semi-solid-state-battery-cleared-for-sale/
1•breve•26m ago•0 comments

Top Free Web Scrapers in 2025 for Easy Data Scraping

https://momoproxy.com/blog/top-10-free-web-scrapers-in-2024
1•xbjamilnz•27m ago•1 comments

Show HN: Transactional State Management for JavaScript

https://github.com/b3nten/horizonstate
1•b_e_n_t_o_n•29m ago•0 comments

Coding in the Red-Queen Era [audio]

https://corecursive.com/red-queen-coding/
1•alecco•29m ago•0 comments

Local AI Data Tool: No Coding, Privacy, Big Data Friendly

1•olllo•31m ago•0 comments

China-Plus-One Was Just China All Along

https://indiadispatch.com/p/china-plus-one-was-just-china-all-along
1•jnord•32m ago•0 comments

DeepSeek failed to train a new model without using Nvidia hardware

https://www.ft.com/content/eb984646-6320-4bfe-a78d-a1da2274b092
1•macleginn•38m ago•0 comments

Starlink Mini users just lost their beloved pause feature

https://www.theverge.com/analysis/758826/starlink-mini-standby-pause-bait-switch
2•isaacfrond•39m ago•1 comments

There is a new short domain name for PuTTY

https://hachyderm.io/@simontatham/115025974777386803
2•nokita•40m ago•1 comments

Building a Stable Uncensored AI Model: Lessons Learned from HackAIGC

1•hackaigc•43m ago•0 comments

All the concerns that make you a boring developer

https://daverupert.com/2025/08/got-99-engineering-problems-but-a-grift-aint-one/
1•gregwolanski•44m ago•0 comments

Show HN: The Operating System for Trading

https://www.aulico.com/
1•imatelescope•46m ago•0 comments

What I look for in typeface licenses

https://davesmyth.com/typeface-licenses
2•gregwolanski•47m ago•0 comments

Our Culture Is Addicted to Validation

https://freddiedeboer.substack.com/p/modern-culture-as-sociopath-instructions
1•Michelangelo11•51m ago•0 comments

GrapheneOS Under Threat: EU Age Verification and Google Changes Endanger Privacy

https://www.forbes.com/sites/federicoguerrini/2025/08/10/whos-afraid-of-privacy-focused-smartphones/
4•nabakin•51m ago•2 comments

GPT-OSS-20B extracted to a base model without alignment

https://twitter.com/jxmnop/status/1955436067353502083
2•polyrand•53m ago•2 comments

I just unlocked a hidden lever in ChatGPT's "Saved Memory"

1•Alchemical-Gold•1h ago•0 comments

Turning ChatGPT's "Saved Memory" into a Persistent, Self-Updating Runtime Tool

1•Alchemical-Gold•1h ago•0 comments

UK Court Ruling Leaves Wikipedia Years of Uncertainty Under Online Safety Act

https://www.techdirt.com/2025/08/13/uk-court-ruling-leaves-wikipedia-facing-years-of-uncertainty-under-online-safety-act/
5•beardyw•1h ago•0 comments

Remember the Parachuting Beavers Story? Now There's Video

https://www.boisestatepublicradio.org/environment/2015-10-22/remember-the-parachuting-beavers-story-now-theres-video
2•JumpCrisscross•1h ago•0 comments

China and India Rebuild Ties After Modi's Rupture with Trump

https://www.bloomberg.com/news/articles/2025-08-13/india-china-thaw-takes-shape-as-modi-embraces-brics-over-trump
2•JumpCrisscross•1h ago•0 comments