Generated by GPT-5-mini| Same-origin policy | |
|---|---|
| Name | Same-origin policy |
| Introduced | 1995 |
| Implemented by | Netscape Communications Corporation, Mozilla Foundation, Apple Inc., Google LLC, Microsoft Corporation |
| Related | Cross-Origin Resource Sharing, Cookies, Web Storage, Content Security Policy |
Same-origin policy The same-origin policy is a critical web security model that restricts how documents or scripts loaded from one origin can interact with resources from another origin. Origin-based restrictions underpin many facets of modern World Wide Web security, shaping browser behavior implemented by vendors such as Netscape Communications Corporation, Mozilla Foundation, Apple Inc., Google LLC, and Microsoft Corporation. The policy evolved alongside standards work in organizations like the World Wide Web Consortium and the Internet Engineering Task Force to mitigate cross-site threats.
The rationale for origin separation arose during the early World Wide Web era when interactive features introduced by Mosaic and Netscape Navigator enabled dynamic scripting and stateful interactions. Web authors used languages and technologies such as JavaScript, ECMAScript, Java applets, ActiveX, and Adobe Flash to create richer applications. Browser vendors and standards bodies, including the World Wide Web Consortium and the Internet Engineering Task Force, proposed policies to prevent abuses observed in incidents involving phishing, cross-site scripting, and clickjacking that implicated organizations like eBay, PayPal, and Amazon. Early discussions drew on security models from projects at Sun Microsystems and research at universities such as Massachusetts Institute of Technology and Stanford University.
Origin is defined by a tuple: scheme, host, and port—principles formalized in specifications by the W3C and IETF. The origin concept relates to earlier notions in computing like the Bell–LaPadula model and capability-based systems developed at Cambridge University Computer Laboratory and MIT Laboratory for Computer Science. Origins distinguish resources hosted on domains like example.com, wikipedia.org, and github.com versus subdomains such as subdomain.example.com, and are sensitive to transport protocols such as HTTP and HTTPS. Specification text references and implementers at Mozilla Foundation, Google LLC, Apple Inc., and Microsoft Corporation codified the tuple origin model to prevent cross-origin access unless explicit allowances are granted.
Enforcing origin boundaries mitigates attack vectors including Cross-site scripting, Cross-Site Request Forgery, session hijacking, clickjacking, and credential stuffing. Threat actors associated with notable incidents targeting Target Corporation, Home Depot, and Sony Pictures Entertainment exploited weak cross-origin controls and third-party content inclusion. Browser flaws patched by teams at Mozilla Foundation and Google Project Zero demonstrated how bypasses could enable remote code execution or data exfiltration. Security research from institutions such as Carnegie Mellon University, University of California, Berkeley, and Oxford University examined timing attacks, Spectre-class side-channels, and cross-origin leaking that can defeat naive origin checks. Regulatory regimes like the General Data Protection Regulation and investigations by agencies such as the Federal Trade Commission influenced disclosure and remediation practices.
Practical web development required controlled relaxations: Cross-Origin Resource Sharing headers, JSONP, WebSockets, postMessage API, HTML5 Web Storage, and CORS preflight mechanisms. The Access-Control-Allow-Origin response header, implemented by servers like those at Apache HTTP Server, Nginx, Microsoft IIS, and Amazon Web Services, permits selective cross-origin resource sharing. Other standards and proposals—Cross-Origin-Opener-Policy, Cross-Origin-Embedder-Policy, Content Security Policy, SameSite cookie attribute—offer layered protections. Libraries and ecosystems such as jQuery, AngularJS, React, Vue.js, and Django provide abstractions that interact with cross-origin rules. Authentication schemes like OAuth 2.0, OpenID Connect, and identity providers including Google Identity Platform, Facebook Login, and Microsoft identity platform must account for origin constraints.
Major browser engines—Gecko by the Mozilla Foundation, Blink by Google LLC, WebKit by Apple Inc., and EdgeHTML/Chromium by Microsoft Corporation—implement origin checks consistent with specifications from the W3C and proposals tracked through the WHATWG. Vendors coordinate through channels such as IETF drafts and bug trackers at Bugzilla', Chromium Issue Tracker, and WebKit Bugzilla to resolve interoperability. Enterprise products and platforms—Microsoft Edge, Google Chrome, Mozilla Firefox, Apple Safari—expose developer tools and security flags that surface same-origin behavior. Standards work references RFCs and W3C recommendations and is influenced by reports from groups like OWASP.
Critics argue the policy is coarse-grained and can be brittle for modern web architectures involving third-party APIs, microservices, and CDNs like Cloudflare and Akamai Technologies. Researchers at Princeton University, ETH Zurich, and University College London highlighted limitations such as cross-origin information leakage via timing attacks and resource side-channels. Practical deployments rely on complex header configuration and developer understanding; mistakes have affected platforms run by GitHub, Twitter, and Stack Overflow. Alternative models proposed in academic venues such as USENIX, ACM SIGCOMM, IEEE Symposium on Security and Privacy, and conferences at Black Hat and DEF CON explore capability-based, origin-less, or intent-based controls, but adoption remains constrained by compatibility and ecosystem inertia.
Category:Web security