GithubHelp home page GithubHelp logo

iframe-csp's Introduction

Iframe CSP Sandbox Example

Guide for Iframe and Content Security Policy (CSP)

๐Ÿ“ Table of Contents

๐Ÿง About

  • Iframe CSP Sandboxing

๐Ÿ Getting Started

npm install
npm start

http://localhost:3000/iframecspsandbox.html

Information

  • Security

    When using an iframe, we are dealing with content coming from third
    party.
    you are increasing the risk of having potential vulnerability attack
    in your application.
    Luckily, we got "sandbox" attribute
    
    Rule of thumb: follow "the principle of least privilege"
    
  • sandbox="allow-same-origin"

  • referrerPolicy="strict-origin"

  • Attribute details:

Flag Details
allow-forms Allows form submission.
allow-modals Allows the resource to open new modal windows.
allow-orientation-lock Allows the resource to lock the screen orientation.
allow-pointer-lock Allows the resource to use the Pointer Lock API.
allow-popups Allows the resource to open new popups or tabs.
allow-popups-to-escape-sandbox Allows the resource to open new windows that will not inherit the sandboxing.
allow-presentation Allows the resource to start a presentation session.
allow-same-origin Allows the resource to maintain its origin.
allow-scripts Allows the resource to run scripts.
allow-top-navigation Allows the resource to navigate the top-level browsing context.
allow-top-navigation-by-user-activation Allows the resource to navigate the top-level browsing context, but only if initiated by a user gesture.

iframe-csp's People

Contributors

dhanugupta avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.