Many times over the past N years, I've needed my own page (ABC.com) to get some data from a different origin (XYZ.com) and display it (all in JavaScript, no server fetching).
This doesn't work because XYZ.com doesn't have ABC.com in its Access-Control-Allow-Origin
header. If the header did include ABC.com, then my browser's cookies (namely the auth cookie) for XYZ.com would be sent along with the request to XYZ.com. I totally understand why the browser would want to stop ABC.com from making authenticated requests to XYZ.com if it didn't have access.
But in all of my scenarios, the request made to XYZ.com are resources that are available to the public, there is no authentication/cookies needed, anyone can grab them. I know that there are workarounds for this (have the ABC.com server request the data from XYZ.com). Or XYZ.com can publish JSONP. But in my cases, sometimes I'm serving my file from the local file system so there is no server. Getting it from a server is a PITA. And lastly, I haven't been in control of XYZ.com and can't force it to also publish JSONP. n The meat of the question - if ABC.com isn't in the Access Control Header for XYZ.com, why wouldn't the browser allow ABC.com's JavaScript to make a request to XYZ.com BUT NOT send any of XYZ.com's cookies being stored in the browser for that user. If the browser makers did that, does that open up the user to some sort of other vulnerability? Because I can't think of anything. What am I missing? Is it just a manpower thing, will that take too much time to program that?