Definition
CORS, or Cross-Origin Resource Sharing, is a security mechanism that allows web servers to indicate which other web domains are permitted to request resources from them. It works by using HTTP headers to tell browsers whether a web page from one origin can access resources from a different origin. This is crucial for preventing unauthorized data access and ensuring secure communication between web applications. For instance, a banking website might use CORS to allow its mobile app to access account information while blocking requests from other potentially malicious sites. CORS is often confused with Same-Origin Policy, which is a stricter browser security feature that by default prevents cross-origin requests. Understanding CORS is essential for cybersecurity professionals and appears on exams like CompTIA Security+ and CISSP.
