CORS: A Presentation
CORS: A Presentation
RESOURCE
SHARING
SPANDAN BHATTARAI
WHY DID THE WEB DEVELOPER
DECLINE THE INVITATION TO THE
Because they were too strict about the Same-Origin Policy,
PARTY?
and they didn't want any "unauthorized access" to their dance
moves! They just couldn't risk any cross-origin requests
disrupting their smooth moves on the dance floor!
·WHAT IS CORS?
A
• SOP MECHANISM
THAT USES
HOW DOES
• ORIGIN HTTP IT WORK?
HEADERS TO
DEFINE
ORIGINS THAT
SOP AND ORIGIN
• web pages can only access resources from the same origin
• origin consists of the combination of protocol (e.g., HTTP or HTTPS), domain,
and port
CORS
• mechanism that relaxes the SOP
restrictions to enable controlled
access to resources from different
origins
• headers are used to specify the
permissions granted to other
origins
CORS
CORS
ACCESS-CONTROL-ALLOW-
HEADERS
ACCESS-CONTROL-ALLOW- ACCESS-CONTROL-ALLOW-
ORIGIN METHODS: CREDENTIALS:
Request executes an malicious The target website recognizes The victim's browser, while on
action on the target i.e. request as authorized CORS the malicious website, sends a
modifying account settings, origin (the attacker's domain) request to the target website.
making transactions, or and allows to proceed.
altering user data.
• Proper configuration of cross-
origin requests
YOU!
References
• https://lo-victoria.com/introduction-to-cross-origin-resource-sharing-cors
• https://portswigger.net/web-security/cors/access-control-allow-origin
• https://portswigger.net/web-security/cors
• https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
• https://www.youtube.com/@RanaKhalil101
• https://www.chat.openai.com
• https://bard.google.com/
• https://portswigger.net/web-security/cors/lab-basic-origin-reflection-attack
• https://rb.gy/ge9jb