| ▲ | encomiast 3 hours ago | ||||||||||||||||||||||
It's not just CORS that's hard to understand. Many (most?) developers don't really understand the threat model. And even when it's explained it hard to see why it's a big deal. Part of this is that backend developers usually have to configure CORS and it's not an access privilege protection. From the point of view of the backend it doesn't seem to matter. Bad guys can't get it. From the point of view of the front-end it's often seen as a nuisance. The article does a nice job giving a concrete example. | |||||||||||||||||||||||
| ▲ | yaur 2 hours ago | parent | next [-] | ||||||||||||||||||||||
It’s not that hard to understand… in the cors threat model an attacker gets one your users to take an action on your site by visiting their site. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | cookiengineer 2 hours ago | parent | prev [-] | ||||||||||||||||||||||
On top of that, it's a threat model that doesn't make really sense from an attacker vs defender perspective. Because it's optional, and all kinds of other libraries and tools can just blatantly ignore it anyways. CORS literally exists only against XSS and CSRF for actively logged in human users. Anything else in CORS is absolutely pointless because every other attack scenario uses scripts or programs that fake HTTP headers anyways. It's just as useless as the Sec-CH (client hint) headers because some Browser made by a company that starts with Micro and ends with Slop decided that the User Agent always needs to be Windows 10 for compatibility reasons. That is why you see everyone just enabling every CORS option anyways, even though that is literally the worst case that allows XSS and CSRF. And a lot of websites have user edited content at some place, at the very least in images that aren't filtered for embedded scripts (PNGs, anyone?). | |||||||||||||||||||||||
| |||||||||||||||||||||||