<?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>16203</bug_id>
          
          <creation_ts>2012-03-02 16:14:28 +0000</creation_ts>
          <short_desc>Nothing is said about what happens when default-src is omitted.</short_desc>
          <delta_ts>2012-05-03 16:16:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsSec</product>
          <component>CSP</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>sixcorners+w3c</reporter>
          <assigned_to name="Adam Barth">w3c</assigned_to>
          <cc>dveditz</cc>
    
    <cc>mike</cc>
    
    <cc>public-webappsec</cc>
    
    <cc>sixcorners+w3c</cc>
    
    <cc>w3c</cc>
          
          <qa_contact name="This bug has no owner yet - up for the taking">dave.null</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>64919</commentid>
    <comment_count>0</comment_count>
    <who name="">sixcorners+w3c</who>
    <bug_when>2012-03-02 16:14:28 +0000</bug_when>
    <thetext>The section right at the beginning of part 4 says that you should specify script-src and object-src, or you should specify default-src if you want to prevent xss attacks implying default-src is optional. What happens if default-src is left out?
Back at Mozilla it seems like it would have been the same as specifying &apos;none&apos; as the source list. https://wiki.mozilla.org/Security/CSP/Specification#Policy_Language_and_Syntax</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64923</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Barth">w3c</who>
    <bug_when>2012-03-02 16:38:48 +0000</bug_when>
    <thetext>Nothing happens if you omit default-src.  An empty policy has no effect.  We probably should say that explicitly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64927</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-03-02 18:02:00 +0000</bug_when>
    <thetext>Can we make a separate Bugzilla component for CSP?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64945</commentid>
    <comment_count>3</comment_count>
    <who name="">sixcorners+w3c</who>
    <bug_when>2012-03-03 00:30:11 +0000</bug_when>
    <thetext>Is no effect similar to default-src: *? Anything goes?
Wow, oops.. I guess I should have thought about what CORS meant before posting this.. Did I at least get the product right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64946</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Barth">w3c</who>
    <bug_when>2012-03-03 00:37:52 +0000</bug_when>
    <thetext>&gt; Is no effect similar to default-src: *?

default-src * still restricts inline scripts and eval.

&gt; Anything goes?

Yes.  An empty policy is the same as having no policy at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67245</commentid>
    <comment_count>5</comment_count>
    <who name="Daniel Veditz">dveditz</who>
    <bug_when>2012-05-02 17:23:21 +0000</bug_when>
    <thetext>wait, if I have a policy that consists entirely of
   script-src: &apos;self&apos;; img-src: *

I&apos;m really getting an implied * for everything else? That violates my understanding of CSP as a whitelist -- if I don&apos;t specify something (either explicitly or via the fallback default-src) then I expect not to get any. In other words, a missing default-src should be equivalent to &quot;default-src: &apos;none&apos;&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67293</commentid>
    <comment_count>6</comment_count>
    <who name="Adam Barth">w3c</who>
    <bug_when>2012-05-03 16:14:03 +0000</bug_when>
    <thetext>&gt; wait, if I have a policy that consists entirely of
&gt;    script-src: &apos;self&apos;; img-src: *
&gt; 
&gt; I&apos;m really getting an implied * for everything else?

Yes.  More precisely, there are no restrictions on anything else.  For example, inline style would also be allowed.

&gt; That violates my
&gt; understanding of CSP as a whitelist -- if I don&apos;t specify something (either
&gt; explicitly or via the fallback default-src) then I expect not to get any. In
&gt; other words, a missing default-src should be equivalent to &quot;default-src:
&gt; &apos;none&apos;&quot;.

We had a long discussion about this topic in the working group.  We ended up deciding that only directives present in the policy would have any effect.  If you&apos;d like to specify a default-src, you need to include the default-src directive.

As a further example, a policy containing only the sandbox directive would have no effect on loading fonts.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>