Does CORS protect my server from attackers?
Not directly. CORS is enforced by the browser and governs whether a script may read a cross-origin response; it does not stop non-browser clients like curl or a server-side proxy from reading your API. It protects users from having their authenticated responses read by other sites, not the server from being called.