From 7d67148f52d158b80841f83dc7a023c637e11bf0 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 14 Apr 2018 22:22:59 +0200 Subject: moebius#159: CSP - support for "frame-ancestors" in "Content-Security-Policy-Report-Only" https://github.com/MoonchildProductions/moebius/pull/159 --- dom/security/test/csp/file_frame_ancestors_ro.html | 1 + .../test/csp/file_frame_ancestors_ro.html^headers^ | 1 + dom/security/test/csp/mochitest.ini | 3 + dom/security/test/csp/test_frame_ancestors_ro.html | 69 ++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 dom/security/test/csp/file_frame_ancestors_ro.html create mode 100644 dom/security/test/csp/file_frame_ancestors_ro.html^headers^ create mode 100644 dom/security/test/csp/test_frame_ancestors_ro.html (limited to 'dom/security/test/csp') diff --git a/dom/security/test/csp/file_frame_ancestors_ro.html b/dom/security/test/csp/file_frame_ancestors_ro.html new file mode 100644 index 000000000..ff5ae9cf9 --- /dev/null +++ b/dom/security/test/csp/file_frame_ancestors_ro.html @@ -0,0 +1 @@ +Child Document diff --git a/dom/security/test/csp/file_frame_ancestors_ro.html^headers^ b/dom/security/test/csp/file_frame_ancestors_ro.html^headers^ new file mode 100644 index 000000000..d018af3a9 --- /dev/null +++ b/dom/security/test/csp/file_frame_ancestors_ro.html^headers^ @@ -0,0 +1 @@ +Content-Security-Policy-Report-Only: frame-ancestors 'none'; report-uri http://mochi.test:8888/foo.sjs diff --git a/dom/security/test/csp/mochitest.ini b/dom/security/test/csp/mochitest.ini index ca5c2c6ea..33b112020 100644 --- a/dom/security/test/csp/mochitest.ini +++ b/dom/security/test/csp/mochitest.ini @@ -91,6 +91,8 @@ support-files = file_bug941404.html file_bug941404_xhr.html file_bug941404_xhr.html^headers^ + file_frame_ancestors_ro.html + file_frame_ancestors_ro.html^headers^ file_hash_source.html file_dual_header_testserver.sjs file_hash_source.html^headers^ @@ -240,6 +242,7 @@ skip-if = toolkit == 'android' # Times out, not sure why (bug 1008445) [test_bug910139.html] [test_bug909029.html] [test_bug1229639.html] +[test_frame_ancestors_ro.html] [test_policyuri_regression_from_multipolicy.html] [test_nonce_source.html] [test_bug941404.html] diff --git a/dom/security/test/csp/test_frame_ancestors_ro.html b/dom/security/test/csp/test_frame_ancestors_ro.html new file mode 100644 index 000000000..90f68e25e --- /dev/null +++ b/dom/security/test/csp/test_frame_ancestors_ro.html @@ -0,0 +1,69 @@ + + + + Test for frame-ancestors support in Content-Security-Policy-Report-Only + + + + + + + + -- cgit v1.2.3 From bd851735628cd6b07285e87fa60081e9d11a3b7e Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sat, 26 May 2018 15:00:01 -0400 Subject: Remove support and tests for HSTS priming from the tree. Fixes #384 --- dom/security/test/csp/test_referrerdirective.html | 2 -- 1 file changed, 2 deletions(-) (limited to 'dom/security/test/csp') diff --git a/dom/security/test/csp/test_referrerdirective.html b/dom/security/test/csp/test_referrerdirective.html index 770fcc40b..f590460a0 100644 --- a/dom/security/test/csp/test_referrerdirective.html +++ b/dom/security/test/csp/test_referrerdirective.html @@ -116,8 +116,6 @@ SimpleTest.waitForExplicitFinish(); SpecialPowers.pushPrefEnv({ 'set': [['security.mixed_content.block_active_content', false], ['security.mixed_content.block_display_content', false], - ['security.mixed_content.send_hsts_priming', false], - ['security.mixed_content.use_hsts', false], ] }, function() { -- cgit v1.2.3 From c1315412cc21a85fb779bef0d87dadde751cfe71 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 21 Jun 2018 20:57:09 +0200 Subject: Bug 1469150 - CSP: Scripts with valid nonce get blocked if URL redirects https://bugzilla.mozilla.org/show_bug.cgi?id=1469150 --- ...dom_security_test_csp_file_nonce_redirector.sjs | 25 ++++++++++++ ...dom_security_test_csp_file_nonce_redirects.html | 23 +++++++++++ ...dom_security_test_csp_test_nonce_redirects.html | 47 ++++++++++++++++++++++ dom/security/test/csp/mochitest.ini | 3 ++ 4 files changed, 98 insertions(+) create mode 100644 dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs create mode 100644 dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html create mode 100644 dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html (limited to 'dom/security/test/csp') diff --git a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs new file mode 100644 index 000000000..21a8f4e9c --- /dev/null +++ b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs @@ -0,0 +1,25 @@ +// custom *.sjs file for +// Bug 1469150:Scripts with valid nonce get blocked if URL redirects. + +const URL_PATH = "example.com/tests/dom/security/test/csp/"; + +function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-cache", false); + let queryStr = request.queryString; + + if (queryStr === "redirect") { + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", + "https://" + URL_PATH + "file_nonce_redirector.sjs?load", false); + return; + } + + if (queryStr === "load") { + response.setHeader("Content-Type", "application/javascript", false); + response.write("console.log('script loaded');"); + return; + } + + // we should never get here - return something unexpected + response.write("d'oh"); +} diff --git a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html new file mode 100644 index 000000000..e29116490 --- /dev/null +++ b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html @@ -0,0 +1,23 @@ + + + + + + Bug 1469150:Scripts with valid nonce get blocked if URL redirects + + + + + + + + diff --git a/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html b/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html new file mode 100644 index 000000000..f84fdcc7b --- /dev/null +++ b/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html @@ -0,0 +1,47 @@ + + + + + Bug 1469150:Scripts with valid nonce get blocked if URL redirects + + + + + + + + + + diff --git a/dom/security/test/csp/mochitest.ini b/dom/security/test/csp/mochitest.ini index 33b112020..86b7fd0cd 100644 --- a/dom/security/test/csp/mochitest.ini +++ b/dom/security/test/csp/mochitest.ini @@ -88,6 +88,8 @@ support-files = file_shouldprocess.html file_nonce_source.html file_nonce_source.html^headers^ + file_nonce_redirects.html + file_nonce_redirector.sjs file_bug941404.html file_bug941404_xhr.html file_bug941404_xhr.html^headers^ @@ -245,6 +247,7 @@ skip-if = toolkit == 'android' # Times out, not sure why (bug 1008445) [test_frame_ancestors_ro.html] [test_policyuri_regression_from_multipolicy.html] [test_nonce_source.html] +[test_nonce_redirects.html] [test_bug941404.html] [test_form-action.html] [test_hash_source.html] -- cgit v1.2.3 From d413e1fb87779a0c3f474f8e773e01ad0878beea Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 23 Jun 2018 04:29:34 +0200 Subject: Bug 1469150 - Tests added to check scripts with valid nonce is allowed if URL redirects (follow up) --- ...dom_security_test_csp_file_nonce_redirector.sjs | 25 ------------ ...dom_security_test_csp_file_nonce_redirects.html | 23 ----------- ...dom_security_test_csp_test_nonce_redirects.html | 47 ---------------------- dom/security/test/csp/file_nonce_redirector.sjs | 25 ++++++++++++ dom/security/test/csp/file_nonce_redirects.html | 23 +++++++++++ dom/security/test/csp/test_nonce_redirects.html | 47 ++++++++++++++++++++++ 6 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs delete mode 100644 dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html delete mode 100644 dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html create mode 100644 dom/security/test/csp/file_nonce_redirector.sjs create mode 100644 dom/security/test/csp/file_nonce_redirects.html create mode 100644 dom/security/test/csp/test_nonce_redirects.html (limited to 'dom/security/test/csp') diff --git a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs deleted file mode 100644 index 21a8f4e9c..000000000 --- a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirector.sjs +++ /dev/null @@ -1,25 +0,0 @@ -// custom *.sjs file for -// Bug 1469150:Scripts with valid nonce get blocked if URL redirects. - -const URL_PATH = "example.com/tests/dom/security/test/csp/"; - -function handleRequest(request, response) { - response.setHeader("Cache-Control", "no-cache", false); - let queryStr = request.queryString; - - if (queryStr === "redirect") { - response.setStatusLine("1.1", 302, "Found"); - response.setHeader("Location", - "https://" + URL_PATH + "file_nonce_redirector.sjs?load", false); - return; - } - - if (queryStr === "load") { - response.setHeader("Content-Type", "application/javascript", false); - response.write("console.log('script loaded');"); - return; - } - - // we should never get here - return something unexpected - response.write("d'oh"); -} diff --git a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html b/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html deleted file mode 100644 index e29116490..000000000 --- a/dom/security/test/csp/dom_security_test_csp_file_nonce_redirects.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Bug 1469150:Scripts with valid nonce get blocked if URL redirects - - - - - - - - diff --git a/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html b/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html deleted file mode 100644 index f84fdcc7b..000000000 --- a/dom/security/test/csp/dom_security_test_csp_test_nonce_redirects.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Bug 1469150:Scripts with valid nonce get blocked if URL redirects - - - - - - - - - - diff --git a/dom/security/test/csp/file_nonce_redirector.sjs b/dom/security/test/csp/file_nonce_redirector.sjs new file mode 100644 index 000000000..21a8f4e9c --- /dev/null +++ b/dom/security/test/csp/file_nonce_redirector.sjs @@ -0,0 +1,25 @@ +// custom *.sjs file for +// Bug 1469150:Scripts with valid nonce get blocked if URL redirects. + +const URL_PATH = "example.com/tests/dom/security/test/csp/"; + +function handleRequest(request, response) { + response.setHeader("Cache-Control", "no-cache", false); + let queryStr = request.queryString; + + if (queryStr === "redirect") { + response.setStatusLine("1.1", 302, "Found"); + response.setHeader("Location", + "https://" + URL_PATH + "file_nonce_redirector.sjs?load", false); + return; + } + + if (queryStr === "load") { + response.setHeader("Content-Type", "application/javascript", false); + response.write("console.log('script loaded');"); + return; + } + + // we should never get here - return something unexpected + response.write("d'oh"); +} diff --git a/dom/security/test/csp/file_nonce_redirects.html b/dom/security/test/csp/file_nonce_redirects.html new file mode 100644 index 000000000..e29116490 --- /dev/null +++ b/dom/security/test/csp/file_nonce_redirects.html @@ -0,0 +1,23 @@ + + + + + + Bug 1469150:Scripts with valid nonce get blocked if URL redirects + + + + + + + + diff --git a/dom/security/test/csp/test_nonce_redirects.html b/dom/security/test/csp/test_nonce_redirects.html new file mode 100644 index 000000000..f84fdcc7b --- /dev/null +++ b/dom/security/test/csp/test_nonce_redirects.html @@ -0,0 +1,47 @@ + + + + + Bug 1469150:Scripts with valid nonce get blocked if URL redirects + + + + + + + + + + -- cgit v1.2.3