flâneur — a map of the web's best reading

Same-Origin Policy | Computer Security

textbook.cs161.org · 468 words · saved by 1 readers

Browsing multiple webpages poses a security risk. For example, if you have a malicious website (www.evil.com) and Gmail (www.gmail.com) open, you don’t want the malicious website to be able to access any sensitive emails or send malicious emails with your identity. Modern web browsers defend against these attacks by enforcing the same-origin policy, which isolates every webpage in your browser, except for when two webpages have the same origin. The origin of a webpage is determined by its protocol, domain name, and port. For example, the following URL has protocol http, domain name www.example.com, and port 80. http://www.example.com/index.html To check if two webpages have the same origin, the same-origin policy performs string matching on the protocol, domain, and port. Two websites have the same origin if their protocols, domains, and ports all exactly match. Some examples of the same origin policy: http://wikipedia.org/a/ and http://wikipedia.org/b/ have the same origin. The protoc

Explore this link on the map →

saved by