Same-Origin Policy (SOP)
Last updated
Was this helpful?
Last updated
Was this helpful?
The Same-Origin Policy (SOP) is a critical security mechanism implemented in web browsers to prevent malicious interactions between resources from different origins.
An origin is defined by the combination of a webpage's protocol, domain and port:
Example of a SOP violation:
Rules for interactions between different origins:
http://store.example.com/page.html
http://store.example.com/newpage.html
YES
http://store.example.com/page.html
http://news.example.com/page.html
NO
http://store.example.com:80/page.html
http://store.example.com:8080/page.html
NO
https://store.example.com:8443/page.html
ABOUT:BLANK
YES
https://storage.example.com/dir/page.html
https://storage.example.com/dir/subdir/page.html
YES
In the table, storage.example.com
and about:blank
are shown on the same origin.
About:blank
has no origin and inherits the origin of the document that created it.