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

Unified Diff: components/security_state/core/security_state.cc

Issue 2666783006: [Merge M-56] Display "Not secure" verbose state for data: URLs (Closed)
Patch Set: Created 3 years, 11 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 | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | components/security_state/core/security_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/security_state/core/security_state.cc
diff --git a/components/security_state/core/security_state.cc b/components/security_state/core/security_state.cc
index 160c6de8cc13314d23ba9fcaea713f6bd9dce9e2..42f2a5772320baccf2722b370de42e61754612d1 100644
--- a/components/security_state/core/security_state.cc
+++ b/components/security_state/core/security_state.cc
@@ -147,6 +147,12 @@ SecurityLevel GetSecurityLevelForRequest(
return DANGEROUS;
}
+ // data: URLs don't define a secure context, and are a vector for spoofing.
+ // Display a "Not secure" badge for all data URLs, regardless of whether
+ // they show a password or credit card field.
+ if (url.SchemeIs(url::kDataScheme))
+ return SecurityLevel::HTTP_SHOW_WARNING;
+
// Choose the appropriate security level for HTTP requests.
if (!is_cryptographic_with_certificate) {
if (!is_origin_secure_callback.Run(url) && url.IsStandard()) {
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | components/security_state/core/security_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698