-
Notifications
You must be signed in to change notification settings - Fork 975
HSTS Fingerprinting #13437
HSTS Fingerprinting #13437
Changes from 8 commits
8fd9fce
2d95a75
4b6f90a
1f71cee
e582571
a399cb9
3a8d985
27ba205
c40994b
3a2640b
6b40aa7
0d90ece
97ab150
96c4fad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,6 +364,17 @@ function registerForHeadersReceived (session, partition) { | |
muonCb({ cancel: true }) | ||
return | ||
} | ||
|
||
let parsedTargetUrl = urlParse(details.url || '') | ||
let parsedFirstPartyUrl = urlParse(firstPartyUrl) | ||
let trackingHeaders = ['Strict-Transport-Security', 'Expect-CT', 'Public-Key-Pins'] | ||
if (isThirdPartyHost(parsedFirstPartyUrl.hostname, parsedTargetUrl.hostname)) { | ||
trackingHeaders.forEach(function (header) { | ||
delete details.responseHeaders[header] | ||
delete details.responseHeaders[header.toLowerCase()] | ||
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. this line shouldn't be needed because 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 checked yesterday, and I did see some headers in lowercase. 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. thanks for checking - i think i was confused because this seems potentially problematic because HTTP headers are case-insensitive according to the RFC. so someone could create a header called |
||
}) | ||
} | ||
|
||
for (let i = 0; i < headersReceivedFilteringFns.length; i++) { | ||
let results = headersReceivedFilteringFns[i](details, isPrivate) | ||
if (!module.exports.isResourceEnabled(results.resourceName, firstPartyUrl, isPrivate)) { | ||
|
@@ -844,6 +855,15 @@ module.exports.clearStorageData = () => { | |
} | ||
} | ||
|
||
module.exports.clearHSTSData = () => { | ||
for (let partition in registeredSessions) { | ||
let ses = registeredSessions[partition] | ||
setImmediate(() => { | ||
ses.clearHSTSData.bind(ses)(() => {}) | ||
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 this should just be |
||
}) | ||
} | ||
} | ||
|
||
/** | ||
* Clears all session caches. | ||
*/ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
these should be
const
notlet
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.
minor: rename
trackingHeaders
to something liketrackableSecurityHeaders
so it's more clear why we are deleting themThere 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 think these should also include https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Public-Key-Pins-Report-Only