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

Unified Diff: chrome/browser/extensions/api/debugger/debugger_api.cc

Issue 910053002: Validate debuggee.targetId before use in chrome.debugger (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments #6 Created 5 years, 10 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 | « no previous file | chrome/browser/extensions/api/debugger/debugger_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/debugger/debugger_api.cc
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index f927fcb3545f25721ea8c71a591f9a133f7161e7..c2f701feac15fe016dd221b395dc5a8e176d3681 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -529,6 +529,15 @@ bool DebuggerFunction::InitAgentHost() {
}
} else if (debuggee_.target_id) {
agent_host_ = DevToolsAgentHost::GetForId(*debuggee_.target_id);
+ if (agent_host_.get()) {
+ if (PermissionsData::IsRestrictedUrl(agent_host_->GetURL(),
+ agent_host_->GetURL(),
+ extension(),
+ &error_)) {
+ agent_host_ = nullptr;
+ return false;
+ }
+ }
} else {
error_ = keys::kInvalidTargetError;
return false;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/debugger/debugger_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698