forked from crosswalk-project/chromium-crosswalk
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent extensions from accessing the Dice HTTP response header
Gaia can send a Oauth2 authorization code in the Dice response header. This is very sensitive information, and may allow an extension to generate a refresh token for the user account. For this reason, we choose to hide the Dice response headers to extensions. This header should be only hidden when sent from a Gaia origin, otherwise this could allow a website to hide information from extensions. This CL adds support for hiding response headers to extensions, and affects the web_request and declarative_web_request APIs. [email protected] (cherry picked from commit 1f0a8bf) Bug: 757478 Change-Id: I79adc8ae7bfad828647f1a8bd792a2976a69e280 Reviewed-on: https://chromium-review.googlesource.com/629081 Reviewed-by: Devlin <[email protected]> Reviewed-by: Mihai Sardarescu <[email protected]> Commit-Queue: David Roger <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#499173} Reviewed-on: https://chromium-review.googlesource.com/652449 Reviewed-by: David Roger <[email protected]> Cr-Commit-Position: refs/branch-heads/3202@{crosswalk-project#42} Cr-Branched-From: fa6a5d8-refs/heads/master@{#499098}
- Loading branch information
David Roger
committed
Sep 6, 2017
1 parent
4fee1fa
commit 9c00d71
Showing
23 changed files
with
430 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
chrome/browser/extensions/api/chrome_extensions_api_client_unittest.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/extensions/api/chrome_extensions_api_client.h" | ||
|
||
#include "google_apis/gaia/gaia_urls.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
#include "url/gurl.h" | ||
|
||
namespace extensions { | ||
|
||
TEST(TestChromeExtensionsAPIClient, ShouldHideResponseHeader) { | ||
ChromeExtensionsAPIClient client; | ||
EXPECT_TRUE(client.ShouldHideResponseHeader( | ||
GaiaUrls::GetInstance()->gaia_url(), "X-Chrome-ID-Consistency-Response")); | ||
EXPECT_TRUE(client.ShouldHideResponseHeader( | ||
GaiaUrls::GetInstance()->gaia_url(), "x-cHroMe-iD-CoNsiStenCY-RESPoNSE")); | ||
EXPECT_FALSE(client.ShouldHideResponseHeader( | ||
GURL("http://www.example.com"), "X-Chrome-ID-Consistency-Response")); | ||
EXPECT_FALSE(client.ShouldHideResponseHeader( | ||
GaiaUrls::GetInstance()->gaia_url(), "Google-Accounts-SignOut")); | ||
} | ||
|
||
} // namespace extensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.