Doctoral thesis (Dissertations and theses)
From Smart to Secure Contracts: Automated Security Assessment and Improvement of Ethereum Smart Contracts
Ferreira Torres, Christof
2022
 

Files


Full Text
Christof_FERREIRA_TORRES_PhD_Thesis.pdf
Author postprint (9.07 MB)
Download

All documents in ORBilu are protected by a user license.

Send to



Details



Keywords :
Smart Contracts; Ethereum; Vulnerability Detection; Static Analysis; Dynamic Analysis; Symbolic Execution; Fuzzing; Patching; Blockchain
Abstract :
[en] Modern blockchains, such as Ethereum, gained tremendously in popularity over the past few years. What partially enables this large increase are so-called smart contracts. These are programs that are deployed and executed across the blockchain. However, just like traditional programs, smart contracts are subject to programming mistakes. Although, unlike traditional programs their code is publicly available and immutable. Hence, as smart contracts become more popular and carry more value, they become a more interesting target for attackers. In the past few years, several smart contracts have been exploited, resulting in assets worth millions of dollars being stolen. In this dissertation, we explore the security of smart contracts from three different perspectives: vulnerabilities, attacks, and defenses, and demonstrate that, as so often, "smart" does not imply "secure". In the first part of the dissertation, we study the automated detection of vulnerabilities in smart contracts, without requiring prior access to source code. We start by building a symbolic execution framework for detecting integer bugs that leverages taint analysis to reduce false positives. However, as symbolic execution is notorious to produce false positives, we explore hybrid fuzzing as an alternative. As a result, we propose a hybrid fuzzer for smart contracts that combines symbolic execution with fuzz testing and leverages data dependencies across state variables to efficiently generate transaction sequences. Our approach is capable of detecting more vulnerabilities with less false positives. In the second part of the dissertation, we explore various ways to mount attacks against smart contracts. We start by proposing a framework to detect and quantify classical smart contract attacks (e.g., reentrancy, integer overflows, etc.) on past transactions by combining logic-driven and graph-driven analysis. Afterwards, we study the effectiveness of a new type of fraud known as honeypots, by scanning the entire blockchain for different types of honeypots using symbolic execution. Next, we present a methodology to measure the prevalence of so-called frontrunning attacks, which follow from the rise of decentralized finance and the sharp increase of users trading on decentralized exchanges. Our results show that attackers are making a fortune by manipulating the order of transactions. In the third and final part of the dissertation, we discuss several defense mechanisms for smart contracts. We first propose a solution that developers can use to automatically patch vulnerable smart contract bytecode using context-sensitive patches that dynamically adapt to the bytecode that is being patched. However, this does not solve the issue of already deployed smart contracts. To that end, we present a second solution that enables security experts to write attack patterns that are triggered whenever malicious control and data flows are detected. Once a transaction is detected to be malicious, all state changes are rolled back and the attack is thereby prevented. These attack patterns are written using a domain-specific language and are managed via a smart contract. The latter enables decentralization, guarantees the distribution of security updates, and warrants transparency.
Disciplines :
Computer science
Author, co-author :
Ferreira Torres, Christof ;  University of Luxembourg > Faculty of Science, Technology and Medecine (FSTM)
Language :
English
Title :
From Smart to Secure Contracts: Automated Security Assessment and Improvement of Ethereum Smart Contracts
Defense date :
2022
Institution :
Unilu - University of Luxembourg, Luxembourg
Degree :
Docteur en Informatique
Promotor :
State, Radu  
Eckert, Claudia
FnR Project :
FNR13192291 - Secure Blockchain Technologies For Finance, 2018 (01/10/2018-31/03/2022) - Christof Ferreira Torres
Available on ORBilu :
since 30 May 2022

Statistics


Number of views
557 (36 by Unilu)
Number of downloads
802 (20 by Unilu)

Bibliography


Similar publications



Contact ORBilu