As I read, the same origin policy is to prevent the creation of scenarios with an origin in the (evil) domain A to request a (good) domain B - in other words, fake a request to a cross-site site.
While playing a little, I found out about the Access-Control-Allow-Origin and CORS headers, which, as I once understood, allows you to indicate a server from a good domain B that domain A is a valid origin (hence not evil). If this header is missing from the cross-domain response, the browser will not read anything from it, but it has already made a request anyway.
Now I somehow missed this point. If domain B has a web services API and cookie authentication at login, basically any operation can be performed on behalf of a poor user with an evil origin A, only the attacker will not see the answer.
What am I missing here? Where are my reasonings wrong?
dev-null Jan 04 '15 at 1:09 on 2015-01-04 01:09
source share