Issue metadata
Sign in to add a comment
|
CSP 'referrer' directive ignored for preload requests
Reported by
king...@gmail.com,
Apr 21 2016
|
||||||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36
Steps to reproduce the problem:
1.
write a html page like this
<?php
header("Content-Security-Policy: referrer origin-when-crossorigin");
?>
<html>
<head>
<link href="http://www.style.com" rel="stylesheet" type="text/css" />
</head>
<img src="https://www.img1.com/">
<img src="http://www.img2.com/x.png">
<img src="http://www.img3.com" rel=”noreferrer”>
<iframe src="http://www.iframe.com/"></iframe>
<script src="http://www.script.com/"></script>
<script>
var xmlhttp;
xmlhttp = new XMLHttpRequest();
xmlhttp.open('http://www.ajaxtesttest.com').send();
</script>
</html>
2.
set the csp header:
Content-Security-Policy: referrer origin-when-crossorigin
or
Content-Security-Policy: referrer origin-when-cross-origin
3.
view this html page in chrome, and you will see that we can bypass the csp policy by using img/script/link tags
What is the expected behavior?
the resource requested from the webpage with csp header set should not send the entire referer
What went wrong?
A tag href/JS ajax/iframe-src/Object-data/embed-src will follow the referrer policy in CSP header.
but, style-link-href/img-src/script-src can bypass the csp referer policy header.
btw,
we find that the csp policy in meta tag works fine ,like this:
<meta http-equiv="Content-Security-Policy" content="referrer origin-when-cross-origin">
we think csp header should be the same with meta tag
Did this work before? N/A
Chrome version: 50.0.2661.75 Channel: beta
OS Version: OS X 10.11.2
Flash Version: Shockwave Flash 21.0 r0
,
Apr 21 2016
,
Apr 21 2016
Assigning to estark@, since referer is in her realm.
,
Apr 21 2016
This is a preload issue. We pick up a document's referrer policy from meta tags if we scan one while preloading, but we don't use a referrer policy set via header. Looks like we just need to be using document->getReferrerPolicy() here: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp&sq=package:chromium&l=802&rcl=1461222997
,
Apr 22 2016
,
Apr 25 2016
,
Apr 25 2016
,
Apr 28 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e49d943e9f5f90411313e64d0ae6b646edc85043 commit e49d943e9f5f90411313e64d0ae6b646edc85043 Author: estark <estark@chromium.org> Date: Thu Apr 28 01:08:51 2016 Use document referrer policy when preloading Previously, preload requests used the referrer policy from meta tags encountered during scanning, but not from headers delivered with the page. This CL uses the document's current referrer policy when the preload scan starts. BUG= 605451 Review-Url: https://codereview.chromium.org/1913983002 Cr-Commit-Position: refs/heads/master@{#390264} [add] https://crrev.com/e49d943e9f5f90411313e64d0ae6b646edc85043/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/referrer-from-document-on-preload-expected.html [add] https://crrev.com/e49d943e9f5f90411313e64d0ae6b646edc85043/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/referrer-from-document-on-preload.php [modify] https://crrev.com/e49d943e9f5f90411313e64d0ae6b646edc85043/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp [modify] https://crrev.com/e49d943e9f5f90411313e64d0ae6b646edc85043/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
,
Apr 28 2016
,
Apr 28 2016
Updating title to be more specific
,
Apr 28 2016
,
Apr 28 2016
Thank you for your quick response to this security issue. How can i get a CVE number, could you assign it? : )
,
Apr 28 2016
+timwillis
,
May 9 2016
Hello, CVE-IDs are only assigned where the bug is in a stable build (this issue in in stable) and the bug meets the severity for a reward. We'll take this to our reward panel and let you know if it meets the threshold for a reward and a CVE-ID.
,
May 10 2016
all right, this issue bypass the chrome W3C standard security policy , i think it should be assigned a CVE-ID. any way , waiting for your conclusions , thank you~
,
Jun 1 2016
is there any conclusion?
,
Jul 14 2016
Congratulation, the panel has decided to award $500 for this bug. Our finance team will be in touch in the new few weeks with more details.
,
Jul 14 2016
,
Jul 18 2016
Thank you very much, i recieved a email from your finance team. i'll follow the steps in the email. so , is there a CVE-ID assigned or acknowledgment later ? :) hope for that
,
Jul 20 2016
,
Jul 20 2016
,
Jul 21 2016
,
Jul 22 2016
+awhalley@ whether to take this merge in for M53 Dev release on Tuesday (07/26).
,
Jul 22 2016
Humm - this should already be in 53 (commit was at 390264, 53 branched at 403382). +mbarbella@ - a sheriffbot hiccup or me getting the wrong end of the stick?
,
Jul 22 2016
This is related to the same issue we discussed yesterday (it's trying to request a merge to beta using stable + 1 instead of the actual beta milestone). I should be able to fix this later today.
,
Jul 22 2016
+awhalley@, do we need a merge to M52?
,
Jul 22 2016
Nope, already in M52.
,
Jul 22 2016
[Automated comment] Commit may have occurred before M53 branch point (6/30/2016), needs manual review.
,
Jul 22 2016
Per comment #24, this is already in M53 branch 2785. So removing "Merge-Review-53" label.
,
Jul 25 2016
,
Jul 25 2016
,
Aug 4 2016
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 1 2016
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 2 2016
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 2 2016
,
Apr 25 2018
,
Jul 28
|
|||||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||||
Comment 1 by king...@gmail.com
, Apr 21 2016