Commit 38df1661 authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

WebSocket: Toughen check for sending cookies to renderer

The browser includes cookie headers in those it sends to the renderer if
DevTools is open. Add a check that the renderer has access to cookie
data for that origin.

This CL only changes the non-network-service codepath. The network
service code path will changed in a followup CL.

BUG=924972

Change-Id: Iaa9cd66ab805fa59a61b9f4ae192b4ef94c79962
Reviewed-on: https://chromium-review.googlesource.com/c/1439461Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629154}
parent 69bb5445
......@@ -83,8 +83,10 @@ class WebSocketManager::Delegate final : public network::WebSocket::Delegate {
}
bool CanReadRawCookies(const GURL& url) override {
return ChildProcessSecurityPolicyImpl::GetInstance()->CanReadRawCookies(
manager_->process_id_);
ChildProcessSecurityPolicyImpl* impl =
ChildProcessSecurityPolicyImpl::GetInstance();
return impl->CanReadRawCookies(manager_->process_id_) &&
impl->CanAccessDataForOrigin(manager_->process_id_, url);
}
void OnCreateURLRequest(int child_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment