×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What is the full meaning of SOP in web security?

by Julius Adabrah / Tuesday, 02 September 2025 / Published in Cybersecurity, EITC/IS/ACSS Advanced Computer Systems Security, Network security, Web security model

The acronym SOP in web security stands for "Same-Origin Policy." The Same-Origin Policy is a foundational security concept implemented by web browsers to restrict how documents or scripts loaded from one origin can interact with resources from another origin. This mechanism is integral to the web security model as it is designed to prevent malicious scripts on one page from obtaining access to sensitive data on another web page through the browser.

Definition of Origin

In the context of the Same-Origin Policy, an "origin" is defined as a combination of the protocol (scheme), host (domain), and port of a URL. Only if all three components match exactly are two URLs considered to share the same origin. For example, the URLs `https://www.example.com:443/page1.html` and `https://www.example.com:443/page2.html` have the same origin. However, the following are considered different origins:

– `http://www.example.com` vs `https://www.example.com` (different scheme)
– `https://www.example.com` vs `https://sub.example.com` (different host)
– `https://www.example.com:443` vs `https://www.example.com:8443` (different port)

Purpose and Role in Web Security

The Same-Origin Policy is a security boundary that mitigates several classes of attacks, most notably Cross-Site Scripting (XSS) and Cross-Site Request Forgery (CSRF). Without such a policy, any website loaded in a browser tab would be able to freely read or modify the content of any other site the user has open, including private information and session credentials.

For example, if SOP did not exist, a malicious website could create a hidden iframe that loads a user's online banking site, access the user's authenticated session, and read or manipulate privileged information without the user's consent.

What SOP Restricts

The Same-Origin Policy restricts several types of interactions between resources from different origins. The key access controls include:

– DOM Access: Scripts from one origin are prohibited from accessing the Document Object Model (DOM) of documents loaded from a different origin. This means, for example, that JavaScript running on `site-a.com` cannot read the DOM of a page loaded from `site-b.com`.
– Cookies and Local Storage: Browsers enforce the SOP by ensuring that scripts can only read and write cookies, local storage, and session storage associated with their own origin.
– AJAX Requests: XMLHttpRequest and the Fetch API are subject to the SOP, so a script can only make requests to resources within its own origin unless the target server uses Cross-Origin Resource Sharing (CORS) headers to explicitly allow the request.
– JavaScript Execution Context: Execution contexts are isolated based on origin to prevent code from one origin from affecting another.

Practical Examples

Example 1: DOM Access Prohibition

If a user has two pages open in their browser:

– Page A: `https://bank.example.com/account.html`
– Page B: `https://evil.com/steal.html`

A script running on `evil.com` cannot use JavaScript to inspect or manipulate the content of the open `account.html` tab or iframe, because the origins differ.

Example 2: AJAX Requests and CORS

Suppose a script on `https://news.example.com` tries to fetch sensitive information from `https://private.example.com/data.json` using an XMLHttpRequest or the Fetch API. Unless `private.example.com` includes a suitable CORS header (e.g., `Access-Control-Allow-Origin: https://news.example.com`), the browser will block the request, enforcing the SOP.

Example 3: Cookie Isolation

Cookies set by one origin are not accessible by scripts running in another origin. For instance, a session cookie for `https://mail.example.com` is not accessible to JavaScript running on `https://shopping.example.com`, even if both are subdomains of `example.com`, unless specifically configured via the domain attribute and HTTPOnly/secure flags.

Exceptions and Relaxations

There are mechanisms by which SOP can be relaxed, but these require explicit cooperation from the target server and are designed to be safe:

– Cross-Origin Resource Sharing (CORS): CORS is a protocol that allows servers to specify who can access their resources via additional HTTP headers. With CORS, a server can allow specific origins (or all origins) to bypass the SOP for particular resources.
– Document.domain: For legacy support, subdomains within the same parent domain can set their `document.domain` property to a common value, allowing limited relaxation of the SOP for DOM access. However, this approach is increasingly discouraged due to its complexity and security implications.
– postMessage API: To enable safe cross-origin communication, browsers provide the `window.postMessage()` function, allowing scripts from different origins to send messages without direct DOM access.
– JSONP (JSON with Padding): Historically, JSONP was a workaround for SOP limitations, allowing data retrieval via dynamic `<script>` tags. Because script tags are not subject to SOP, they can fetch and execute JavaScript from other origins. However, JSONP is mostly obsolete today due to security risks and the widespread adoption of CORS.
– Sandboxed iframes: HTML5 allows for iframes to be sandboxed, restricting or permitting specific capabilities, including script execution and form submission, thereby controlling the impact of the SOP.

Limitations and Security Considerations

While the SOP is a robust security mechanism, it is not without its limitations and challenges:

– Complexity in Modern Web Applications: The growing complexity of modern web applications, along with the increasing use of APIs and third-party resources, often necessitates cross-origin requests. This increases the reliance on mechanisms like CORS, which in turn can introduce configuration errors leading to vulnerabilities.
– Subdomain Takeover: If an organization does not carefully manage its subdomains, an attacker could potentially take over a subdomain and use the relaxation of SOP via `document.domain` to attack other subdomains.
– SOP Bypasses: Browser vulnerabilities, misconfigurations, or intentionally weakened policies can lead to SOP bypasses. Attackers actively search for such weaknesses, especially in browser implementations and plugins.
– Legacy APIs: Some older browser APIs, such as Flash or Java applets, historically had less strict enforcement of SOP, leading to additional attack vectors.

Impact on Web Application Design

Web developers must design their sites with the SOP in mind. Key points include:

– Ensuring that sensitive resources are only accessible to trusted origins, preferably limited to the same origin.
– Implementing CORS policies with minimal exposure, allowing only known and trusted origins rather than using wildcards.
– Avoiding unnecessary relaxation of SOP through mechanisms such as `document.domain`.
– Using secure cookies (`HttpOnly` and `Secure` flags) to mitigate risks from potential SOP bypasses.
– Employing the `Content Security Policy` (CSP) header to reduce the risk of XSS, which can be used to circumvent SOP under certain circumstances.

Evolution and Future Directions

The Same-Origin Policy has been a fundamental part of browser security since the early days of the web. Its importance has only increased with the proliferation of client-side applications and cloud-based services. The introduction of CORS, Content Security Policy, and other HTTP headers represents an ongoing effort to balance usability and security, allowing cross-origin interactions in a controlled, auditable fashion.

Browser vendors continue to refine the SOP and related mechanisms, addressing new classes of attacks and developing new APIs for safe cross-origin communication, such as `Service Workers`, `Web Workers`, and secure storage mechanisms.

The Same-Origin Policy (SOP) is a foundational browser security measure that restricts how scripts and resources from different origins interact. By enforcing strict rules on DOM access, cookies, AJAX requests, and other critical operations, the SOP helps contain the impact of malicious scripts and protects user data. Its interaction with protocols like CORS, and its limitations, are central considerations for any advanced practitioner in the field of web security.

Other recent questions and answers regarding EITC/IS/ACSS Advanced Computer Systems Security:

  • What are some of the challenges and trade-offs involved in implementing hardware and software mitigations against timing attacks while maintaining system performance?
  • What role does the branch predictor play in CPU timing attacks, and how can attackers manipulate it to leak sensitive information?
  • How can constant-time programming help mitigate the risk of timing attacks in cryptographic algorithms?
  • What is speculative execution, and how does it contribute to the vulnerability of modern processors to timing attacks like Spectre?
  • How do timing attacks exploit variations in execution time to infer sensitive information from a system?
  • How does the concept of fork consistency differ from fetch-modify consistency, and why is fork consistency considered the strongest achievable consistency in systems with untrusted storage servers?
  • What are the challenges and potential solutions for implementing robust access control mechanisms to prevent unauthorized modifications in a shared file system on an untrusted server?
  • In the context of untrusted storage servers, what is the significance of maintaining a consistent and verifiable log of operations, and how can this be achieved?
  • How can cryptographic techniques like digital signatures and encryption help ensure the integrity and confidentiality of data stored on untrusted servers?
  • What are Byzantine servers, and how do they pose a threat to the security of storage systems?

View more questions and answers in EITC/IS/ACSS Advanced Computer Systems Security

More questions and answers:

  • Field: Cybersecurity
  • Programme: EITC/IS/ACSS Advanced Computer Systems Security (go to the certification programme)
  • Lesson: Network security (go to related lesson)
  • Topic: Web security model (go to related topic)
Tagged under: Browser Security, CORS, Cybersecurity, Same Origin Policy, SOP, Web Application Security
Home » Cybersecurity » EITC/IS/ACSS Advanced Computer Systems Security » Network security » Web security model » » What is the full meaning of SOP in web security?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.

Eligibility for EITCA Academy 80% EITCI DSJC Subsidy support

80% of EITCA Academy fees subsidized in enrolment by

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2025  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    Chat with Support
    Chat with Support
    Questions, doubts, issues? We are here to help you!
    End chat
    Connecting...
    Do you have any questions?
    Do you have any questions?
    :
    :
    :
    Send
    Do you have any questions?
    :
    :
    Start Chat
    The chat session has ended. Thank you!
    Please rate the support you've received.
    Good Bad