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
Explore this link on the map →related reading
- Understanding The Web Security Model, Part IV: Cross-Origin Resource Sharing (CORS)educatedguesswork.org
- What is CORS? Complete Tutorial on Cross-Origin Resource Sharingauth0.com
- Understanding The Web Security Model, Part III: Basic Principles and the Origin Concepteducatedguesswork.org
- Mediumranashreyas.medium.com
- Timing-Allow-Origin header - HTTP | MDNdeveloper.mozilla.org
- Cross-Site Request Forgery (CSRF) | Computer Securitytextbook.cs161.org
- Frequently Asked Questions (FAQ) - The Go Programming Languagego.dev
- All learning materials - detailed | Web Security Academyportswigger.net
- Cursor Docs — Agent, Rules, MCP, Skills & CLIdocs.cursor.com
- Node.js Fundamentals: Web Server Without Dependenciesblog.bloomca.me
- Cross-Site Scripting (XSS) | Computer Securitytextbook.cs161.org
- Safely inject credentials in HTTP headers with Vercel Sandbox - Vercelvercel.com