CORS Security Debates

Discussions center on the purpose, limitations, and misconceptions of CORS in relation to the Same-Origin Policy, browser security, and preventing cross-origin attacks like XSS or CSRF.

➡️ Stable 0.5x Security
2,860
Comments
20
Years Active
5
Top Authors
#2745
Topic ID

Activity Over Time

2007
2
2008
6
2009
18
2010
31
2011
65
2012
117
2013
103
2014
89
2015
83
2016
136
2017
133
2018
263
2019
387
2020
237
2021
306
2022
306
2023
171
2024
160
2025
238
2026
9

Keywords

e.g US FETCH CSP MITM mozilla.org SOP jasondavies.com HN JSONP cors origin requests browser domain access control cross allow server security

Sample Comments

JimDabell Apr 8, 2023 View on HN

You two have this entirely backwards. It’s the Same-Origin Policy that is stopping you from doing what you want. CORS is a way of loosening up the security to make more things possible. CORS doesn’t – and can’t – stop you from accessing anything. If you “disable CORS” in your browser, guess what? You’re going to be able to access less stuff.

causal Aug 20, 2025 View on HN

Isn't CORS supposed to prevent this?

mewpmewp2 Feb 7, 2024 View on HN

But CORS is strict by default. They must specially add headers to allow such requests.

JanSt Feb 13, 2022 View on HN

CORS does not protect the website at all…

kentonv Jan 23, 2018 View on HN

No, CORS doesn't apply here. CORS regulates cross-origin requests, but the attack here makes the browser think the requests are same-origin.(Also, CORS can only be used to permit access that would normally be denied. CORS does not offer any way to deny access that is normally permitted.)

imglorp Dec 9, 2016 View on HN

This also sneaks past CORS. I'm thinking _that's_ a problem.

JanSt Feb 13, 2022 View on HN

CORS cannot be defeated, because it does not protect

wouldn't that be stopped by CORS blocking which is pretty much the norm for large websites?

gunapologist99 Apr 15, 2024 View on HN

It's an interesting feature, but remember that CORS exists for a reason; this can also lead to a delightful variety of custom CSRF attacks etc. ;)

philjackson Jul 10, 2019 View on HN

You're correct, the browser is the safety net when it comes to CORS.