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

Unified Diff: extensions/common/csp_validator_unittest.cc

Issue 481643002: Disallow non-subdomain wildcards in the extension's CSP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . -> , Created 6 years, 4 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 | « extensions/common/csp_validator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/csp_validator_unittest.cc
diff --git a/extensions/common/csp_validator_unittest.cc b/extensions/common/csp_validator_unittest.cc
index 693a79106764e2870c816a588ecc7b92c86563f5..727a0683c4178743f6082ecf0d03b46e6040b027 100644
--- a/extensions/common/csp_validator_unittest.cc
+++ b/extensions/common/csp_validator_unittest.cc
@@ -99,11 +99,30 @@ TEST(ExtensionCSPValidator, IsSecure) {
EXPECT_FALSE(ContentSecurityPolicyIsSecure(
"default-src 'self' *:*/path", Manifest::TYPE_EXTENSION));
EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' https://", Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
"default-src 'self' https://*:*", Manifest::TYPE_EXTENSION));
EXPECT_FALSE(ContentSecurityPolicyIsSecure(
"default-src 'self' https://*:*/", Manifest::TYPE_EXTENSION));
EXPECT_FALSE(ContentSecurityPolicyIsSecure(
"default-src 'self' https://*:*/path", Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' https://*.com", Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' https://*.*.google.com/", Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' https://*.*.google.com:*/",
+ Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' https://www.*.google.com/",
+ Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' https://www.*.google.com:*/",
+ Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' chrome://*", Manifest::TYPE_EXTENSION));
+ EXPECT_FALSE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' chrome-extension://*", Manifest::TYPE_EXTENSION));
EXPECT_TRUE(ContentSecurityPolicyIsSecure(
"default-src 'self' https://*.google.com", Manifest::TYPE_EXTENSION));
« no previous file with comments | « extensions/common/csp_validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698