45
µ
s (depending on the datacenter). Finally, we can see that
our novel attacks are comparable to executing a sequential
timing attack on the local system, which confirms that, as we
determined in our formal model, concurrency-based timing
attacks are not affected by network conditions.
In addition to the measurements on nginx, we performed
a similar set of experiments against an Apache2 web server,
using the same experimental setup. We find that, in general,
timing attacks targeting web applications served by Apache2
require more requests compared to nginx, especially in opti-
mal network settings, such as localhost or the local network.
This can be attributed to the request handling mechanism
of Apache2, which is more computationally expensive com-
pared to that of nginx. Correspondingly, we find that the
concurrency-based attacks are also slightly affected by this,
as the variation in the computation increases. Nevertheless,
we find that the concurrency-based attacks still allow the ad-
versary to distinguish timing differences as small as 500ns.
The complete results of these experiments can be found in
Appendix B. As web servers need to handle more and more
requests, and become increasingly performant, we believe
the accuracy of (concurrent) timing attacks will continue to
improve.
4.3.3 Cross-site attacks
A key requirement of our concurrency-based timing attacks
against HTTP/2 is that we can manipulate the TCP socket
in such a way that both HTTP requests are sent in a single
packet. For cross-site attacks, where the requests are sent
from a victim’s browser, this is no longer possible, as the
browser handles all connections. To overcome this limita-
tion, we introduce another technique that leverages TCP’s
congestion control [3] and Nagle’s algorithm [8, §4.2.3.4].
The congestion control mechanism determines the number of
unacknowledged packets that a host can send, which is ini-
tially set to
10
on most operating systems and is incremented
with every received acknowledgment, as per TCP’s slow start
mechanism [48]. Furthermore, Nagle’s algorithm ensures that,
if there is unacknowledged data smaller than the maximum
segment size (MSS), user data is buffered until a full-sized
segment can be sent. For example, if an application would
consecutively send two small chucks of data, e. g., 20 bytes,
these will be combined and only a single packet of 40 bytes
will be sent. Consequently, as an attacker we can initiate a
bogus POST request with a sufficiently large body that exactly
fills the congestion window. Immediately after this POST re-
quest the attacker triggers the two concurrent requests, which
will be buffered and thus coalesced in a single packet when it
is eventually sent to the target website.
An important caveat is that the sending TCP window is
incremented with every ACK that is received. Consequently,
when (rapidly) performing multiple concurrency-based timing
measurements, an attacker would need to send an increasingly
large POST request to fill the sending TCP window. To over-
come this limitation, the adversary has two options. First, the
request-pairs could be padded such that two requests exactly
fit in a single packet. In virtually all cases the exact size of
the request can be predicted (the browser will always send
the same headers).
4
After sending the first bogus POST re-
quest to fill the initial TCP window, the attacker launches
several request-pairs, and every pair will be contained in a
single packet. As such, for every ACK that is received, two
new request-pairs will be sent. In our experiments, we found
that on low-latency connections, the ACKs would arrive very
rapidly, and thus the server would eventually become over-
loaded with requests, introducing jitter to the measurements.
As a workaround, the attacker could, instead of the initial large
bogus POST request, instead send 10 (= initial congestion
window) smaller requests with a delay of RTT/10 in between
the requests. As a result, the initial TCP window will still
be filled and ACKs would only arrive at a rate of RTT/10.
Ironically, this means that this technique (and thus the timing
measurements) works better on slower network connections.
An alternative technique to overcome the hurdles imposed
by the increasing TCP window, is to force the browser to close
the connection. Browser have an upper bound on the number
of active concurrent connections; if this limit is reached, it will
close the least recently used ones. For instance, in Chrome
this limit is set to 256 [42], and thus an attacker could make
the victim’s browser initiate connections to as many IP ad-
dresses, forcing it to close the connection to the targeted
server. On Firefox, this limit was increased to 900, except for
the Android-based browser applications, which remained at
256 [34]. We found that it is feasible to use this technique to
close an active connection; other mechanisms may also be
abused to do this (e. g., Firefox imposes a limit of 50 concur-
rent idle connections, and will close active connections when
this limit is reached). It should be noted that this technique
can be used in conjunction with the first one, if it is required
to reset the TCP window.
As the requests are coalesced in a single packet, the perfor-
mance of these cross-site timing attacks is the same as with
the direct attacks. To defend against this type of attack, the
webserver could set the SameSite attribute on cookies [36],
preventing it to be sent along in the cross-site requests, al-
though certain violations have been discovered [21,41]. As
of February 2020, Google Chrome is gradually rolling out
changes that mark cookies as SameSite by default [49].
4.3.4 Limitations
According to HTTPArchive’s annual report, which takes into
account data obtained from over 3 million regularly vis-
ited websites,
37.46%
desktop homepages are served over
4
When the cookie constantly changes in length and content, the HPACK
algorithm will not be able to refer to it with an entry in the dynamic table,
and thus the request length varies along with the length of the cookie.