DEV Community

Cover image for CORS settings that let other sites read your API
Georgi Kalchev
Georgi Kalchev

Posted on Originally published at aiskills402.com

CORS settings that let other sites read your API

CORS only decides which web pages may read a response in the browser. Reflected origins, wildcards with cookies, null and sloppy patterns undo that decision.

Cross-origin resource sharing is a permission slip that a server hands to browsers, saying which other web pages may read its responses. It does not keep anyone out of your server, it does not authenticate a caller, and it does nothing at all against a script or a command-line tool. What it guards is narrow and real: a page on one site should not be able to use a visitor's logged-in browser to read that visitor's private data from another site. Almost every serious misconfiguration is a way of handing out that slip to the wrong page. This guide explains what is being protected, then walks through the settings that give the protection away, and ends with a short check you can run against…

Read the full report on AISkills402: https://aiskills402.com/blog/cors-config-mistakes?utm_source=devto&utm_medium=social

Top comments (0)