<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>8849</bug_id>
          
          <creation_ts>2010-01-31 18:46:26 +0000</creation_ts>
          <short_desc>The ability for an author to completely disable javascript on their webpage - an html scripts=&quot;no&quot; attribute</short_desc>
          <delta_ts>2010-10-04 13:55:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mac Clemmens">mac</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>mac</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>31372</commentid>
    <comment_count>0</comment_count>
    <who name="Mac Clemmens">mac</who>
    <bug_when>2010-01-31 18:46:26 +0000</bug_when>
    <thetext>Given the inevitable complexities surrounding DOM Scripting, it seems wise to provide the ability to include a global &quot;javascript disable&quot; tag or attribute in the document, disabling javascript completely for that page and preventing other browser scripting activity from accessing or manipulating it in any way. 

Despite obvious limitations, it would provide instant and inherent immunity to XSS and XSRF attacks. Authors who suddenly found an crippling XSS vulnerability on their site could add this tag to the affected page, forcing javascript to disable on all clients until the vulnerability is repaired. 

A bank, for example, could use this feature on their login page to prevent any script from reading, writing, or manipulating anything on that page under any circumstance. The author would be limited to HTML and CSS only.  

Here&apos;s an example implementation:

&lt;!DOCTYPE html&gt;&lt;html lang=&quot;en-US&quot; scripts=&quot;no&quot;&gt;

In order for it to work, it would need to block scripts before they are loaded and were able to change the DOM in any way. The client would proceed to load the page but treat the page as if javascript were disabled on the client, but just for that page.

I see this feature as a simple, easy-to-grasp measure of last resort for web authors, and I strongly encourage its consideration and adoption.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31374</commentid>
    <comment_count>1</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2010-01-31 21:03:46 +0000</bug_when>
    <thetext>We already have a mechanism for turning off scripts in @sandbox.  This also lets you apply more fine control than just shutting off scripts entirely.

Putting an entire page into sandbox mode is an interesting idea.  By itself, it doesn&apos;t work - &lt;html sandbox&gt; fails open in legacy browsers.  But if you then serve that page with text/html-sandboxed mimetype, it would have all the behaviors we want.  It would fail closed in legacy browsers, and give you full sandboxing control over the entire page.

So, counter-proposal!  Allow @sandbox on &lt;html&gt;.  Recommend that it be served with text/html-sandboxed to prevent unwanted execution in legacy clients.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31379</commentid>
    <comment_count>2</comment_count>
    <who name="Mac Clemmens">mac</who>
    <bug_when>2010-02-01 08:41:51 +0000</bug_when>
    <thetext>Re: #1 From Tab Atkins Jr.

I appreciate your counter-proposal. I would like to call for allowing @sandbox on &lt;html&gt; and recommending that it be served with text/html-sandboxed so it fails closed and prevents unwanted execution in legacy clients. 

It&apos;s an excellent point you make regarding the mimetype. Right now it browsers would just download the page instead of opening it. 

Here&apos;s an interesting question I stumbled upon while reading more on the matter:

For the content to be sent as this MIME-type youd have to be the one controlling the server sending the content. Why would you use an iframe to include content from your own site?

(http://blog.whatwg.org/whats-next-in-html-episode-2-sandbox/comment-page-1#comment-41070)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31985</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-02-14 06:50:23 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: I agree that this would be a good idea, but HTML is the wrong level for it. This is the kind of thing we should do at the HTTP layer.

It turns out that there&apos;s already work on this front:
   https://wiki.mozilla.org/Security/CSP

I recommend subscribing to the public-web-security@w3.org mailing list and discussing this there:
   http://lists.w3.org/Archives/Public/public-web-security/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35464</commentid>
    <comment_count>4</comment_count>
    <who name="Mac Clemmens">mac</who>
    <bug_when>2010-05-06 14:55:32 +0000</bug_when>
    <thetext>Thank you, Ian. I am very impressed with the Origin header format proposal and I believe it provides a better and more comprehensive solution to the problem I described. I&apos;ll mark this as closed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>