This repository was archived by the owner on Jan 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
HSTS Fingerprinting #527
Closed
Closed
HSTS Fingerprinting #527
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1844,6 +1844,36 @@ index a433afd0217830b49ddb3381ad55afeae2381840..ddcca749666f956c6317676dbcdd48da | |
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); | ||
} | ||
|
||
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc | ||
index da7a19865989404f3147ca3e29a13f7f29f175d4..47fa22638f7450367c9014d2f2fa70f1659d2f15 100644 | ||
--- a/net/url_request/url_request_http_job.cc | ||
+++ b/net/url_request/url_request_http_job.cc | ||
@@ -415,8 +415,10 @@ void URLRequestHttpJob::NotifyBeforeSendHeadersCallback( | ||
} | ||
|
||
void URLRequestHttpJob::NotifyHeadersComplete() { | ||
- DCHECK(!response_info_); | ||
+ std::string first_party_host = request_->site_for_cookies().host(); | ||
+ std::string request_host = request_->url().host(); | ||
|
||
+ DCHECK(!response_info_); | ||
response_info_ = transaction_->GetResponseInfo(); | ||
|
||
// Save boolean, as we'll need this info at destruction time, and filters may | ||
@@ -426,8 +428,11 @@ void URLRequestHttpJob::NotifyHeadersComplete() { | ||
if (!is_cached_content_ && throttling_entry_.get()) | ||
throttling_entry_->UpdateWithResponse(GetResponseCode()); | ||
|
||
- // The ordering of these calls is not important. | ||
- ProcessStrictTransportSecurityHeader(); | ||
+ if (first_party_host == request_host) { | ||
+ // The ordering of these calls is not important. | ||
+ ProcessStrictTransportSecurityHeader(); | ||
+ } | ||
+ | ||
ProcessPublicKeyPinsHeader(); | ||
ProcessExpectCTHeader(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we should also move |
||
#if BUILDFLAG(ENABLE_REPORTING) | ||
diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h | ||
index 389315a25d7da30d71b59e3803ab795bc4c18e1c..79797fe7e674f9f6d2a65de542f262a945454f16 100644 | ||
--- a/net/url_request/url_request_job.h | ||
|
@@ -1870,7 +1900,7 @@ index 023555bcd3b56fd12c3319096deff07fa9854388..5b75bfaa858cead732a701029f45f549 | |
|
||
bool ShouldSelectReplacement() const { | ||
diff --git a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp | ||
index b73e62a0420f77db2874260a6f5e141264018cb8..c0f24ad844cb53eb813e4dc6ad7f8eef20ca7fc4 100644 | ||
index 9a59d4f569de1ea8f5cd84849e313b4512576043..8e12398d8a153f9710650e35f21b1f5b9de83dd3 100644 | ||
--- a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp | ||
+++ b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp | ||
@@ -3237,6 +3237,7 @@ void WebViewImpl::DidCloseContextMenu() { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we care about this warning? https://cs.chromium.org/chromium/src/net/url_request/url_request.h?q=site_for_cookies&sq=package:chromium&l=270
site_for_cookies
is used for firstPartyUrl in webRequest also; i don't exactly remember why we decided it wasn't an issue thereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even in this case we are using
site_for_cookies
to figure out the first party url.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 section 2.1, site for cookies is not the same as top-level site in a few cases:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it doesn't matter in this case since we only use the first party host to check if it is the same as the request host (which would not be empty in the cases above): https://github.com/brave/muon/pull/527/files#diff-85ff0d997b1a2f089546f7b2823b0ad7R1869