Sandbox Security
With the introduction of new tags and features
in HTML things around the www has become easier and faster but at the same time a concern about security is alarming as well and cannot be ignored although
navigation, browsing, downloading, etc have become sophisticated but until and
unless the user agent is secure and safe there is always an issue.
HTML5 comes to the rescue with its
sandbox safeguard.
Earlier what happens is within the users
webpage, the user may allow the viewers to navigate to a 3rd party vendor and the
viewer trusting the page visits the 3rd party vendor site but it may happen
sometimes that somehow the viewer's information through cookies etc is misused by
some other party or some pop up may rise up ruining the look and feel of the
original page. In order to rein this property, the HTML5 sandbox comes with the
following features :
- Allow or Disable embedding of scripts in the page it is hosted in.
- Disable plugins such as flash, Silverlight plugins, etc
- Allow or Disable forms to make any post back to any target.
- Allow or Disable the links to other browser contents.
- The content is not allowed to navigate the DOM or retrieve the user information/ cookie and is treated under a unique origin.
The IDL used for sandboxing is defined as :
interface HTMLSandboxElement : HTMLElement
Applying this in HTML:
Starting with Sandboxing in HTML5.
This,sandbox, property or attribute is used under the <iframe></iframe> tag. for
example :
Follow the steps to use the sandbox attribute in HTML5 :
Step 1: Open any HTML editor or open Visual Studio and in the code part
write the following lines of code.
Step 2: The main properties that sandbox
exhibit are :
- {
- readonly attribute allowRemoting;
- readonly attribute allowStyleChange;
- readonly attribute allowDOMScripting;
- readonly attribute allowEventHandler;
- readonly attribute allowSubmit;
- boolean checkPermission(in DOMString attributeName);
- }


(i) Allow Forms: This property allows
the forms to post back within the frame. Tag used for this is as follows :
- <iframe sandbox = "allow-forms" src = "www.google.html"></iframe>


Join the conversation! Your thoughts help the community grow.