News for hackers. Stuff that matters.
Re:Why do we have both CSRF protection and CORS? by TheRealPomax on Sunday March 02, 2025 @02:06PM (#43233794)
And why do browsers not let users go "I don't care about what this server's headers say, you will do as I say because I clicked the little checkbox that says I know better than you".

(On which note, no CSRF/CORS post is complete without talking about CSP, too)

Re:Why do we have both CSRF protection and CORS? by tedunangst on Sunday March 02, 2025 @03:37PM (#43234780)
Because then you will get users whining I didn't know what the checkbox did and you shouldn't have let me check it.
Re:Why do we have both CSRF protection and CORS? by syntheticcdo on Sunday March 02, 2025 @03:03PM (#43234439)
You can! Go ahead and launch chrome with the --disable-web-security argument.
Re:Why do we have both CSRF protection and CORS? by TheRealPomax on Tuesday March 04, 2025 @11:04AM (#43256456)
That's confusing the statement "I want the option to overrule it" with "I want it disabled". I don't, there's very good reason for them to always be on, but there has to be a way to tell it what I want my browser to do, rather than what a server owner, who spent all of zero minutes accepting the default helmet options, says what my browser should do. In the same way that a browser should let me say which off-site domains, specific scripts, and on-page elements should be blocked.
Re:Why do we have both CSRF protection and CORS? by LegionMammal978 on Sunday March 02, 2025 @02:19PM (#43233938)
I'd think SameSite/Secure directives on cookies are genuinely important to avoid any malicious website from stealing all your credentials. Otherwise, I'd imagine it's the usual "Because those dastardly corporations will tell people to disable it, just because they can't get it to work!!!"
Re:Why do we have both CSRF protection and CORS? by siva7 on Sunday March 02, 2025 @02:16PM (#43233910)
Almost as pointless as "Yes, accept all cookies" for our european friends.
Re:Why do we have both CSRF protection and CORS? by yoavm on Sunday March 02, 2025 @04:28PM (#43235334)
I wish the browser would just say "This website is trying to fetch data from example.com, do you agree?"

The whole CORS thing is so off and it destroyed to ability to build so many things on the internet. I often think it protects websites more than it protects users. We could have at least allowed making cookie-less requests.

Re:Why do we have both CSRF protection and CORS? by bastawhiz on Sunday March 02, 2025 @06:26PM (#43236418)
> This website is trying to fetch data from example.com, do you agree

I don't know, do I? How am I supposed to know? How am I supposed to explain to my mom when to click yes and when not to? The average person shouldn't ever have to think about this.

Imagine if any website could ask to access any other website, for an innocent reason, and then scrape whatever account information they wanted? "Do you want to let this website access google.com?" Great, now your whole digital life belongs to that page. It's a privacy nightmare.

> it destroyed to ability to build so many things on the internet

It only destroyed the ability for any website to access another website as the current user. What it destroyed is the ability for a web page to impersonate users.

Re:Why do we have both CSRF protection and CORS? by yoavm on Monday March 03, 2025 @02:06AM (#43239078)
Reading cookie-less responses is also forbidden. I couldn't read your Google account information, just make an anonymous Google search through your browser. I fail to see what's the big deal.
Re:Why do we have both CSRF protection and CORS? by Avamander on Monday March 03, 2025 @05:14AM (#43240264)
Famous last words
Re:Why do we have both CSRF protection and CORS? by yoavm on Monday March 03, 2025 @11:24AM (#43243345)
Do elaborate please?
Re:Why do we have both CSRF protection and CORS? by smagin on Monday March 03, 2025 @07:20AM (#43241056)
Why would you need that?

Also, one thing I can speculate that phishing would become even easier if such things were allowed

Re:Why do we have both CSRF protection and CORS? by yoavm on Monday March 03, 2025 @11:25AM (#43243360)
Because defaulting to NOT allowing cross-origin requests made it so that being lazy creates a more closed web. And people are lazy.
Re:Why do we have both CSRF protection and CORS? by bastawhiz on Monday March 03, 2025 @10:03AM (#43242388)
Or make 10,000,000 Google searches through my browser and get my IP and account banned. Or process a request containing CSAM that has me reported to the government. Or using my residential internet connection to operate a proxy service, causing my IP's reputation to drop and now I'm stuck solving CAPTCHAs all day. Or, you make requests to lots of sites and see which ones have no responses: surprise! Now you know which websites I have cookies on. Why in the world would I want to let someone else use my device to make requests like that? Use your own device, not mine.

Fundamentally this all boils down to you, the person building the site, being cheap. You don't want to pay the handful of dollars to make your own HTTP requests.

Re:Why do we have both CSRF protection and CORS? by yoavm on Monday March 03, 2025 @11:33AM (#43243470)
Making 10m requests to Google, asking for a CSAM image etc are all currently possible with an <img> tag. This does not prevent it in any way. Allowing GET requests would be a very lame proxy service, especially considering that the proxy falls when you close the tab, and that I mentioned the requests should only be allowed cookie-less (credentials: omit).

I think it's much more about open web and letting the user decide than about being cheap.

Re:Why do we have both CSRF protection and CORS? by blincoln on Monday March 03, 2025 @08:26AM (#43241495)
Modern web apps make a mind-boggling number of cross-origin requests, and many of them are to multi-tenant SaaS providers.

You'd be constantly flooded with permission popups, and attackers would just host part of their code on one ot more of the popular domains that everyone had gotten used to clicking "allow" for.