Introduction to CORS for Go programmers - Eli Bendersky's website
From its inception, the Web has been a game of whackamole between people finding security holes and exploits, and other people plugging these holes and adding defensive security mechanisms. One of the busiest arenas in this struggle is the interaction between code running on one site (via JavaScript embedded in its page) and other sites; you may have heard about acronyms like XSS, CSRF, SSRF, SOP and CORS - they are all related to this dynamic and fascinating aspect of modern computer security. This post talks specifically about CORS, and what you should know if you're writing servers in Go. Our story starts with the Same-origin policy (SOP) - a mechanism built into browsers that prevents arbitrary access from the site you're currently browsing to other sites. Suppose you're browsing https://catvideos.meow; while you're doing so, your browser will execute JS code from that site's pages. JS can - among other things - fetch resources from other domains; this is commonly used for images,
From its inception, the Web has been a game of whackamole between people finding security holes and exploits, and other people plugging these holes and adding defensive security mechanisms. One of the busiest arenas in this struggle is the interaction between code running on one site (via JavaScript embedded in its page) and other sites; you may have heard about acronyms like XSS, CSRF, SSRF, SOP and CORS - they are all related to this dynamic and fascinating aspect of modern computer security. This post talks specifically about CORS, and what you should know if you're writing servers in Go. S
related reading
- What is CORS? Complete Tutorial on Cross-Origin Resource Sharingauth0.com
- Understanding The Web Security Model, Part IV: Cross-Origin Resource Sharing (CORS)educatedguesswork.org
- Developers don't understand CORSfosterelli.co
- Mediumranashreyas.medium.com
- Notes on structured concurrency, or: Go statement considered harmful - njs blogvorpus.org
- Understanding The Web Security Model, Part III: Basic Principles and the Origin Concepteducatedguesswork.org
- Frequently Asked Questions (FAQ) - The Go Programming Languagego.dev
- Node.js Fundamentals: Web Server Without Dependenciesblog.bloomca.me
- GitHub - alex/what-happens-when: An attempt to answer the age old interview question "What happens when you type google.com into your browser and press enter?"github.com
- Same-Origin Policytextbook.cs161.org
- Cross-Site Scripting (XSS) | Computer Securitytextbook.cs161.org
- Cross-Site Request Forgery (CSRF) | Computer Securitytextbook.cs161.org