What is the 'same-origin policy' (SOP) and what specific interactions does it restrict?
- A.Same-origin policy is enforced by the web server, not the browser
- B.Same-origin policy prevents loading resources from any origin other than the page's own origin; favicon requests bypass the same-origin policy entirely, executing any script the icon URL returns; X-Frame-Options: DENY prevents the page from framing others, not from being framed; HSTS is delivered through DNS TXT records, which is why it protects even the very first visit to a site; referrer-policy: no-referrer leaks the full URL to same-origin destinations, stripping it only cross-origin
- C.Same-origin policy restricts JavaScript from reading responses to cross-origin requests and from accessing cross-origin DOM. It does NOT prevent cross-origin form submissions, image/script/CSS loading (embedding), or preflight-less cross-origin requests. Origin is defined as scheme + host + port - any difference means different origin