Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(965)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-block-same-resource-twice.html

Issue 1713093002: Fix SRI bypass by loading same resource twice in same origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2623
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/PendingScript.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-block-same-resource-twice.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-block-same-resource-twice.html b/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-block-same-resource-twice.html
new file mode 100644
index 0000000000000000000000000000000000000000..2534aa64234ef999cb48378e702d140ac861c158
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-block-same-resource-twice.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>SRI allows multiple hash values, valid if any passes among strongest</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <script>
+ // Regression test for https://crbug.com/584155
+ function insertScript(errorCallback) {
+ var script = document.createElement('script');
+ script.src = 'fail.js';
+ script.crossOrigin = 'anonymous';
+ script.integrity = "sha256-deadbeef";
+ script.onload = function() { assert_unreached(); }
+ script.onerror = errorCallback;
+ document.head.appendChild(script);
+ }
+
+ insertScript(function() {
+ insertScript(function() { done(); });
+ });
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/PendingScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698