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

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

Issue 2660333003: [Merge M-57] 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 d5e867ed6de8ae7ea425a6ac330887c8a8ac19c3..b818c8aee801b4907a76a92a2e2c15afc42f455d 100644
--- a/components/security_state/core/security_state.cc
+++ b/components/security_state/core/security_state.cc
@@ -124,6 +124,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