Skip to content

Commit 082bef5

Browse files
committed
Update comments
Explain the reason for this function. Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
1 parent b5b0244 commit 082bef5

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎chromium/background.js‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,11 @@ function onCookieChanged(changeInfo) {
175175
}
176176

177177
// This event is needed due to the potential race between cookie permissions
178-
// update and cookie transmission, because the cookie API is non-blocking.
179-
// It would be less perf impact to have a blocking version of the cookie API
180-
// available instead.
178+
// update and cookie transmission (because the cookie API is non-blocking).
179+
// Without this function, an aggressive attacker could race to steal a not-yet-secured
180+
// cookie if they controlled & could redirect the user to a non-SSL subdomain.
181181
// WARNING: This is a very hot function.
182182
function onBeforeSendHeaders(details) {
183-
// XXX this function appears to enforce something equivalent to the secure
184-
// cookie flag by independent means. Is that really what it's supposed to
185-
// do?
186-
// @@@ Agreed, this function is really weird. I'm not sure it's even useful
187-
// since we block WebRequests to HTTP sites (and maybe rewrite them to SSL)
188-
// we force cookies to be sent over HTTPS even if they don't have the flag
189-
// "Secure" set. (Unless I'm reading this wrong?)
190183
// TODO: Verify this with wireshark
191184
for (var h in details.requestHeaders) {
192185
if (details.requestHeaders[h].name == "Cookie") {

0 commit comments

Comments
 (0)