TIL that one of the purposes of Cross-Origin-Resource-Sharing - CORS (if not the only) is to secure data saved in the browser for a specific website. Judging from the relevant Wikipedia article, this only applies to HTTP Cookies. Therefore, if I implement CORS on backend, I have to list the specific allowed domains instead of *, because that would effectively create a security vulnerability.
But what if my service does not use browser cookies at all? I have a REST API, where the authorization is done by passing a special header, not relying on cookies in any way. Is it safe in this case to allow any CORS requests with Allow-Origin=*
on backend?