OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 // renderer to load the URL and grant the renderer the privileges to request | 1232 // renderer to load the URL and grant the renderer the privileges to request |
1233 // the URL. To prevent this attack, we block the renderer from inserting | 1233 // the URL. To prevent this attack, we block the renderer from inserting |
1234 // banned URLs into the navigation controller in the first place. | 1234 // banned URLs into the navigation controller in the first place. |
1235 FilterURL(policy, process, false, &validated_params.url); | 1235 FilterURL(policy, process, false, &validated_params.url); |
1236 FilterURL(policy, process, true, &validated_params.referrer.url); | 1236 FilterURL(policy, process, true, &validated_params.referrer.url); |
1237 for (std::vector<GURL>::iterator it(validated_params.redirects.begin()); | 1237 for (std::vector<GURL>::iterator it(validated_params.redirects.begin()); |
1238 it != validated_params.redirects.end(); ++it) { | 1238 it != validated_params.redirects.end(); ++it) { |
1239 FilterURL(policy, process, false, &(*it)); | 1239 FilterURL(policy, process, false, &(*it)); |
1240 } | 1240 } |
1241 FilterURL(policy, process, true, &validated_params.searchable_form_url); | 1241 FilterURL(policy, process, true, &validated_params.searchable_form_url); |
1242 FilterURL(policy, process, true, &validated_params.password_form.origin); | |
1243 FilterURL(policy, process, true, &validated_params.password_form.action); | |
1244 | 1242 |
1245 // Without this check, the renderer can trick the browser into using | 1243 // Without this check, the renderer can trick the browser into using |
1246 // filenames it can't access in a future session restore. | 1244 // filenames it can't access in a future session restore. |
1247 if (!CanAccessFilesOfPageState(validated_params.page_state)) { | 1245 if (!CanAccessFilesOfPageState(validated_params.page_state)) { |
1248 GetProcess()->ReceivedBadMessage(); | 1246 GetProcess()->ReceivedBadMessage(); |
1249 return; | 1247 return; |
1250 } | 1248 } |
1251 | 1249 |
1252 delegate_->DidNavigate(this, validated_params); | 1250 delegate_->DidNavigate(this, validated_params); |
1253 } | 1251 } |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2050 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); | 2048 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); |
2051 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 2049 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
2052 file != file_paths.end(); ++file) { | 2050 file != file_paths.end(); ++file) { |
2053 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) | 2051 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) |
2054 return false; | 2052 return false; |
2055 } | 2053 } |
2056 return true; | 2054 return true; |
2057 } | 2055 } |
2058 | 2056 |
2059 } // namespace content | 2057 } // namespace content |
OLD | NEW |