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

Unified Diff: content/browser/child_process_security_policy_impl.cc

Issue 2347163004: Disallow navigations to blob URLs with non-canonical origins. (Closed)
Patch Set: Add tests. Created 4 years, 3 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
Index: content/browser/child_process_security_policy_impl.cc
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index 652a7ac175420cba631376bba186834094a5d1f8..32e2eeb8805b525a7f568a3930f52c1188fc8c64 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -579,6 +579,14 @@ bool ChildProcessSecurityPolicyImpl::CanRequestURL(
return false;
}
+ // https://crbug.com/646278 Valid blob URLs should contain canonically
+ // serialized origins.
+ if (url.SchemeIsBlob() &&
Charlie Reis 2016/09/20 16:28:55 Sanity check: Do we have the same problem for file
ncarter (slow) 2016/09/20 17:46:55 Potentially but the spoof doesn't directly transla
Charlie Reis 2016/09/20 23:19:06 Acknowledged.
+ !base::StartsWith(url.GetContent(), url::Origin(url).Serialize() + "/",
+ base::CompareCase::INSENSITIVE_ASCII)) {
+ return false;
+ }
+
// If the process can commit the URL, it can request it.
if (CanCommitURL(child_id, url))
return true;

Powered by Google App Engine
This is Rietveld 408576698