-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch includes: The security violation event and CSP report are now sent to the correct document via an interface ptr sent though the common params Added 'unsafe-allowed-redirects' keyword tests Bundled all CSP info into one InitiatorCSPInfo struct Modified existing tests to test the violation event as well Bug: 837627, 805886 Change-Id: I03124f29d4205ad4a5c2ac899b15f42e8e23659b Reviewed-on: https://chromium-review.googlesource.com/c/1124476 Commit-Queue: Andy Paicu <andypaicu@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/master@{#598336}
- Loading branch information
1 parent
881c8c1
commit 50812d2
Showing
35 changed files
with
314 additions
and
17 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
content-security-policy/navigate-to/child-navigates-parent-allowed.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
content-security-policy/navigate-to/link-click-cross-origin-allowed.sub.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
content-security-policy/navigate-to/link-click-cross-origin-blocked.sub.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
content-security-policy/navigate-to/link-click-redirected-allowed.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
content-security-policy/navigate-to/link-click-redirected-blocked.sub.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
content-security-policy/navigate-to/spv-only-sent-to-initiator.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
|
||
<head> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
</head> | ||
<body> | ||
<!-- This tests that a navigation initiator that has been replaced by the time | ||
the navigation it initiates is blocked, will not receive the SPV event. | ||
An iframe will navigate another iframe and the navigate itself. | ||
The second iframe's navigation response will be delayed by the server but will | ||
eventually be blocked by the CSP of the first iframe. | ||
By the time this happens the first iframe should be an entirely different | ||
document and it should not receive a SPV event --> | ||
<script> | ||
var t = async_test("Test that no spv event is raised"); | ||
window.onmessage = t.step_func(function(e) { | ||
if (e.data == "end_test") t.done(); | ||
else assert_unreached("Should not have raised a spv event"); | ||
}); | ||
|
||
var frames_loaded_count = 0; | ||
var frame_loaded = function() { | ||
if (++frames_loaded_count == 2) { | ||
// both child frame have loaded we can start the | ||
// test now, send a message to iframe1 so it knows to start | ||
document.getElementById('iframe1').contentWindow.postMessage('start_test', '*'); | ||
} | ||
} | ||
var i1 = document.createElement('iframe'); | ||
i1.src = "support/spv-test-iframe1.sub.html?report_id={{$id:uuid()}}"; | ||
i1.id = "iframe1"; | ||
i1.name = "iframe1"; | ||
i1.onload = frame_loaded; | ||
document.body.appendChild(i1); | ||
|
||
var i2 = document.createElement('iframe'); | ||
i2.src = "support/spv-test-iframe2.sub.html"; | ||
i2.id = "iframe2"; | ||
i2.name = "iframe2"; | ||
i2.onload = frame_loaded; | ||
document.body.appendChild(i2); | ||
</script> | ||
|
||
<script async defer src='../support/checkReport.sub.js?reportExists=false&reportID={{$id}}'></script> | ||
|
||
</body> |
12 changes: 12 additions & 0 deletions
12
content-security-policy/navigate-to/support/delayed_frame.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import time | ||
def main(request, response): | ||
time.sleep(1) | ||
headers = [("Content-Type", "text/html")] | ||
return headers, ''' | ||
<!DOCTYPE html> | ||
<head> | ||
</head> | ||
<body> | ||
DELAYED FRAME | ||
</body | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.