[Webkit-unassigned] [Bug 158103] New: Multiple CSP policies (report-only and enforcing) do not intersect correctly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 25 18:04:00 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=158103

            Bug ID: 158103
           Summary: Multiple CSP policies (report-only and enforcing) do
                    not intersect correctly
    Classification: Unclassified
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Macintosh
                OS: OS X 10.11
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: webkit at devd.me

Test case: http://lingro.com:81/cgi-bin/csp-2-enforcing.py


Content-Security-Policy: script-src 'nonce-foobar123'; report-uri /enforcing, script-src www.google.com; report-uri /enforcing2

<html>
    <head>
        <!-- This should execute without violations because it satisfies both policies -->
        <script nonce="foobar123" src="https://www.google.com/jsapi?callback=alert&1-ok"></script>

        <!-- This should NOT execute because it violates the (enforcing) whitelist policy -->
        <script nonce="foobar123" src="https://www.google.com.PL/jsapi?callback=alert&2-reporting-bad"></script>

        <!-- This should NOT execute because it violates the (enforcing) nonce policy -->
        <script src="https://www.google.com/jsapi?callback=alert&3-bad"></script>
    </head>
    <body>
    </body>
</html>


--

These have two policies: one with nonce and another with host based policies. A script should execute when it has the right nonce and the host matches the host-src whitelist. But, all script tags get blocked. Firefox handles this correctly (at least based on my reading of the spec) but Chrome also breaks (but is fixing). 

Relatedly, there is a similar bug when one policy is report-only and another is enforcing: 
http://lingro.com:81/cgi-bin/csp-both-modes-safari.py


thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160526/b57d3675/attachment.html>


More information about the webkit-unassigned mailing list