×
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

SIGN IN YOUR ACCOUNT TO HAVE ACCESS TO DIFFERENT FEATURES

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR DETAILS?

AAH, WAIT, I REMEMBER NOW!

CREATE ACCOUNT

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

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 scenarios does the Same Origin Policy allow and deny in terms of website interactions?

by EITCA Academy / Saturday, 05 August 2023 / Published in Cybersecurity, EITC/IS/WASF Web Applications Security Fundamentals, Same Origin Policy, Cross-Site Request Forgery, Examination review

The Same Origin Policy (SOP) is a fundamental security concept in web applications that restricts interactions between different origins, including websites, to prevent unauthorized access and protect user data. The SOP defines the rules for determining whether two web pages have the same origin, which is based on the combination of the protocol, domain, and port number. In terms of website interactions, the SOP allows certain scenarios while denying others to maintain the security and integrity of web applications.

1. Same-origin interactions:
The SOP allows interactions between web pages that have the same origin. This means that web pages with the same protocol, domain, and port number can freely communicate and share resources without any restrictions. For example, if a user visits a website with the URL "https://www.example.com," any resources (such as JavaScript, CSS, or images) from the same origin can be loaded and executed by the browser without any issues.

2. Cross-origin interactions:
The SOP denies direct interactions between web pages from different origins. This prevents malicious websites from accessing or manipulating data from other websites without proper authorization. Cross-origin requests are typically blocked by modern web browsers to mitigate security risks such as Cross-Site Scripting (XSS) and Cross-Site Request Forgery (CSRF). However, there are some scenarios where cross-origin interactions are allowed under certain conditions:

a. Cross-Origin Resource Sharing (CORS):
The SOP allows cross-origin interactions if the server explicitly allows it through the use of CORS headers. CORS defines a set of HTTP headers that a server can use to specify which origins are allowed to access its resources. By including the appropriate CORS headers in the server's response, web applications can enable controlled cross-origin interactions for specific resources.

b. Cross-Origin Embedding:
The SOP allows embedding resources from different origins within web pages using HTML tags such as `<script>`, `<img>`, `<iframe>`, and `<link>`. However, these resources are subject to certain restrictions and security measures. For example, cross-origin scripts loaded through the `<script>` tag are executed in a separate context known as a "sandbox" to prevent them from interfering with the host page's functionality.

c. Cross-Origin Messaging:
The SOP allows web pages from different origins to communicate with each other using the postMessage API. This mechanism allows secure cross-origin messaging by explicitly specifying the target origin and validating the received messages. It enables scenarios such as embedding third-party widgets or components in web pages while maintaining a level of isolation and security.

3. Denial of certain interactions:
The SOP denies several types of interactions between web pages from different origins. These include:

a. Direct access to cross-origin resources:
Web pages cannot directly access resources (such as cookies, local storage, or DOM) from other origins unless they explicitly allow it through CORS headers. This prevents unauthorized reading or modification of sensitive data.

b. Cross-Origin Script Execution:
Cross-origin scripts cannot be executed in the context of a web page unless they are loaded from an explicitly allowed origin or use techniques like JSONP (JSON with Padding) that bypass the SOP. This restriction prevents the execution of potentially malicious scripts from unauthorized sources.

c. Cross-Origin XHR/Fetch Requests:
Cross-origin XMLHttpRequest (XHR) and Fetch requests are blocked by the SOP to prevent unauthorized access to resources on different origins. These requests can only be made if the server explicitly allows them through CORS headers.

The Same Origin Policy allows interactions between web pages with the same origin, while denying direct interactions between web pages from different origins. Cross-origin interactions are allowed under controlled conditions such as CORS, cross-origin embedding, and cross-origin messaging. However, certain interactions, such as direct access to cross-origin resources and execution of cross-origin scripts, are denied to maintain the security and privacy of web applications.

Other recent questions and answers regarding Cross-Site Request Forgery:

  • What potential workarounds exist to bypass the Same Origin Policy, and why are they not recommended?
  • How does the Same Origin Policy opt-in mechanism work for cross-origin communication?
  • What are the drawbacks of using the "document.domain" API to bypass the Same Origin Policy?
  • What is the purpose of the Cross-Origin Resource Sharing (CORS) API in enforcing the Same Origin Policy?
  • How does the Same Origin Policy restrict interactions between different origins in web applications?
  • How does the Same Origin Policy protect against Cross-Site Request Forgery (CSRF) attacks?
  • Explain the role of security headers in enforcing the Same Origin Policy.
  • How does the Same Origin Policy restrict the access of cookies in web pages?
  • How does the "lax" setting for cookies strike a balance between security and usability in web applications?
  • What are the three settings that control the behavior of cookies in relation to the Same Origin Policy?

View more questions and answers in Cross-Site Request Forgery

More questions and answers:

  • Field: Cybersecurity
  • Programme: EITC/IS/WASF Web Applications Security Fundamentals (go to the certification programme)
  • Lesson: Same Origin Policy (go to related lesson)
  • Topic: Cross-Site Request Forgery (go to related topic)
  • Examination review
Tagged under: Cross-Origin Embedding, Cross-Origin Messaging, Cross-Origin Resource Sharing, Cybersecurity, Same Origin Policy, SOP, Web Security
Home » Cross-Site Request Forgery / Cybersecurity / EITC/IS/WASF Web Applications Security Fundamentals / Examination review / Same Origin Policy » What scenarios does the Same Origin Policy allow and deny in terms of website interactions?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (106)
  • 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 (Reddit publ.)
  • About
  • Contact
  • Cookie Policy (EU)

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.

    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 Twitter
    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), governed by the EITCI Institute 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
    Follow @EITCI
    EITCA Academy

    Your browser doesn't support the HTML5 CANVAS tag.

    • Web Development
    • Cloud Computing
    • Quantum Information
    • Artificial Intelligence
    • Cybersecurity
    • GET SOCIAL
    EITCA Academy


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

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.