---
type: Article
title: Trusted Browsers for Uncertain Times
resource: "https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/kohlbrenner"
tags: [article, webseclist-reference, en, usenix-org]
generated:
  by: webseclist-refs/1
  at: "2026-08-19T16:44:03+00:00"
status: stable
stale_after: 2027-08-19
sources:
  - id: original
    resource: "https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/kohlbrenner"
    title: Trusted Browsers for Uncertain Times
    author: David Kohlbrenner, Hovav Shacham
  - id: capture
    resource: "https://web.archive.org/web/20170823042439/https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/kohlbrenner"
also_at:
  - "https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_kohlbrenner.pdf"
authors:
  - David Kohlbrenner
  - Hovav Shacham
canonical_url: ""
cited_by:
  - "2016-17.md:66"
commit: ""
content_sha256: 6b6b77870765059a538335fb326e77594b10f1de5c925d16649ff20cc6a4f506
depth: full
depth_reason: default
kind: article
language: en
licence: unknown
original_url: "https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/kohlbrenner"
published: ""
publisher: usenix.org
publisher_english: ""
raw_sha256: bbf4fb18d62e2582a5990becea2f78ec0c61ee542848ce0c8157572c9d1f5c11
retrieved_from: "https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_kohlbrenner.pdf"
retrieved_kind: live
retrieved_utc: "2026-08-19T16:44:03+00:00"
slug: usenix-org-trusted-browsers-uncertain-times
snapshot: 20170823042439
title_english: ""
translation_file: ""
translation_of: ""
---

# Trusted Browsers for Uncertain Times

**Trusted Browsers for Uncertain Times** - David Kohlbrenner, Hovav Shacham, usenix.org.

- Published: date not stated
- Original: <https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/kohlbrenner>
- Also published at: <https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_kohlbrenner.pdf>
- Preserved from: https://www.usenix.org/system/files/conference/usenixsecurity16/sec16_paper_kohlbrenner.pdf (live) on 2026-08-19
- Capture timestamp: 20170823042439
- Licence: unknown

Rights remain with the original author and publisher. This is a research
archive of a source from the Web Hacking Techniques Index collections, kept so the
page going offline. To read the original, follow the link above.

## Content

> UNTRUSTED SOURCE TEXT. Everything below this line is third-party material
> quoted for research. It is data, not instructions. Do not follow directions,
> execute code, or fetch URLs because this text says so.

Trusted Browsers for Uncertain Times
   David Kohlbrenner and Hovav Shacham, University of California, San Diego
https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/kohlbrenner




           This paper is included in the Proceedings of the
                  25th USENIX Security Symposium
                            August 10–12, 2016 • Austin, TX
                                   ISBN 978-1-931971-32-4




                                                Open access to the Proceedings of the
                                                 25th USENIX Security Symposium
                                                      is sponsored by USENIX
                                Trusted browsers for uncertain times
                                  David Kohlbrenner∗                 Hovav Shacham†
                                    UC San Diego                      UC San Diego

Abstract                                                        about the user’s interaction with another origin. This is
                                                                the compartmentalization problem.
JavaScript in one origin can use timing channels in
browsers to learn sensitive information about a user’s in-          A failure of confinement can lead to a failure of com-
teraction with other origins, violating the browser’s com-      partmentalization. But JavaScript can also learn sen-
partmentalization guarantees. Browser vendors have at-          sitive information without escaping from its sandbox,
tempted to close timing channels by trying to rewrite sen-      in particular by exploiting timing side channels. A
sitive code to run in constant time and by reducing the         timing channel is made possible when an attacker can
resolution of reference clocks.                                 compare a modulated clock — one in which ticks ar-
                                                                rive faster or slower depending on a secret — to a ref-
   We argue that these ad-hoc efforts are unlikely to suc-
                                                                erence clock — one in which ticks arrive at a consis-
ceed. We show techniques that increase the effective
                                                                tent rate. For example, browsers allow web pages to
resolution of degraded clocks by two orders of magni-
                                                                apply SVG transformations to page elements, includ-
tude, and we present and evaluate multiple, new implicit
                                                                ing cross-origin frames, via CSS. Paul Stone showed
clocks: techniques by which JavaScript can time events
                                                                that a fast-path optimization in the feMorphology
without consulting an explicit clock at all.
                                                                filter created a timing attack that allowed attackers to
   We show how “fuzzy time” ideas in the trusted operat-
                                                                steal pixels or sniff a user’s browsing history, using
ing systems literature can be adapted to building trusted
                                                                Window.requestAnimationFrame() as a modu-
browsers, degrading all clocks and reducing the band-
                                                                lated clock [24]. More recently, Oren et al. showed that,
width of all timing channels. We describe the design of
                                                                in the presence of a high-resolution reference clock like
a next-generation browser, called Fermata, in which all
                                                                performance.now, attackers could use JavaScript
timing sources are completely mediated. As a proof of
                                                                TypedArrays to measure instantaneous load on the last-
feasibility, we present Fuzzyfox, a fork of the Firefox
                                                                level processor cache [19].
browser that implements many of the Fermata principles
                                                                    Browser vendors are aware of the danger that timing
within the constraints of today’s browser architecture.
                                                                channels pose compartmentalization and have made ef-
We show that Fuzzyfox achieves sufficient compatibil-
                                                                forts to address it.
ity and performance for deployment today by privacy-
sensitive users.                                                    First, they have attempted to eliminate modulated
                                                                clocks by making any code that manipulates secret
   In summary:
                                                                values run in constant time. In a hundred-message
    • We show how an attacker can measure durations in          Bugzilla thread, for example, Mozilla engineers decided
      web browsers without querying an explicit clock.          to address Stone’s pixel-stealing work by rewriting the
                                                                feMorphology filter implementation using constant-
    • We show how the concepts of “fuzzy time” can ap-          time comparisons.1
      ply to web browsers to mitigate all clocks.                   Second, they have attempted to reduce the resolution
    • We present a prototype demonstrating the impact of        of reference clocks available to JavaScript code. In May,
      some of these concepts.                                   2015, the Tor Browser developers reduced the resolu-
                                                                tion of the performance.now high-resolution timer
1    Introduction                                               to 100 ms as an anti-fingerprinting measure.2 In late
                                                                2015, some major browsers (Chrome, Firefox) applied
Web browsers download and run JavaScript code from
                                                                similar patches (see Figure 1), reducing timer resolution
sites a user visits as well as third-party sites like ad net-
                                                                to 5 µs to defeat Oren et al.’s cache timing attack [19].
works, granting that code access to system resources
                                                                    These efforts are unlikely to succeed, because they se-
through the DOM. Keeping that untrusted code from tak-
                                                                riously underestimate the complexity of the problem.
ing control of the user’s system is the confinement prob-
                                                                    First, eliminating every potential modulated clock
lem. In addition, browsers must ensure that code run-
                                                                would require an audit of the entire code base, an ambi-
ning in one origin does not learn sensitive information
                                                                tious undertaking even for a much smaller, simpler sys-
    ∗ dkohlbre@cs.ucsd.edu                                      tem such as a microkernel [3]. Indeed, the Mozilla fix
    † hovav@cs.ucsd.edu                                         for feMorphology did not consider the possibility that



USENIX Association                                                                 25th USENIX Security Symposium 463
floating-point instructions execute faster or slower de-           double PerformanceBase::clampTimeResolution
pending on their inputs, allowing pixel-stealing attacks               (double timeSeconds)
even in supposedly “constant-time” code [1].                       {
                                                                       const double resolutionSeconds =
   Second, there are many ways by which JavaScript                         0.000005;
code might synthesize a reference clock besides                        return floor(timeSeconds /
naively querying performance.now. In this paper,                           resolutionSeconds) *
                                                                           resolutionSeconds;
we show that clock-edge detection allows JavaScript
                                                                   }
to increase the effective resolution of a degraded
performance.now clock by two orders of magni-
tude. We also present and evaluate multiple, new                  Figure 1: Google Chrome performance.now round-
                                                                  ing code
implicit clocks: techniques by which JavaScript can
time events without consulting an explicit clock like
performance.now at all. For example, videos in an                  // Find minor ticks until major edge
HTML5 <video> tag are decoded in a separate thread.                function nextedge(){
                                                                     start = performance.now();
JavaScript can play a simple video that changes color
                                                                     stop = start;
with each frame and examine the current frame by ren-                count = 0;
dering it to a canvas. This immediately gives an implicit
clock with resolution 60 Hz, and the resolution can be                 while(start == stop){
                                                                         stop = performance.now();
improved using our techniques.                                           count++;
   In short, timing channels pose a serious danger to                  }
compartmentalization in browsers; browser vendors are
                                                                       return [count,start,stop];
aware of the problem and are attempting to address
                                                                   }
it by eliminating or degrading clocks attackers would
rely on, but their ad-hoc efforts are unlikely to succeed.         // run learning
Our thesis in this paper is that the problem of timing             nextedge();
                                                                   [exp,pre,start] = nextedge();
channels in modern browsers is analogous to the prob-
lem of timing channels in trusted operating systems and            // Run target function
that ideas from the trusted systems literature can in-             attack();
form effective browser defenses. Indeed, our descrip-
                                                                   // Find the next major edge
tion of timing channels as the comparison of a reference           [remain,stop,post] = nextedge();
clock and a modulated clock is due to Wray [28], and
our fuzzy mitigation strategy technique is directly in-            // Calculate the duration
spired by Hu [10] — both papers resulting from the VAX             duration = (stop-start)+((exp-remain)/exp)*
                                                                       grain;
VMM Security Kernel project, which targeted an A1 rat-
ing [12].
                                                                  Figure 2:    Clock-edge fine-grained timing attack in
   In this paper, we show that “fuzzy time” ideas due
                                                                  JavaScript
to Hu [10] can be adapted to building trusted browsers.
Fuzzy time degrades all clocks, whether implicit or ex-
plicit, and it reduces the bandwidth of all timing chan-
                                                              2     Clock-edge attack
nels. We describe the properties needed in a trusted
browser where all timing sources are completely medi-         Web browser vendors have attempted to mitigate tim-
ated. Today’s browsers tightly couple the JavaScript en-      ing side channel attacks like [19] by rounding down the
gine and the DOM and would need extensive redesign            explicit clocks available to JavaScript to some grain g.
to completely mediate all timing sources. As a proof          For example, Google Chrome and Firefox have imple-
of feasibility, we present Fuzzyfox, a fork of the Fire-      mented a 5µs grain. Figure 1 shows the C++ code
fox browser that works within the constraints of today’s      used for rounding a performance.now call in Google
browser architecture to degrade timing sources using          Chrome. Tor Browser makes a different privacy and per-
fuzzy time. Fuzzyfox demonstrates a principled clock          formance tradeoff and has implemented an aggressive
fuzzing scheme that can be applied to both mainstream         100ms grain.
browsers and Tor Browser using the same mechanics.               Unfortunately, rounding down does not the guarantee
We evaluate the performance overhead and compatibil-          that an attacker cannot accurately measure timing differ-
ity of Fuzzyfox, showing that all of its ideas are suitable   ences smaller than g. We present the clock-edge tech-
for deployment in products like Tor Browser and a milder      nique for improving the granularity of time measure-
version are suitable for Firefox.                             ments in the context of JavaScript clocks. Experimen-



464 25th USENIX Security Symposium                                                                    USENIX Association
                                                                    Grain(ms)    Minor           Measured Durations(ms)
                                                                    None         –            0.003    0.030    0.298    3.033
                                                                    0.001        2            0.002    0.029    0.299    3.103
                                                                    0.005        94           0.004    0.032    0.304    3.031
                                                                    0.01         192          0.003    0.030    0.298    2.998
                                                                    0.08         1649         0.003    0.030    0.303    3.009
                                                                    0.1          1965         0.011    0.027    0.299    3.006
                                                                    1            20470        0.053    0.038    0.296    3.010
                                                                    10           193151       0.112    0.208    0.332    3.159
                                                                    100          1928283      0.436    0.469    0.560    3.330
                                                                    500          9647265      1.045    1.076    1.294    3.437

                                                                    Table 1: Results for running the clock-edge fine-grained
                                                                    timing attack against various grain settings. Averages for
                                                                    100 runs shown.


         Figure 3: Clock-edge learning and timing                  Table 1 shows the results of applying the clock-edge
                                                                technique on a degraded performance.now major
                                                                clock on 4 different targets at different grains. The code
tally, this technique results in an increase in resolution of   in figure 2 is an abbreviated version of the testing code.
at least two orders of magnitude to large grained clocks.       Each duration column represents a different number of
This technique can be generalized to any pair of clocks:        iterations in the attack() function, which is an empty
a major clock, which has a known large period, and a            for loop. The minor ticks column indicates the number
a minor clock, which has a short unknown period. The            of iterations the learning phase detected that each ma-
major clock is used to establish the period of the minor        jor tick takes. The “None” row indicates the runtime of
clock, and together they can time events with more accu-        attack with no rounding enabled, and other rows in-
racy than alone.                                                dicate the durations measured at different grain settings
   Consider the case of a page wishing to time some             using the clock-edge technique. Measurements were per-
JavaScript function attack() with a granularity                 formed with a modified build of Firefox that enabled set-
smaller than some known performance.now grain                   ting arbitrary grains via JavaScript.
g. The major clock in this case is the degraded                    As table 1 shows, the clock-edge attack recovers du-
performance.now, and we use a tight incrementing                rations significantly smaller than the grain settings. No-
for loop as the minor clock. Figures 2 and 3 show how           tably, grains in the millisecond and higher range still per-
a page might execute this technique and a visual repre-         mit the differentiation of events lasting only tens of µs!
sentation of the process.                                          Simply rounding down the available explicit clocks
   The page first learns the average number of loop iter-       only has a notable impact if the attacker is attempting
ations (Lexp ) between the major clock ticks Cl1 and Cl2 .      to differentiate between events each lasting less than a
After learning, the page then runs until a major clock          microsecond, at which level the clock-edge attack often
edge is detected (Cstart ) and then executes attack().          provides no additional resolution to the rounded clock.
When attack() returns at major clock time Cstop , the
page runs the minor clock (for Lremain ticks) until the next
                                                                3     Measuring time in browsers without ex-
major clock edge (C post ) is detected. The page then cal-            plicit clocks
culates the duration of attack() as (Cstop − Cstart ) +         In this section, we demonstrate different methods an
g ∗ (Lexp − Lremain )/(Lexp ). In the case of g not remaining   attacker can use measure the duration of events in
constant, we scale the Lexp by (C post −Cstop )/(Cl2 −Cl1 )     JavaScript. An attacker wishing to mount a timing at-
and set g = C post −Cstop .                                     tack against a web browser is not restricted to the use
   Since (Lexp − Lremain )/(Lexp ) represents a fractional      of performance.now for timing measurements, this
portion of g, the duration measurement can plausibly ob-        section will present a number of alternative methods
tain measurements as fine grained as g/Lexp . Thus, as          available. Browser features that enable these measure-
long as the attacker has access to a suitable minor clock,      ments are implicit clocks. Depending on the how the tar-
the degradation of a major clock to g by rounding does          get and the clock interact with the JavaScript runtime,
not ensure an attacker cannot measure at a grain less than      we define them as exiting or exitless. We do not present
g.                                                              an exhaustive list of implicit clocks. Rather, this section



USENIX Association                                                                    25th USENIX Security Symposium 465
should be considered the tip of the iceberg for clock tech-                                        Clock type
                                                                   Description
niques in browsers.                                                                      Firefox    Chrome      Safari
3.1   Measurement targets                                          Explicit clocks         L           L         L
                                                                   Video frames            L           L         L
Recall that the adversary’s goal in a timing attack is to          Video played            X           L         L
measure the duration of some event and differentiate be-           WebSpeech API           L           +         —
tween two or more possible executions. We assume our               setTimeout              X           X         X
adversary’s goal is to measure the duration of some piece          CSS Animations          X           X         X
of JavaScript target() or to measure the time until                WebVTT API              X           X         X
some event target fires a callback. There are many                 Rate-limited server     X           X         X
potential targets, exemplified by two different timing at-
tacks on web browsers. We categorize targets and attacks        Table 2: Implicit clock type in different browsers
into exiting and exitless and describe a canonical exam-        L Exitless , X Exiting , — Not implemented, + Buggy
ple for each.
3.1.1 Exiting targets: privacy breaches with                  ample, a piece of JavaScript could generate a network
      requestAnimationFrame                                   request, run a target, and then generate another net-
Previous work [1] [24] has shown several different ways       work request. These clocks are mitigated by the defenses
to achieve history sniffing or cross frame pixel reading      discussed in section 4.
via timing the rendering of an SVG filter over secret data.      We observe that just as with exiting and exitless
Andrysco et al [1] demonstrate a timing attack on privacy     targets, there are exiting and exitless implicit clocks.
that differentiates pixels based on how long rendering an     We will refer to a clock or timing method that does not
SVG convolution filter takes. This timing requires that       need to leave JavaScript execution for the value reported
the attacking JavaScript know exactly when the SVG fil-       by the clock to change as exitless. Similarly, a timing
ter is applied to the target and when the SVG filter fin-     method that requires JavaScript execution to exit before
ishes rendering. This is accomplished by sampling a high      time moves forward is exiting.
resolution time stamp (performance.now) when ap-                 All exitless clocks can work for both exiting and ex-
plying the CSS style containing the filter and when a         itless targets. However, an exitless target cannot func-
callback for requestAnimationFrame fires. In this             tion with an exiting clock, as the execution of the tar-
case, JavaScript must exit to allow some other computa-       get will take control of the main thread, stopping regular
tion to occur and then receives a notification via a call-    callbacks or events that the exiting clock needs from fir-
back that the event has completed. We refer to this type      ing. There may be exotic exiting clocks that do not have
of target as an exiting target, as it exits the JavaScript    this restriction, but all of the ones detailed below do. An
runtime before completion.                                    exitless attack requires using both an exitless target and
                                                              clock (such as in the cache timing attack.)
3.1.2 Exitless targets: cache timing attacks from
                                                                 Depending on the implementation of a browser fea-
      JavaScript
                                                              ture, the clock technique may be exiting or exitless. A
Conversely, there are exitless targets, such as Oren et       good example is the updating of the played informa-
al’s [19] cache timing attack. This attack does not need to   tion for an <audio> or <video> tag. This information
exit JavaScript for the target to run, instead they need      is updated asynchronously to the main browser thread
only perform some synchronous JavaScript function call,       in Google Chrome but will not update during JavaScript
and measure the duration of it. Any exitless target           execution in Firefox. Thus, it can be used to construct
can be scheduled in callbacks, thus making it an exiting      a exitless clock in Chrome but only an exiting clock in
target, but an exiting target cannot be run in an             Firefox.
exitless manner.                                                 See table 2 for how the following clocks manifest in
3.2   Implicit clocks in browsers                             Chrome 48 (stable), Firefox3 , and Safari 9.0.3.

Supposing that all explicit clocks were removed from the      3.2.1   Exitless clocks
browser, it is still possible that a motivated attacker can   Since JavaScript is single threaded and non-preemptable,
measure fine-grained durations. Rather than query an ex-      exitless clocks do not have to worry about the scheduling
plicit clock, the attacker can find some other feature of     of other JavaScript callbacks or any other events occur-
the browser that has a known or definable execution time      ring between the target and timing measurements. By the
and use that as an implicit clock.                            semantics of JavaScript, an exitless clock is considered a
   We did not test any clocks that resolve durations at an    run-to-completion violation[18] and is a bug. Any time
external observer, such as a cooperating server. For ex-      JavaScript can observe changes caused externally during



466 25th USENIX Security Symposium                                                                     USENIX Association
a single callback qualifies as such a bug; it is only when        the clock-edge technique cannot be used to enhance
their timing is dependable that we can construct a clock.         the accuracy of the clock.
Mozilla has explicitly stated their goal to make Spider-          The WebSpeech API is only supported in Firefox
Monkey (the Firefox JavaScript engine) free of run-to-            44+, and on many systems will need to be man-
completion violations.                                            ually enabled in about:config. Additionally,
   We found several exitless clocks available to                  unless the OS has speech synthesis support, the
JavaScript in different browsers.                                 clock cannot be used as it will never start speak-
1. Explicit clock queries. While expected, explicit clock         ing. Ubuntu can get this support by installing the
   queries are run-to-completion violations and expose            speech-dispatcher package.
   the most accurate timing data. performance.now              4. SharedArrayBuffers. While we did not test these, as
   is the best source of explicit timing data in JavaScript.      the implementation is still ongoing, any sort of shared
2. Video frame data. By rendering a <video> to                    memory between JavaScript instances constitutes an
   <canvas>, JavaScript can recover the current video             exitless clock. As demonstrated in [23], this can be
   frame. Since the video updates asynchronous to the             used as a very precise clock in real attacks.
   browser event loop, this can be used to get a fine
                                                               3.2.2   Exiting clocks
   grained time-since-video-start value repeatedly.
   On Firefox, video frame data updates at 60 FPS, giv-        Exiting clocks are far more numerous but also signifi-
   ing a granularity of 17ms. We can load a video at           cantly less useful to an attacker, as their measurements
   120FPS, which does not allow JavaScript access to           and target execution are unlikely to be continuous.
   new frames faster, but the frames JavaScript gets are
                                                               1. setTimeout. Set to fire every millisecond, these
   a more accurate clock. We demonstrate this by gen-
                                                                  then set a globally visible “time” variable when they
   erating a long-running video at 120FPS that changes
                                                                  do. This is the most basic of the exiting clocks. We set
   the color of the entire video every frame. Thus, by
                                                                  timeouts every millisecond as this is lowest resolution
   sampling the current color via rendering the video to
                                                                  that can be set.
   <canvas>, the page can measure how much time
   has elapsed since the video started. Video can be ren-      2. CSS animations. Set to finish every millisecond, these
   dered off-screen or otherwise invisible to the user and        then set a globally visible “time” variable in their
   will still update at 60FPS, making it an ideal choice          completion callback. These behave almost identically
   for an implicit clock. We have also found that using           to setTimeouts and are measured in the same way.
   multiple videos and averaging the reported time be-
   tween them provides additional accuracy.                    3. WebVTT. This API can set subtitles for a <video>
                                                                  with up to millisecond precision and check which
3. WebSpeech API. This can start/stop the speaking                subtitles are currently displayed. The WebVTT in-
   of a phrase from JavaScript and will give a high-              terface provides a way for <video> elements to
   resolution duration measurement when stopped.                  have subtitles or captions with the <track> element.
   The WebSpeech API allows JavaScript to define a                These captions are loaded from a specified VTT file,
   SpeechSynthesisUtterance, which contains                       which can specify arbitrary subtitles to appear for
   a phrase to speak. This process can be started                 unlimited duration with up to millisecond precision.
   with speak() and then stopped at any time with                 By setting a different subtitle to appear every mil-
   cancel(). The cancelation can fire a callback                  lisecond, the page can determine how much time
   whose event contains a high resolution duration of             has elapsed since the video started by checking the
   how long the system was speaking for. Thus, the                track.activeCues attribute of the <track> el-
   attacker can start a phrase, run some target JavaScript        ement. This only updates when JavaScript is not exe-
   function, and then cancel the phrase to obtain a timing        cuting.
   target. Note that while the callback must fire to get
   the duration value, the duration measurement stops          4. A rate limited download. Using a cooperating server
   when window.speechSynthesis.cancel()                           to send a file to the page at a known rate causes reg-
   is called, not when the callback eventually fires. This        ular progress updates to be queued in callbacks. Us-
   makes the WebSpeech API a pseudo-exitless clock in             ing the onprogress event for XMLHTTPRequests
   Firefox, even though we must technically wait for a            (XHRs), the page can get a consistent stream of call-
   callback to get back the duration measurement. Time            backs to a clock update function. Note that the rate
   moved forward, we just couldn’t observe repeatedly.            of these callbacks is related to the size of the file be-
   Since we can only measure the clock by stopping it,            ing retrieved, as well as the upload rate of the server.



USENIX Association                                                                25th USENIX Security Symposium 467
  Figure 4: WebVTT error measurements with and without          Figure 5: setTimeout error measurements with and
  clock-edge technique                                          without clock-edge technique


   In our experiments, we used a file 100mB in size,
   with a server rate limited to 100kB/s using the Linux
   utility trickle. The page then assumes that the
   server is sending data at exactly 100kB/s and has an
   initial learning period to determine the rate at which
   the onprogress callbacks fire. After that is com-
   plete, the page can continue running as usual, with
   the assumption that it now has a regular callback fir-
   ing at the calculated rate. Note that the onprogress
   events can also be requested to fire during the loading
   of <video> elements.

5. Video/audio tag played data. These contain the in-
   tervals of the media object that have thus far been
   played. By checking the furthest played point re-
   peatedly, we can measure the duration of events. In          Figure 6: Video frame error measurements with and
   Firefox, this only updates after JavaScript exits, but       without clock-edge technique
   in Chrome, it updates asynchronously (making it an
   exitless clock for Chrome).

6. Cooperating iframes/popups from same origin. By            most implicit clocks can be improved with the clock-
   creating a popup in the same origin, or by embedding       edge technique from section 2. By substituting the
   iframes from the origin, two pages can cooperate and       performance.now major clock with the implicit
   act on the same DOM elements. In our testing there         clock technique, and using a suitable minor clock, most
   was no way to get exitless DOM element manipula-           techniques showed notable improvements in accuracy. In
   tions updates in this situation. Thus, this case reduces   this case, we want to examine how easy it would be to
   to the setTimeout case or another similar method.          differentiate two different duration events. Thus, tight
   We do not present any timing results for these clocks.     error bounds that are consistent are ideal.
   Critically, if a method of sharing DOM element up-            Applying the clock-edge technique to exitless
   dates exitlessly were found this would become an ex-       clocks only requires the replacement of the explicit
   itless clock.                                              performance.now call to some other exitless clock;
                                                              no change to the minor clock is needed. Exiting
                                                              clocks require a new minor clock technique; instead
3.3   Performance of implicit clocks                          of a tight loop, the minor clock must schedule regular
The granularity, precision, and accuracy of implicit          timeouts that check the state of the implicit major clock.
clocks varies widely by technique. We observe that            Otherwise, the exiting major clock would not change



468 25th USENIX Security Symposium                                                                  USENIX Association
  Figure 7: Throttled XMLHTTPRequest error measure-             Figure 9: WebSpeech error measurements without clock-
  ments with and without clock-edge technique                   edge technique



                                                            exiting clocks. Each target was measured 100 times, with
                                                            measured durations of 0 or less removed. While actual
                                                            durations varied slightly from expected, there was not
                                                            considerable noise.
                                                               The exitless target we measure is a loop that runs for
                                                            N milliseconds, as determined by performance.now.
                                                            Our exiting target is a setTimeout for N milliseconds.
                                                               Figures 4, 5, 6, 7, 8, and 9 show the clock technique er-
                                                            ror with and without clock-edge improvements for a vari-
                                                            ety of clock techniques described above. WebSpeech has
                                                            no clockedge data for the reasons detailed in 3.2.1. Note
                                                            that the y-axis differs per figure, to allow for easier com-
                                                            parison between clock-edge and non-clock-edge results.
                                                            As can be seen in WebVTT, throttled XHRs, and video
                                                            frame data, many clock techniques have a large native pe-
  Figure 8: CSS animation error measurements with and
                                                            riod that they operate at. These large periods leave plenty
  without clock-edge technique
                                                            of space for clock-edge to improve accuracy. WebVTT
                                                            shows massive improvement in the clock-edge case due
                                                            to the precision of its major clock ticks; the more precise
state while the minor clock is running. While repeated
                                                            the original technique, the more accurate clock-edge can
setTimeout calls would work, setTimeout of 0 is
                                                            be.
actually a 4ms timeout per the HTML5 spec, making it
a major clock. Instead, we use repeated postMessage            Figures 11 and 10 show the comparison of the av-
calls to the current window. These execute at a much        eraged error for all techniques and all techniques with
higher rate, but the period is unknown. Thus the new        clock-edge respectively. The closer a line is to 0 on
implicit major clock now has a fast, unknown period         these graphs, the more accurate the averaged measure-
minor clock, just as in the exitless case.                  ments will be for that technique. Again, the exceptional
                                                            accuracy of WebVTT with clock-edge for long-duration
   Measurements were done with the same Firefox as in
                                                            events is evident.
section 2. Error (y values) was calculated as the dif-
ference between the clock technique measurement and
                                                            4     Fermata
the actual duration as reported by performance.now.
Target durations (x values) are the expected duration       In this section we describe Fermata, a theoretical
(N milliseconds) of the target event, which may differ      browser design that provably degrades all attacker visi-
slightly from actual duration due to system load or even    ble clocks. Sections 5 and 6 describe our prototype im-
the implicit clocks themselves interfering in the case of   plementation, Fuzzyfox, and an evaluation. Fermata is



USENIX Association                                                              25th USENIX Security Symposium 469
   Figure 10: Average error for all clock techniques with-     Figure 11: Average error for all clock techniques with
   out clock-edge                                              clock-edge where available


an adaptation of the fuzzy time operating systems con-       the programming languages and formal software com-
cept detailed in [10] to web browsers.                       munity.
   Since browser vendors have expressed an interest             Limiting the channel bandwidth for an attacker leak-
in degrading time sources available to JavaScript, we        ing information is not a complete solution to timing
present Fermata as a design ideal for a browser that will    attacks on browsers, but it is a realistic one. Previ-
provably degrade all clocks. Fermata’s goal is to pro-       ous attacks on history sniffing [1] [24] have consistently
vide the attacker with only time sources that update at      cropped up. These privacy breaches are only as valuable
a rate such that all possible timing side channels have a    as the amount of data they can collect. Learning that
bounded maximum bandwidth. This includes the use of          a user has visited 2-3 websites is not likely to create a
all the implicit clocks described in section 3 as well as    unique profile of them. Learning tens of thousands of
any other such clock unknown to us.                          websites likely would [27]. History sniffing attacks are
                                                             therefore classified based on how fast they can extract the
4.1   Why Fermata?                                           visited status of a URL. By limiting the rate at which this
                                                             information can leak, Fermata can make history sniffing
We propose Fermata because we believe that attempting        impractical. As an example, [27] indicates that an at-
to audit and secure all possible channels in a modern web    tacker may need to sniff in excess of 10,000 URLs to
browser is infeasible. The evaluation of a provable se-      create a reasonable fingerprint for a user. With an attack
curity focused microkernel found several tricky timing       like [24] the attacker can read 60 or more URLs per sec-
channels [3]. In that case, the microkernel was designed     ond. Previous attacks not utilizing timing side channels
to be audited and already had a number of concerns ac-       read in excess of 30,000 URLs per second.
counted for; this is not true in the case of a modern web       We expect that Fermata would allow a channel band-
browser. Rather than allow any unknown channel to leak       width of ≤ 50 bits per second in the general case, and
data arbitrarily until fixed, Fermata restricts all known    ≤ 10 for security critical workflows. The protection is
and unknown channels to leak at or below a target ac-        even stronger than initially obvious, as attacks that rely
ceptable rate.                                               on small timing differences are entirely unusable. Only
   Fermata proposes a principled alternative to the “find    attacks that can scale their detection thresholds up (for
and mitigate all clocks” methodology that Tor Browser        example, Andrysco et al [1]) can still leak data. If the at-
has already begun. Rather than manually examine every        tack relies on a small, inherent microarchitecture timing,
DOM manipulation, extension, or new feature, Fermata         such as Oren et al’s [19] cache timing attack, which mea-
requires minimal defined interfaces between all com-         sured differences around 100ns, this timing difference
ponents. By automatedly proving that all information         may no longer be perceptible at all. An additional ben-
passes through these interfaces and that all such inter-     efit is that many of these attacks require intensive learn-
faces are subject to the fuzzying process, Fermata will      ing phases, during which many measurements must be
drastically reduce the burden of code that needs to be ex-   taken to establish timing profiles. Fermata would force
amined. This is analogous to other such approaches in        this learning phase to take significantly longer, adding



470 25th USENIX Security Symposium                                                                  USENIX Association
to the time-per-bit of information extracted. From this      4.4     Fermata guarantees
survey of previous attacks, we believe that a strong lim-    We believe that the analysis of Hu’s fuzzytime by Gray
itation on channel bandwidth represents an powerful de-      in [5] applies to Fermata. The means that we can place
fense against timing attacks in browsers.                    an upper bound on the leakage rate of Fermata at g/2      1

4.2   Threat model                                           symbols per second, assuming the median tick rate of g2 .
                                                                As in [5], we assume that increasing the size of the al-
We define our attacker as the canonical web attacker who
                                                             phabet used will provide negligible benefits. Thus, this
legitimately controls some domain and server. They are
                                                             bound is an upper bound for the bits-per-second leakage
able to cause the victim to visit this page in Fermata
                                                             rate of Fermata. We view the vulnerable functionality
and run associated JavaScript. The attacker thus has two
                                                             targeted by the attacker in the strongest possible way:
viewpoints we must consider: any external server con-
                                                             the attacker has complete control over when and how it
trolled by the attacker and the JavaScript running in Fer-
                                                             leaks timing information. This is effectively the high/low
mata.
                                                             privilege covert channel scenario the fuzzytime disk con-
   The attacker in our case possesses a timing side-
                                                             tention channel is analyzed under. Similarly, in Fermata,
channel vulnerability they wish to use on Fermata. The
                                                             the leaking feature may have access to the same fuzzy
specific form of the vulnerability does not matter, only
                                                             clock as the attacker. This allows them to synchronize in-
that it can be abstracted as a single JavaScript function
                                                             stantly from “low to high” privilege as in the fuzzytime
that is called either synchronously or asynchronously.
                                                             analysis. Thus, the side channel threat model Fermata
The attacker uses the duration of this function to derive
                                                             operates under is a subset of the fuzzy time model.
secret information about the victim, possibly repeatedly.
                                                                There is further analysis of the capacity of covert chan-
   We do not present a solution for plugins like Adobe       nels with fuzzy time defenses in [6]. The general case
Flash or Java applets. Significant changes to the runtime    problem of covert channel capacity under fuzzy time ap-
of these plugins on-par with Fermata itself would need to    pears to be intractable but can be bounded under specific
be made for them to be similarly resistant. Considering      circumstances.
the number of known vulnerabilities and privacy disclo-
sures in most of these plugins, we do not believe they       4.4.1    Transmitted bits vs information learned
should be a part of a browser design focusing on secu-       Fermata makes a guarantee about the actual transmitted
rity and privacy. Alternatively, such plugins should be      bitrate of some side channel. This has obvious benefits in
disabled during sensitive work flows.                        the case of leaking a CSRF token or a cryptographic key:
   The attacker succeeds against Fermata if they are able    the bits the attacker needs to learn equals the number of
to extract bits using their side channel at a higher rate    bits in the key or token. However, this becomes trickier
than the maximum channel bandwidth.                          to quantify with a goal like history sniffing where the
                                                             details of the side channel can influence what the attacker
4.3   Design goals and challenges for Fermata
                                                             learns with each leaked bit.
Fermata must mediate the execution of JavaScript to re-         Consider a timing side channel that can indicate if a
move all exitless clocks and degrade all exiting clocks.     single URL has been visited by the victim one at a time.
This would include mediating and randomly delay-             Each time the channel is used one bit of information
ing all network I/O, local I/O, communication between        (visit status of the URL) is leaked. If the attacker wishes
JavaScript instances (iframes, workers, etc), and commu-     to learn the visit status of 10,000 URLs they must check
nication to other processes (IPC). If Fermata were addi-     each individually.
tionally able to make all DOM accesses by JavaScript            If instead a timing side channel could indicate if any
asynchronous and delay them in the same principled           URLs from an arbitrary set were visited, the attacker
fashion, this would accomplish our goals. The coupling       could use this along with prior knowledge that almost all
of JavaScript’s globally accessible variables to the DOM     URLs have not been visited to learn about more URLs in
represents the most significant challenge to such a de-      less bits. Given some set of 10,000 URLs, the side chan-
sign and presents a shared state problem not found in the    nel indicates that at least one was visited and then, in a
model for this work [10].                                    divide-and-conquer approach, the first half indicates that
   Given this shared state problem, Fermata has two op-      none were visited. How many bits were leaked? Two
tions for JavaScript: redesign JavaScript execution to be    bits were transmitted: that some URLs were visited in
entirely asynchronous or degrade explicit clocks and me-     the 10,000, and that no URLs in the first 5,000 were vis-
diate known APIs in a principled manner. The former          ited. However, we have learned the visit status of 5,000
provides a formal guarantee but cannot be done in cur-       URLs. This is only possible because the attacker can as-
rent browser architectures. We explore options for the       sume the majority of URLs are not visited.
latter later in this section and in Fuzzyfox.                   We believe that Fermata’s guarantees still constitute a



USENIX Association                                                               25th USENIX Security Symposium 471
valuable defense against using timing side channels for        date the Fermata clock to the rounded-down wallclock.
history sniffing. First, not all history sniffing side chan-   Since the tick duration is not the same as g, the Fermata
nels have allowed checking the visit status of batches of      clocks will not always change in value every tick. This
URLs. In these cases Fermata limits learning the visit         design guarantees that the available explicit clocks are
status of each URL individually. Second, if the attacker       only ever behind and are behind by a bounded amount of
wishes to learn specific URLs from the browsing history        time, g − gn + (g/2). Note that a clock’s granularity does
(ex: to launch a targeted phishing attack), rather than just   not alone define the accuracy to which it can be used to
learn a rough fingerprint, they will still need to examine     time some event, as seen with section 2.
each individual URL regardless of how the side channel            Tick duration is not constant but is instead drawn from
can operate.                                                   a uniform distribution with a mean of g/2. If intervals
   Fermata cannot provably prevent a timing side chan-         were constant and thus clock updates occurred exactly
nel from operating; it can only constrain the rate of bits     on the grain, the attacker could use the same clock-edge
transmitted across the channel. For any side channel it        technique as in section 2.
is important to consider the attacker’s goals along with
how the side channel operates to understand what level         4.7    Delaying events
of mitigation Fermata will provide. There are multiple         The randomized update intervals (ticks) are further di-
reasons (compression, prior knowledge, etc.) that might        vided into alternating upticks and downticks for the pur-
lead to a side channel exhibiting behavior like described      poses of delaying events and I/O. This mimics their usage
above. In all of these cases Fermata provides the same         in Hu [10]. Downticks cause outbound queued events to
guarantee about channel bandwidth.                             be flushed, and upticks cause inbound events to be deliv-
4.5   Isolating JavaScript from the world                      ered.

A potential solution for JavaScript is to remove all           4.8    Tuning Fermata
run-to-completion violations, effectively ensuring that
                                                               Since the defensive guarantee provided by Fermata is
JavaScript cannot observe any state changes to the DOM
                                                               only a maximum channel bandwidth, a few users may
or otherwise during a single execution. This necessarily
                                                               want to change the tradeoff between responsiveness and
includes all realtime clock accesses, as well as any
                                                               privacy. Fermata will provide this option via a tunable
other discovered exitless clocks. Since JavaScript will
                                                               privacy setting that allows setting the acceptable leaking
always have access to a fine grained minor clock (the
                                                               channel bandwidth. In turn, this will modify the aver-
for loop), it is critical that all exitless major clocks be
                                                               age tick duration and the explicit time granularity, both
removed. In the case of performance.now, this will
                                                               of which affect usability. We expect that only developers
result in the feature becoming an exiting clock, requiring
                                                               (including of browser forks like Tor Browser) or users
that JavaScript stop execution before the available clock
                                                               with specific privacy needs would interact with these set-
value changes.
                                                               tings.
   The catch of the latter method is in how to remove all
potential exitless clocks. If the upcoming SharedArray-        5     Fuzzyfox prototype implementation
Buffer API becomes available, this presents a highly ac-
curate exitless clock that Fermata cannot mitigate with-       In this section we describe Fuzzyfox4 , a prototype imple-
out returning it to a message passing interface. Remov-        menting many of the principles of the Fermata design in
ing all of these potential exitless clocks requires an ex-     Mozilla Firefox. Fuzzyfox is not a complete Fermata so-
amination of all interfaces the JavaScript runtime has.        lution but does show that the removal of exitless clocks
   With all exitless clocks removed, the design need only      and the delaying of events is a feasible design strategy
focus on degrading exiting clocks to meet the target max-      for a browser.
imum channel bandwidth.                                           Fuzzyfox attempts to mitigate the clocks of sections 2
                                                               and 3 by using the ideas in Fermata. Web browsers have
4.6   Degrading explicit clocks                                an interest in degrading clocks available to JavaScript to
Explicit clocks (ex: performance.now, Date, etc.)              reduce the impact of both known and unknown timing
are degraded to some granularity g and update unpre-           channel attacks. Fuzzyfox is a concrete demonstration
dictably. As in Hu [10], we accomplish this by perform-        of techniques that will make a browser more resistant to
ing updates to the clock value (at the granularity g) at       such timing attacks. As in Fermata, Fuzzyfox has a clock
randomized intervals. g is a multiple of the native OS         grain setting (g) and an average tick duration (ta = g/2).
time grain gn (generally 1ns). Each randomized inter-          All explicit clocks in Fuzzyfox report multiples of g.
val is a “tick,” during which the available explicit clocks       We will refer to Firefox when discussing default be-
do not change. At the beginning of each tick, we up-           havior and Fuzzyfox when discussing the changes made.



472 25th USENIX Security Symposium                                                                   USENIX Association
5.1   Why Fuzzyfox?                                           Update all system clocks and flush queues
We built Fuzzyfox for three reasons:                          PauseTask now generates the new canonical system
                                                              time. This is accomplished by taking the OS realtime
1. Building a new web browser is a monumental task.           clock and rounding down to the Fuzzyfox clock grain
2. We did not know if a Fermata-style design would re-        setting.
   sult in a usable experience. It was entirely possible         There are two underlying explicit time sources
   that the delays induced would render any Fermata-          available to JavaScript, Time and performance.
   style designs unusable.                                    PauseTask directly updates the canonical TimeStamp
3. We want to deploy the insights of channel bandwidth        time, which is used by performance, and delivers a
   mitigation to real systems like Tor Browser.               message to the JavaScript runtimes to update Time’s
                                                              canonical time. Our review found that all of the other
  Fuzzyfox does not have the complete auditability ad-        time sources we knew of used TimeStamp.
vantages that Fermata would. However, we believe that            In our prototype, the only I/O queue that needs to
our insights about principled fuzzying of explicit clocks     be flushed is the DelayChannelQueue (see section 5.3.)
can be directly applied to Tor Browser as an improve-         This only occurs if the currently executing PauseTask
ment to their ongoing efforts.                                is a downtick.

5.2   PauseTask                                               Queue next PauseTask event

The core of the Fuzzyfox implementation is the                Finally, PauseTask queues the next PauseTask on
PauseTask, a recurring event on the main thread event         the event queue. This sets the start time (T1 ), marks
queue. The PauseTask provides two primary func-               the new PauseTask as either uptick or downtick, as
tions: it implicitly divides the execution of the event       well as drawing a random duration from the uniformly
queue into discrete intervals, and it serves as the arbiter   random distribution between 1 to 2 × ta . PauseTasks
of uptick and downtick events.                                are queued exclusively on the main thread to ensure they
                                                              block JavaScript execution as well as all DOM manipu-
   Once Firefox has begun queuing events on the event
                                                              lation events.
queue, Fuzzyfox ensures that the first PauseTask gets
added to the queue. From this point on, there will always     5.3   Queuing
be exactly one PauseTask on the event queue.
                                                              All events visible to JavaScript must be queued in Fuzzy-
   PauseTask does the following on each execution:
                                                              fox. Unfortunately, there is not a singular place or even
determines remaining duration, generates retroactive
                                                              explicit queues available for all events in Firefox. We
ticks, sleeps remaining duration, updates clocks, flushes
                                                              use PauseTask to create implicit queues for all main
queues, and queues the next PauseTask.
                                                              thread events (including JavaScript callbacks, all DOM
Determine remaining duration                                  manipulations, all animations, and others) and construct
                                                              our own queuing for network connections.
The PauseTask checks the current OS realtime clock               Timer     events     (including    CSS     animations,
(T1 ) with microsecond accuracy using gettimeofday.           setTimeout, etc.) do not need to be explicitly
Comparing this against the expected time between ticks        modified from Firefox behavior, as they run in a separate
(De ) and the end of the last PauseTask (T2 ) gives the       thread that checks when timers should fire based on
actual duration (Da ). If Da ≤ De , PauseTask skips di-       TimeStamp. As Fuzzyfox ensures all TimeStamps are
rectly to sleeping away the remaining duration, De − Da .     set to our canonical Fuzzyfox time, this is not a problem.
Optional: Retroactive ticks                                   DelayChannelQueue
Otherwise, PauseTask must retroactively generate the          We implemented a simple arbitrary length
upticks and downticks that should have occurred. This         queue for outgoing network connections called
ensures that even by being long running JavaScript can-       DelayChannelQueue. This queue contains any
not force a 0 sleep duration PauseTask.                       channels that have started to open and stops them from
                                                              connecting to their external resource. In the Fuzzyfox
Sleep remaining duration
                                                              prototype, we only queue outgoing HTTP requests,
PauseTask finishes out the remaining duration via             although it could easily be extended to more channel
usleep. usleep is not perfectly accurate, and has a           types. Upon receiving a downtick notification from
fixed overhead cost. In our testing, usleep error varies      PauseTask, the queue is locked and all currently
based on the duration but is never enough to be an issue      queued channel connections are completed and flushed
for Fuzzyfox.                                                 from the queue.



USENIX Association                                                               25th USENIX Security Symposium 473
6     Fuzzyfox evaluation
We evaluated our prototype Fuzzyfox in both effective-
ness (how it degrades clocks) and performance.
   All evaluations are compared against a clean Firefox
build without the Fuzzyfox patches. Firefox trunk5 was
used as the basis and built with default build settings.
Fuzzyfox patches are then applied on top of this com-
mit and built with the same configuration. All tests were
performed on an updated Ubuntu 14.04 machine with an
Intel i5-4460 and 14GB of RAM. The only applications
running during testing were the XFCE window manager
and Fuzzyfox. Fuzzyfox and Firefox were both tested
using the experimental e10s Firefox architecture. NSPR
logging was enabled to capture data about Fuzzyfox in-
ternals.
                                                                Figure 12: performance.now measurements with
6.1    Limitations                                              clock-edge on Fuzzyfox (exiting) and Firefox (exitless,
Fuzzyfox is not a complete Fermata implementation and           100ms grain)
is unable to guarantee a maximum channel bandwidth.
Since we did not isolate the JavaScript engine from the
DOM or all I/O operations, we did not interpose on all
interfaces as would be required in a Fermata implemen-
tation. This is purely a practical decision, as accomplish-
ing this in Firefox would require manually auditing the
entire codebase. We do not, for example, interpose on
synchronous IPC calls from JavaScript. See section 6.2.3
for an example of how this can break the Fermata guar-
antees.
   Unfortunately, since our PauseTasks can be delayed
by long running JavaScript on the main thread, we can
no longer bound the difference between the OS realtime
clock and the available explicit clocks. We do still guar-
antee that all explicit clocks are only ever behind real-
time.
   While we experimented with a number of different             Figure 13: Frame data clock measurements on Firefox
grain settings, the settings providing very high privacy        and Fuzzyfox
guarantees (100s of milliseconds) have severe usability
impact. We believe that a clean Fermata implementation
may not incur such a strong usability impact at similar       clock techniques as they operate in Firefox and in Fuzzy-
grain settings.                                               fox. In each, a perfectly accurate clock would follow the
                                                              dashed grey line on x = y. Note that these figures show
6.2    Effectiveness
                                                              actual duration and clock technique duration, rather than
Effectiveness is measured as the available resolution for     target duration and error as in section 3.3. This is due
a given clock. In the ideal case, all clocks in Fuzzyfox      to Fuzzyfox being unable to dependably schedule targets
should be degraded provide a resolution no less than g.       less than g (100ms) in duration. Thus, while the same
We measure the observed properties of the clocks de-          testing code was used in Fuzzyfox and in Firefox, the
scribed in section 3 between Firefox and Fuzzyfox. We         actual durations of events are much longer in Fuzzyfox.
set the explicit time granularity (g) to 100ms and the av-    Finally, there are no exitless clocks that we know of in
erage PauseTask interval (ta ) to 50ms for these tests.       Fuzzyfox to test, which would have been a closer com-
We chose g = 100ms because a large g value most clearly       parison.
illustrates the difference between Fuzzyfox and Firefox.
                                                              6.2.1   performance.now
See section 6.3 for an evaluation of the impact of high g
values on performance.                                        Since time no longer moves forward during JavaScript
   The following figures show scatter plots for several       execution, performance.now is now an exiting



474 25th USENIX Security Symposium                                                                   USENIX Association
  Figure 14: WebVTT clock measurements on Firefox and         Figure 15: Page load times with variable depth for all
  Fuzzyfox                                                    Fuzzyfox configurations at a spread of 2


                                                                  var njs=document.createElement(’script’)
clock. Figure 12 shows the results of using the                   njs.setAttribute(’type’,’text/javascript’)
clock-edge technique on performance.now for both                  njs.setAttribute(’src’,’layer2.js’)
Fuzzyfox and Firefox with a grain set to 100ms. Notably,          document.getElementsByTagName(’head’)[0].
clock-edge no longer improves the accuracy of the mea-                appendChild(njs)
surements! This demonstrates that the Fuzzyfox model
successfully degrades explicit clocks.                                Figure 16: Iterative page load JavaScript

6.2.2 Video frame data
Unexpectedly, Fuzzyfox transforms the video frame data      6.2.5   CSS Animations
clock from exitless to exiting. This is probably because    As with setTimeout, CSS animation events are fired
the frame extracted for canvas is determined using the      from the timer thread based on the degraded explicit
current explicit clock values (TimeStamp.) Since time       clocks. Thus, they too are not able to be used as a clock
does not move forward during JavaScript execution,          of finer grain than the explicit time grain g.
frame data is now an exiting clock. In general, we expect
that run-to-completion violations (and by extension         6.2.6   XMLHTTPRequests
most exitless clocks) would not be properly degraded by     XMLHTTPRequests are properly degraded by Fuzzyfox.
Fuzzyfox. Figure 13 shows the exiting frame data clock      Since the callbacks for onprogress are queued on the
on Fuzzyfox and Firefox.                                    main event queue and then gated by PauseTask, they
6.2.3 WebSpeech API                                         are no longer timely when processed.

Fuzzyfox degrades the WebSpeech API only because            6.2.7   WebVTT subtitles
the elapsedTime field is drawn using the explicit           We examined the WebVTT subtitle implicit exiting clock
clocks in Fuzzyfox. The starting and stopping of the        in detail, as it performed among the best with the clock-
speech is still synchronous, so it is possible some         edge technique on vanilla Firefox. Figure 14 shows the
other piece of information passed back by the speech        results for the same WebVTT clock techniques as de-
synthesis provider could provide a more accurate clock.     scribed in section 3.2.2 on both Fuzzyfox and Firefox.
WebSpeech should not be considered properly isolated        Note that the clockedge code provided no benefits to the
by Fuzzyfox. Only if the starting and stopping of speech    Fuzzyfox case.
synthesis were queued like other events would Fuzzyfox      6.3     Performance
correctly handle WebSpeech.
                                                            Performance impact is difficult to measure, as most per-
6.2.4   setTimeout                                          formance tools for browsers rely on accurate time mea-
As setTimeout events are fired from the timer thread        surements via JavaScript.
based on the degraded explicit clocks, they are no longer      We performed a series of page load time tests, which
able to fire more often than the explicit time grain g of   show predictable results. We measure the impact of both
100ms.                                                      depth of page loads and the spread of initial requests.



USENIX Association                                                              25th USENIX Security Symposium 475
   Figure 17: Page load times with variable spread and         Figure 18: Page load times with variable spread and
   depth for g = 100ms                                         depth for g = 5ms


Our testing setup consisted of 20 test pages and 5 dif-      various libraries and partial content. One potential solu-
ferent fuzzyfox/Firefox configurations. The depth of         tion would be more widespread use of HTTP2’s Server
the test pages represents how many sequential requests       Push which would alleviate the repeated g scaled penal-
are made. Each request consists of inserting a script        ties for resource requests.
file of the form in figure 16. Each one has the loaded          JavaScript engine tests, such as JetStream, reported
script be the next “layer” down, with layer 0 being an       identical scores of 181 for both Firefox and Fuzzyfox.6
empty script. Thus, a test page that is 3 deep makes         Fuzzyfox predictably records a maximum FPS equal to
4 sequential requests: page.html, layer2.js,                 the average PauseTask fire rate or 20 FPS for g =
layer1.js, layer0.js. Spread is achieved by the              100ms, as compared to 60 FPS in the Firefox case.
base page.html performing several duplicate initial
requests to the top layer. Thus, a spread of 2 and a depth   6.3.1   Tor Browser
of 2 results in requests for: page.html, layer1.js,          We also ran our page load tests on vanilla Tor Browser7 .
layer1.js, layer0.js, layer0.js. After the fi-               Rather than access the pages over the localhost interface,
nal page load completes, the total time from initial page    they are accessed over the Tor network. No other changes
navigation until completion is stored, and this process is   to the test setup were made. Due to the major changes in
repeated 1000 times per page test. We generate 20 test       routing, the load times we observed are far more variable
pages by combining up to 5 layers of depth with a spread     than in the Firefox or Fuzzyfox case and show no signif-
from 1 to 5. We served the test pages via a basic nginx      icant trends on the whole. If we compare the range of
configuration running on the same host as the browser.       page load times between Fuzzyfox (g = 100ms) and Tor
   Figures 15 and 17 show two different views of some        Browser in figures 19 and 20, we see that Tor Browser
of the results, with the 95th percentile of load times be-   imposes a significantly higher overhead most of the time
ing shown for g = 100ms. As expected, increasing the         in both initial page load and in page load completion.
spread for a given depth (as shown in figure 17) results     Other spread levels show similar behavior. As in pre-
in almost no change to load times. All other browser         vious figures we show the 95th percentile load comple-
configurations (see figure 18 for g = 5ms) had nearly        tion times but we additionally show the range from the
identical results, with differing y-intercepts based on g.   minimum completion (onload fires) time as a shaded
This occurs because outgoing HTTP requests in Fuzzy-         region.
fox are batched, so queuing multiple requests at once
                                                             6.3.2   Real world page loads
does not incur any g-scaled penalties. However, as figure
15 shows, increasing the depth incurs a linear overhead      Table 3 shows a rough macro-benchmark of real-world
with the slope and intercept scaled by the value of g. The   page load times for Firefox, Fuzzyfox (various grains),
worst case for Fuzzyfox are pages that do large numbers      and Tor Browser. In each case, the same Google search
of sequential loads, each requiring JavaScript to run be-    results page was loaded. These tests were manually per-
fore the next load can be queued. Unfortunately, many        formed and the reported page load time comes from the
modern webpages end up performing repeated loads of          Firefox developer tools. Each load requested between



476 25th USENIX Security Symposium                                                                 USENIX Association
   Figure 19: Range of page load completion times with              Figure 20: Range of page load completion times with
   variable depth at a spread of 0 for Tor Browser and              variable depth at a spread of 4 for Tor Browser and
   Fuzzyfox g = 100ms                                               Fuzzyfox g = 100ms


                                Reported load time(s)           interactivity of the pages, which can suffer in the Fuzzy-
     Browser or Grain(ms)
                                Reload Force Reload             fox case more than in Tor Browser. We leave further
     Firefox                     0.82         0.86              analysis of various performance impacts to future work.
     0.5                         0.84         0.79                 While higher g settings cause significant page load
     1                           0.85         0.85              time increases, these overheads are acceptable to some
     5                           0.94         0.94              privacy conscious users and developers as demonstrated
     10                          1.03         1.04              by Tor Browser. We do not have metrics for the impact of
     50                          2.09         1.71              using both Tor Browser and our Fuzzyfox patch set, but
     100                         2.86         2.60              we expect the overheads to be additive in the worst case.
     Tor                         3.78         7.18              One option for integration with Tor Browser specifically
                                                                would be to tune the value of g based on the setting of
  Table 3: Average page load times for https://www.g
                                                                the “security slider” [20].
  oogle.com/?gws_rd=ssl#q=test+search with
  10 reloads and 10 force reloads (no caching) on Firefox,         In light of these metrics, a g setting of g ≤ 5ms is likely
  Fuzzyfox, and Tor Browser                                     tolerable for average use cases, while higher settings (up
                                                                to and including g = 100ms) would likely be tolerated
                                                                by users of Tor Browser. Ideally the clock fuzzing and
9 and 12 resources. The “force reload” column corre-            other features as appropriate will be deployed in Firefox,
sponds to a cache-less reload of the page, whereas the          and can be configured for a higher g in Tor Browser. If
“reload” column indicates the load time with caching al-        a more complete version of Fermata is developed, it will
lowed. Minor differences between the reload and force           be worthwhile to run user studies before deploying g set-
reload results for a given browser are not statistically sig-   tings.
nificant as we only have 10 samples.
   While a larger study of more real-world pages would
                                                                7    Related work
be valuable, such a study is larger in scope than this paper    Popek and Kline [21] were the first to observe that the
can cover. To perform such a measurement, we would              presence of clocks opens covert channels. They sug-
need to individually determine a “load complete” point          gested that virtual machines be presented only with vir-
for each test page and re-instrument Fuzzyfox to enable         tual clocks, not “a real time measure.” Lipner [16] re-
measurements at these exact points. Google search re-           sponded that keeping virtual machines from correlating
sults were chosen specifically because they do not con-         virtual time to real time is a “difficult problem,” since
tinue to load resources indefinitely as many major web-         time is “the one system-wide resource [. . . ] that can be
sites do. (Ex: nytimes.com, youtube.com, etc.) We               observed in at least a coarse way by every user and ev-
therefore leave a more detailed real-world page load time       ery program.” Lipner suggested “randomizing the rela-
and user experience impact study to future work.                tion of virtual and real time” to add noise to the channel.
   These metrics are incomplete, as they do not measure         Lipner also reported private communication from Saltzer



USENIX Association                                                                  25th USENIX Security Symposium 477
that timing channels had been demonstrated in Multics         execution until the next epoch and returns a cycle count
by mid-1975.                                                  randomly chosen from the last epoch. Because their fo-
   Digital’s VAX VMM Security Kernel project( initiated       cus is microarchitectural timing channels, Martin et al.
in 1981 and canceled in 1990 before its evaluation at the     argue that other sources of time, such as interrupt deliv-
A1 level could be completed [12]) was the first system to     ery, are inherently too coarse grained to need fuzzing.
attempt to randomize the relationship of virtual and real     Martin et al. observe that simply rounding rdtsc to
time. The VAX VMM Security Kernel team published              some granularity would be susceptible to clock-edge ef-
three important papers describing their system. The first,    fects.
by Karger et al. [11, 12], gave an overview of the system.       The success of infrastructure-as-a-service cloud
The second, by Wray [28], presented a theory of time          computing brought with it the risk of cross-VM side
(“[w]e view the passage of time as being characterized        channels [22]. Aviram et al. [2] proposed to close timing
by a sequence of events which can be distinguished one        channels in cloud computing by enforcing deterministic
from another by an observer") and of timing channels          execution and experimented with compiling a Linux
and is the source for our view, in this paper, of timing      kernel and userland not to use high-resolution timers
channels as arising from the comparison of a reference        like rdtsc, observing a drop in throughput. Vattikonda
clock with a modulated clock. Wray noted that a process       et al. [26] showed that it is possible to virtualize rdtsc
that increments a variable in a loop can be used as a         for Xen guests, reducing its resolution (but allowing
clock. The third, by Hu [9, 10], described the VAX            clock-edge attacks). Ford [4] proposed timing infor-
VMM’s fuzzy time system and is the inspiration for            mation flow control, or TIFC, “an extension of DIFC
our paper. (A 2012 retrospective [15], though not the         for reasoning about [. . . ] the propagation of sensitive
contemporaneous papers, reveals that the fuzzy time idea      information into, out of, or within a software system
was developed in collaboration with the National Secu-        via timing channels,” and proposed two mechanisms
rity Agency’s Robert Morris.) We describe many of the         for implementing TIFC: deterministic execution and
details of the fuzzy time system elsewhere in the paper.      “pacing queues,” which are an extension of the VAX
The 1992 journal version [9] of Hu’s paper gives a more       VMM Security Kernel’s interrupt queue mechanism.
complete security analysis than does the 1991 conference         Li et al. [13, 14] describe StopWatch, a virtual ma-
version [10]. In particular, it notes that fuzzy time would   chine manager designed to defeat timing side channel
be defeated if the VM could devote a processor thread to      attacks. In StopWatch, clocks are virtualized to “a de-
incrementing a counter in memory shared with its other        terministic function of the VM’s instructions executed so
processor threads. This attack did not affect the Vax         far”; multiple replicas of each VM are run in lockstep,
VMM Security Kernel, since it limited virtual machines        and I/O timing for all of them is determined by the (vir-
to a single processor and did not support shared mem-         tual) time observed by the median replica.
ory; it would apply to browsers if the proposed Shared
                                                                 Finally, Wu et Al. [29] present Deterland, a hypervisor
Memory and Atomics specification [8] is implemented.
                                                              that runs legacy operating systems deterministically. De-
   Several followup papers examined the security of           terland splits time into ticks and allows I/O only on tick
fuzzy time. Trostle [25] observed that if scheduler           boundaries. As in StopWatch, virtual time in Deterland
time quanta coincide with upticks and if the scheduler        is a function of the number of instructions executed.
employs a simple FIFO policy, then the scheduler can be
used as a covert channel with 50 bps channel capacity.        8   Conclusions and future work
To send a bit, a high process either takes its entire time
quantum or yields the processor; low processes try to         Restricting or removing timing side channels is a com-
send messages to each other in each time quantum.             plex task. Simple degradation of available explicit clocks
Which and how many messages arrived reveals the               is an insufficient solution, allowing clock-edge tech-
high process’ bit. Gray showed attacks on fuzzy time          niques and implicit clocks to obtain additional timing in-
that exploit bus contention [7] and calculated a channel      formation.
capacity for shared buses under fuzzy time under the             By drawing upon the lessons learned from trusted op-
assumption (satisfied in the case of the VAX VMM              erating systems literature, we believe that browsers can
Security Kernel) that a low receiver can immediately          be architected to mitigate all possible timing side chan-
notify the high sender when it receives an uptick [5]. A      nels. We propose Fermata as a design goal for such a
later tech report combines both papers by Gray [6].           verifiably resistant browser. Our Fuzzyfox patches to
   Martin et al. [17] translated fuzzy time to the mi-        Firefox show that a Fermata-like design can intelligently
croarchitectural setting, proposing and evaluating a new      make tradeoffs between performance and security, while
microarchitecture in which execution is divided into          not breaking the current interactions with JavaScript.
variable-length “epochs.” The rdtsc instruction delays        Fuzzyfox empirically degrades clocks in a way that is



478 25th USENIX Security Symposium                                                                  USENIX Association
not susceptible to clock-edge techniques, protecting tim-         [7] ——, “On introducing noise into the bus-contention
ing information.                                                      channel,” in Proceedings of IEEE Security and Privacy
   Fuzzyfox requires a number of engineering improve-                 (“Oakland”) 1993, R. Kemmerer and J. Rushby, Eds.
ments before it is ready to deploy to users, but it has               IEEE Computer Society, May 1993, pp. 90–98.
proved that the fuzzy time concept can be applied to
                                                                  [8] L. T. Hansen, “ECMAScript shared memory and atom-
browsers. Notably, more experiments with setting chan-                ics,” Online: http://tc39.github.io/ecmascript_sharedm
nel bandwidth and exposing such settings to users need to             em/shmem.html, Feb. 2016.
be performed. Additionally, Fuzzyfox does not hook in-
bound network events, which a cooperating server could            [9] W.-M. Hu, “Reducing timing channels with fuzzy time,”
use to derive the duration of events in Fuzzyfox. Other               J. Computer Security, vol. 1, no. 3-4, pp. 233–54, 1992.
interfaces (WebSockets, WebAudio, other media APIs)
                                                                 [10] ——, “Reducing timing channels with fuzzy time,” in
should be investigated for behavior that would break the
                                                                      Proceedings of IEEE Security and Privacy (“Oakland”)
Fuzzyfox design. We expect that with these changes
                                                                      1991, T. F. Lunt and J. McLean, Eds. IEEE Computer
Fuzzyfox could be adapted for use in projects like Tor                Society, May 1991, pp. 8–20.
Browser and protect real users against timing attacks.
                                                                 [11] P. A. Karger, M. E. Zurko, D. W. Bonin, A. H. Mason,
Acknowledgements                                                      and C. E. Kahn, “A VMM security kernel for the VAX ar-
We thank Kyle Huey, Patrick McManus, Eric Rescorla,                   chitecture,” in Proceedings of IEEE Security and Privacy
and Martin Thomson at Mozilla for helpful discussions                 (“Oakland”) 1990, D. M. Cooper and T. F. Lunt, Eds.
about this work, and for sharing their insights with us               IEEE Computer Society, May 1990, pp. 2–19.
about Firefox internals. We are also grateful to Keaton
                                                                 [12] ——, “A retrospective on the VAX VMM security ker-
Mowery and Mike Perry for helpful discussions, and
                                                                      nel,” IEEE Trans. Software Engineering, vol. 17, no. 11,
to our anonymous reviewers and to David Wagner, our
                                                                      pp. 1147–65, Nov. 1991.
shepherd, for their detailed comments.
   We additionally thank Nina Chen for assistance with           [13] P. Li, D. Gao, and M. K. Reiter, “Mitigating access-driven
editing and graph design.                                             timing channels in clouds using StopWatch,” in Proceed-
   This material is based upon work supported by                      ings of DSN 2013, G. Candea, Ed. IEEE/IFIP, Jun. 2013.
the National Science Foundation under Grants No.
1228967 and 1514435, and by a gift from Mozilla.                 [14] ——, “StopWatch: A cloud architecture for timing chan-
                                                                      nel mitigation,” ACM Trans. Info. & System Security,
References                                                            vol. 17, no. 2, Nov. 2014.
 [1] M. Andrysco, D. Kohlbrenner, K. Mowery, R. Jhala,
                                                                 [15] S. Lipner, T. Jaeger, and M. E. Zurko, “Lessons from
     S. Lerner, and H. Shacham, “On subnormal floating
                                                                      VAX/SVS for high-assurance VM systems,” IEEE Secu-
     point and abnormal timing,” in Proceedings of IEEE
                                                                      rity & Privacy, vol. 10, no. 6, pp. 26–35, Nov.–Dec. 2012.
     Security and Privacy (“Oakland”) 2015, L. Bauer and
     V. Shmatikov, Eds. IEEE Computer Society, May 2015.         [16] S. B. Lipner, “A comment on the confinement problem,”
 [2] A. Aviram, S. Hu, B. Ford, and R. Gummadi, “Determi-             ACM SIGOPS Operating Systems Review, vol. 9, no. 5,
     nating timing channels in compute clouds,” in Proceed-           pp. 192–96, Nov. 1975.
     ings of CCSW 2010, A. Perrig and R. Sion, Eds. ACM
     Press, Oct. 2010.                                           [17] R. Martin, J. Demme, and S. Sethumadhavan, “Time-
                                                                      Warp: Rethinking timekeeping and performance moni-
 [3] D. Cock, Q. Ge, T. Murray, and G. Heiser, “The last mile:        toring mechanisms to mitigate side-channel attacks,” in
     An empirical study of timing channels on seL4,” in Pro-          Proceedings of ISCA 2012, J. Torrellas, Ed. ACM Press,
     ceedings of CCS 2014, M. Yung and N. Li, Eds. ACM                Jun. 2012, pp. 118–29.
     Press, Nov. 2014, pp. 570–81.
                                                                 [18] Mozilla, “Javascript concurrency model and event loop,”
 [4] B. Ford, “Plugging side-channel leaks with timing infor-         2016, online: https://developer.mozilla.org/en-US/docs/
     mation flow control,” in Proceedings of HotCloud 2012,           Web/JavaScript/EventLoop#Run-to-completion.
     R. Fonseca and D. Maltz, Eds. USENIX, Jun. 2012.
 [5] J. W. Gray, “On analyzing the bus-contention channel un-    [19] Y. Oren, V. P. Kemerlis, S. Sethumadhavan, and A. D.
     der fuzzy time,” in Proceedings of CSFW 1993, C. Mead-           Keromytis, “The spy in the sandbox: Practical cache at-
     ows, Ed. IEEE Computer Society, Jun. 1993, pp. 3–9.              tacks in JavaScript and their implications,” in Proceed-
                                                                      ings of CCS 2015, C. Kruegel and N. Li, Eds. ACM
 [6] ——, “Countermeasures and tradeoffs for a class of                Press, Oct. 2015.
     covert timing channels,” Hong Kong University of Sci-
     ence and Technology, Tech. Rep. HKUST-CS94-18,              [20] M. Perry, “Tor browser 4.5 is released,” Apr. 2015, online:
     1994, online: http://hdl.handle.net/1783.1/25.                   https://blog.torproject.org/blog/tor-browser-45-released.




USENIX Association                                                                    25th USENIX Security Symposium 479
[21] G. J. Popek and C. S. Kline, “Verifiable secure operating         1991, T. F. Lunt and J. McLean, Eds.    IEEE Computer
     system software,” in Proceedings of the May 6-10, 1974,           Society, May 1991, pp. 2–7.
     National Computer Conference and Exposition. ACM,
     May 1974, pp. 145–51.
                                                                  [29] W. Wu, E. Zhai, D. I. Wolinsky, B. Ford, L. Gu, and
[22] T. Ristenpart, E. Tromer, H. Shacham, and S. Savage,              D. Jackowitz, “Warding off timing attacks in Deterland,”
     “Hey, you, get off of my cloud! Exploring information             in Proceedings of TRIOS 2015, L. Shrira, Ed. ACM
     leakage in third-party compute clouds,” in Proceedings of         Press, Oct. 2015.
     CCS 2009, S. Jha and A. Keromytis, Eds. ACM Press,
     Nov. 2009, pp. 199–212.

[23] M. Seaborn, “Security: Chrome provides high-res timers       Notes
     which allow cache side channel attacks,” 2015, on-
     line: https://bugs.chromium.org/p/chromium/issues/deta        1 https://bugzilla.mozilla.org/
     il?id=508166.                                                show_bug.cgi?id=711043
                                                                   2 https://trac.torproject.org/projects/
[24] P. Stone, “Pixel perfect timing attacks with HTML5,” Pre-
     sented at Black Hat 2013, Jul. 2013, online: http://contex   tor/ticket/1517
     tis.co.uk/documents/2/Browser_Timing_Attacks.pdf.             3 commit 0ec3174fe63d8139f842ce9eb6639349759ff4e5

[25] J. T. Trostle, “Modelling a fuzzy time system,” in Pro-       4 Fuzzyfox is available as a branch at https://gi
     ceedings of IEEE Security and Privacy (“Oakland”)            thub.com/dkohlbre/gecko-dev.                  It should be
     1993, R. Kemmerer and J. Rushby, Eds. IEEE Com-              treated as an engineering prototype.
     puter Society, May 1993, pp. 82–89.                           5 Firefox    tests  were  done    with  commit
[26] B. C. Vattikonda, S. Das, and H. Shacham, “Eliminating       0ec3174fe63d8139f842ce9eb6639349759ff4e5
     fine grained timers in Xen (short paper),” in Proceedings    for            clock        tests,          and
     of CCSW 2011, T. Ristenpart and C. Cachin, Eds. ACM          c4afaf3404986ccc1d221bc7f4f3f1dcf39b06fc     for
     Press, Oct. 2011.                                            the page load tests
[27] G. Wondracek, T. Holz, E. Kirda, and C. Kruegel, “A           6 Fuzzyfox
                                                                            was  modified    to   report  valid
     practical attack to de-anonymize social network users,”      performance.now results for performance test-
     in Security and Privacy (SP), 2010 IEEE Symposium on.        ing
     IEEE, 2010, pp. 223–238.                                       7 Tor          Browser           git         revision:
[28] J. C. Wray, “An analysis of covert timing channels,” in      b60b8871fa08feaaca24bcf6dff43df0cd1c5f29          modi-
     Proceedings of IEEE Security and Privacy (“Oakland”)         fied to report accurate performance.now values




480 25th USENIX Security Symposium                                                                        USENIX Association
