You are on page 1of 13

This article has been accepted for publication in a future issue of this journal, but has not been

fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Date of publication xxxx 00, 0000, date of current version xxxx 00, 0000.
Digital Object Identifier 10.1109/ACCESS.2017.DOI

Smart Contract: Attacks and Protections


SARWAR SAYEED1 , HECTOR MARCO-GISBERT1 , TOM CAIRA1
1
School of Computing, Engineering and Physical Sciences, University of the West of Scotland, High Street, Paisley PA1 2BE, UK
Corresponding author: H. Marco(hector.marco@uws.ac.uk).

ABSTRACT
Smart contracts are programs that reside within decentralized blockchains and are executed pursuant to
triggered instructions. A smart contract acts in a similar way to a traditional agreement but negates the
necessity for the involvement of a third party. Smart contracts are capable of initiating their commands
automatically, thus eliminating the involvement of a regulatory body. As a consequence of blockchain’s
immutable feature, smart contracts are developed in a manner that is distinct from traditional software.
Once deployed to the blockchain, a smart contract cannot be modified or updated for security patches,
thus encouraging developers to implement strong security strategies before deployment in order to avoid
potential exploitation at a later time. However, the most recent dreadful attacks and the multifarious
existing vulnerabilities which result as a consequence of the absence of security patches have challenged
the sustainability of this technology. Attacks such as the Decentralized Autonomous Organization (DAO)
attack and the Parity Wallet hack have cost millions of dollars simply as a consequence of naïve bugs in the
smart contract code. In this paper, we classify blockchain exploitation techniques into 4 categories based
on the attack rationale; attacking consensus protocols, bugs in the smart contract, malware running in the
operating system, and fraudulent users. We then focus on smart contract vulnerabilities, analyzing the 7 most
important attack techniques to determine the real impact on smart contract technology. We reveal that even
adopting the 10 most widely used tools to detect smart contract vulnerabilities, these still contain known
vulnerabilities, providing a dangerously false sense of security. We conclude the paper with a discussion
about recommendations and future research lines to progress towards a secure smart contract solution.

INDEX TERMS Smart Contracts, Attack Techniques, DApp, Ethereum, Vulnerability.

I. INTRODUCTION unlike Bitcoin, can be utilized for various purposes [2] [3].
A blockchain is a distributed network that is leveraged for Bitcoin blockchain enhances a peer to peer digital cash
various purposes [1]. It is an immutable ledger technology system which allows the participant to perform online trans-
where the recorded information is open and can be viewed by actions [4], whereas, besides digital transactions, Ethereum is
everyone. It does not involve any central authority to monitor also utilized to execute smart contract code in decentralized
the regular flow of the network, making it less prone to applications which are deployed on the network.
attacks. Miners’ consent is required to verify the authenticity A smart contract functions in a similar way a normal con-
of any acts performed in the blockchain platform. Since its tract works among two or more parties. Parties do not need
inception, blockchain has primarily been utilized for crypto to rely on lawyers or banks to set up an agreement for them,
transactions. However, blockchain is not all about cryptocur- rather, the smart contract gets executed automatically to issue
rencies, rather, it extends far beyond this. Over time, the payment once certain conditions are met. For instance, a lease
remarkable advancement of blockchain has made it possible agreement, insurance contract, or real estate payments can be
to apply it to various other activities. The smart contract in the form of a smart contract.
is one of these applications which allows agreement to be A smart contract is basically a piece of code that resides
formed and authentic transactions initiated between parties inside the blockchain, ensuring the stated conditions are met
without the involvement of middlemen. This improves upon to fulfill the user’s requirement [5]. The written code is pub-
the traditional approach where users ended up expending an licly visible in the blockchain, and transparent to anyone who
unreasonable amount of time and effort. is connected to the network. Upon fulfilling the conditions
Ethereum is a blockchain platform which provides tools by the desired time, the contract gets triggered to execute
for developers to build decentralized applications which, the digital transaction. Since the conditions are encrypted

VOLUME 4, 2016 1

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

cryptographically, no party is able to alter the contents of a A. BLOCKCHAIN AND DIGITAL TRUST
contract. The immutable nature of blockchain also ensures The blockchain is one of the creative innovations of the era,
that every single device connected to the network contains a which is able to distribute digital information securely. It
copy of the contract, thus securing a backup version of the combines three main technologies which ensures its proper
contact. function; private key cryptography, peer-to-peer networking,
Being open-source, the contract code enables the involved and the consensus protocol [13]. An intricate cryptography
parties to determine what the contract does and how it is approach is implemented to secure transactions and a hashing
initiated [6]. It also guarantees the execution of the contract method is used to provide a fixed-length output [14]. For
without being affected when certain parts of the network are instance, a transaction sent by Alice will be shown as
down or being attacked by adversaries. Once the contract is "0x1dc676eba2eed839c98fab067gt67e0.......",
placed within the blockchain, it is nearly impossible to have
it removed or deleted unless the whole blockchain network Hence, securing the user’s identity while only the public
is exploited by some significant attack techniques. However, address and the transfer amount is visible to others. Using the
such attacking efforts may involve a huge amount of capital, public key it is possible to determine any transactions made
requiring an adversary to re-generate every block that is by a participant. Similarly, the immutability of blockchain
chained after the affected block. makes it a tamper-free system. Once any content is recorded
Despite all the security enhancements and security in the blockchain, it can not be omitted from the ledger.
tools [7], [8], blockchain still faces challenges to cope with Moreover, the block validation process involves network
various pernicious attacks [9]. A range of attacks are con- miners to determine whether a particular block is valid.
stantly initiated to obstruct the natural flow or even fully Anyone can join the network as a miner to participate in the
destroy the network [10]. Attacks relating to cryptocurrency validation process [15]. The block generation method differs
wallets, smart contracts, transaction authentication, mining in different platforms, although Ethereum’s mining process
pools, and blockchain networks are frequently exploited by is very similar to Bitcoin [16]. Ethereum, along with many
adversaries. DAO attacks, King of the Ether Throne, and other digital currencies, follows the Proof of Work (PoW)
Multi-player Games are some smart contract based attacks consensus protocol. The PoW protocol utilizes the ’ethash’
which occur due to the bugs in smart contract code [11]. algorithm for the mining task. The validation process makes
This paper focuses on examining smart contract based use of powerful computers to solve a puzzle. A miner with a
attacks as well as the consequences of their exploitation. We valid hash is awarded ether, and the generated block is then
do not aim to determine how much effort it takes to execute added to that particular blockchain. The block generation
particular attacks. Rather, we focus on various attack types time of Ethereum is roughly 12-15 seconds.
and available security tools to restrict those attacks, as well
as limitations that exist to those security enhancements. B. SMART CONTRACT FRAMEWORKS
Ethereum is one of the major platforms which is used for
II. BACKGROUND the development of a smart contract. Smart contract de-
This section involves reviewing relevant context associated velopers are permitted to develop any decentralized appli-
with Ethereum smart contracts and attacks launched on them. cation (DApp) they wish on the Ethereum platform. The
The investigation of the literature helps to grasp the concepts decentralized applications trigger exactly as per the code
of blockchain technology and smart contract frameworks, conditions without having any risk of censorship, deception,
and provides an overview of Ethereum, decentralized appli- or downtime. However, besides all the advantages, no one
cations, and past smart contract-based attacks. can claim it to be a fully secure platform. For instance,
Figure 1 shows a comparison between client-server archi- unexpected bugs in the smart contact code may lead the
tecture and decentralized DApp architecture. TBC.com, an contract to trigger unintended tasks it is not set to perform.
application, contains front-end and back-end parts [12]. The Hence, parties involved with the contract may experience
front-end is developed using HTML and can be viewed by huge loss as a consequence of the unresolved agreement.
any clients, whereas the back-end is developed using Node.js. Besides Ethereum, there are other smart contract platforms
Both ends communicate with each other via JSON using that are utilized for the development of DApps.
HTTP protocol. All the confidential data is saved to a central Hawk is another framework for developing privacy-
server. In the case of a smart contract-based decentralized preserving smart contracts [17]. Hawk does not require cryp-
application (DApp), the back-end is the smart contract and tography implementation, so it provides opportunity for non-
the confidential data is saved at Block 45 of the blockchain. programmers to write a Hawk program. A Hawk compiler is
Every node that is connected to the blockchain has a version in place to compile Hawk programs. One-chain privacy and
of the smart contract code, which is immutable. Exploiting a contractual security are two security approaches guaranteed
single or a few nodes will not significantly affect the actions by Hawk to enhance protection. Hawk is the first smart
of TBC.com, conveying the security aspects of blockchain contract system which establishes a recognized, academic
over a centralized system. provision of the blockchain model of cryptography. It com-
prises a Universal Composability (UC) model, which consists
2 VOLUME 4, 2016

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

FIGURE 1: A comparison between Client-server architecture and Decentralized DApp architecture.

of independent interest. The UC model is a formal model different volumes of gas in order to execute a required task.
that can be leveraged, simulating security protocols in the The gas requirement of a smart contract can be determined
blockchain. by applying the following rule
Hawk utilizes zkSNARKs to verify smart contracts. How- Ether = Tx Fees = Gas Limit * Gas Price
ever, SNARKs involves pre-circuit trusted setup, requiring a
new setup in place for any program which is implemented Besides gas, the Ethereum Virtual Machine (EVM) is
by a contract [18]. A multi-party calculation can be adopted another significant aspect of the Ethereum blockchain. The
to diminish reliability on the setup, but this is inappropriate EVM generates a degree of abstraction between the executing
to utilize on the per-circuit basis that is desired by Hawk. code and the machine that executes it [24]. The layer ensures
Moreover, HAWK suffers from scalability challenges and, that the DApps are detached from each other as well as from
in addition, the privacy aspect is entirely handled by a hosts. Solidity code needs to be compiled to opcode in order
third-party manager, making all confidential data insecure. for the EVM to execute it. The EVM utilizes the opcodes to
Hawk, and other frameworks which are focused on achieving carry out various tasks. There are about 140 distinct opcodes
privacy-preserving contracts, suffer from serious flaws [19]. that enhance the EVM to be Turing-complete, allowing it to
They cannot be affiliated with digital currencies. As such, evaluate anything. The opcodes are encoded to bytecode to
all these frameworks may incur high costs for transaction determine proper security. The EVM dominates the inner part
processing. of the Ethereum blockchain and also consists of a detail list
EOS and Tron are also smart contract based platforms of the status to initiate a transaction [23].
which incorporate scalability [20].
D. DECENTRALIZED APPLICATION
C. ETHEREUM SYNOPSIS A decentralized application is also referred to as a DApp [6].
The Ethereum blockchain has its own cryptocurrency which DApps are open-source applications based on the Ethereum
is ether. Ether is the token which powers the Ethereum blockchain where a consensus is maintained between the user
blockchain [21]. Ether operates in a slightly different way and programmer during the development process. The source
from Bitcoin, and is also utilized in smart contracts. A smart code is available for examination and the application is stored
contract is computer code which incorproates an automated in the blockchain to ensure trust and transparency. Miners
legal agreement [22]. Vyper, Bamboo, Serpent, and Mutan are responsible for securing the application and are rewarded
are a few programming languages that have been used to with tokens for the validation of the DApp. Bitcoin can be
write smart contract code. However, currently, Solidity is considered as a DApp on the Bitcoin blockchain platform.
the prime language adopted for writing smart contracts. The Nevertheless, the Ethereum blockchain is recognized as a
implementation of smart contracts within the blockchain bigger platform for decentralized applications.
makes it immutable, therefore, a deployed contract can never Likewise, a Decentralized Autonomous Organization
be voided or erased. (DAO) aims to categorize the policies of an organization by
Gas is a term that is used as a fee in the Ethereum plat- limiting the requirement for centralized activities with the use
form [23]. Gas is often estimated by the computational per- of a decentralized approach [25]. It may involve a few par-
formance of a smart contract. Distinct smart contracts require ticipants contributing to the writing of smart contract code.
VOLUME 4, 2016 3

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

FIGURE 2: Total cycle of smart contract execution over Ethereum blockchain.

Having an initial funding period, participants are allowed attacker to request funds from the smart contract numerous
to include funds to purchase tokens, and the DAO begins times before the balance was updated. The vulnerability
its execution after the funding period. Participants have the occurred due to bugs in the code where the developers did not
option to propose approaches to utilize the funds, and a few consider the potential for a recursive call. Hence, it enabled
participants can also vote to determine the approval of the attackers to steal ether worth millions of dollars within the
proposals. first few hours. The DAO attack scenario demonstrates how
Figure 2 shows the sequence of smart contract execution destructive a simple smart contract vulnerability can be.
over Ethereum blockchain. Two parties reach an agreement, Similarly, the Parity Wallet hack is another vulnerability
which is then written by a developer using Solidity code. The which was discovered on the Parity Multisig Wallet with
code is then compiled to bytecode for the EVM to process. version 1.5+ [27], [28]. The flaw permitted an attacker to
Miners’ involvement is required for processing the contract remove over 150,000 ETH ( 30M USD). In order to execute
to the blockchain. Once included, the contract gets processed the attack, the adversary transmitted two transactions aiming
on the event scheduled date, triggered by the written code. to acquire ownership of Multisig so that all the currency
The execution of the contract releases the payment to the could be drained. Once the attack was accomplished, the
appropriate party, which can later be verified by anyone. Parity Multisig Wallet Library contract was initiated. How-
ever, it contained a bug which authorized anyone to run
E. SMART CONTRACT-BASED ATTACKS initWallet [29]. The attack was executed twice; hence, it is
There have been a lot of attacks on smart contracts, costing referred to as Parity Wallet hack 1 and 2. In the first attack,
a large amount of money. However, the DAO attack and the the attacker was able to modify the status of the wallet by
Parity Wallet hacks are the most often discussed. initiating a call to initWallet. As a result, the attacker
was believed to be the owner and drained funds without any
In May 2016, a few participants from the Ethereum society
hindrance.
inaugurated the DAO [26]. The inception was known as
genesis DAO. The DAO was an open-source smart contract
that allowed anyone to exchange DAO tokens with ether. III. ATTACK CLASSIFICATION
That method of exchange helped to gather around $150M, In this section, we classify blockchain-based exploitations
providing DAO with a large crowdfund. Participants with into 4 categories. Our study indicates that most blockchain
DAO tokens were permitted to cast their vote on propositions attacks fall under the listed categories. Potential adversaries
and receive rewards as long as it resulted in profit. However, utilize specific categories to initiate an attack in accordance
the DAO contract contained severe flaws, allowing attackers with their attacking capability. Although this section fo-
to remove funds. A loophole existed which permitted an cuses on classifying the exploitation techniques, the rest
4 VOLUME 4, 2016

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

of the paper concentrates on a single category which is C. DEFRAUD


application bugs. This exploitation tricks merchants to take advantage of the
Figure 3 shows the classification of exploitation and attack unstable actions of digital transactions. Defraud may in-
vectors that fall under each classification. Our analysis does fluence the merchant to release goods prior to a transac-
not determine how much effort is required to perform partic- tion being fully confirmed. In a normal scenario, a Bitcoin
ular attacks, rather, it points out the main flaws of particular transaction is confirmed after 6 transactions. However, a
exploitations. consumer may persuade a merchant to release goods without
the wait for up to 6 transactions, so that attack techniques
A. MALICIOUS ACTS such as 1 confirmation or n confirmation could be initiated to
Malicious acts may comprise the action of spreading mal- double spend. Similarly, in recent times, various retailers are
ware to deceive users. This type of exploitation is mostly accepting cryptocurrencies, allowing consumers to receive
initiated over the Internet to compromise user identity or their product instantly [34]. For example, purchasing a coffee
conduct fraud through the use of malware or viruses. Such from a coffee shop. Consider a scenario where an adversary
malicious activities can seriously impact a victim’s financial manages to spend the same cryptocurrency within a short
circumstances [30]. Malicious attacks may arise in any form span of time, which will onset a race between both transac-
such as an email from the wallet asking to sync the account tions. If the second transaction is adopted by the pool miners
with a network that has just been hard-forked. Exploitation of for processing, then the first transaction will be discarded,
user wallets through malicious attacks may allow an attacker potentially leaving the merchant unpaid for the provided
to drain all the currency. Crypto-jacking, slack, and forums goods.
attacks are a few malicious techniques asking miners to log
in through corrupted links [31]. Glupteba is another malware D. APPLICATION BUGS
that utilizes the Bitcoin blockchain for its update. Thus, it An application bugs exploitation emerges when there is an
remains active despite the server connection being terminated error in the smart contract code. This exploitation mainly
by the antivirus. This malware spreads through scripts to steal occurs in smart contracts. It arises when developers fail to
confidential information such as user id, passwords, browsing identify code errors in the decentralized application. Attack-
history, saved cookies, etc. [32]. ers are able to drain all the money from the contract wallet
through simple code bugs. Smart contract applications are
similar to web applications that run over the blockchain. Like
B. WEAK PROTOCOL
web application bugs, they also comprise errors, however,
Blockchain comprises a consensus protocol to keep the net- these bugs can lead to serious challenges. For example, the
work flowing. Different blockchain platforms have adopted DAO was able to raise $150m, whilst the attacker was able
different protocols. Exploitations due to weak consensus to steal about $60m due to code bugs. [35]. Rubixi and
have been very common in recent times, although it can often GovernMental are some of the smart contract applications
be very expensive to carry out attacks due to flaws in the which had flaws due to code bugs [11]. Application bugs may
consensus protocols. However, successfully executed attacks not only allow attackers to steal money, but also influence an
can remove blocks from the chain, destroy a blockchain fully, application to function differently.
or acquire full control over the price of a cryptocurrency.
51% Attack, Selfish mining, and 34% Attack are some attack IV. ATTACK TECHNIQUES
techniques that occur due to weak protocols. In this section, we define seven attack techniques which
The PoW protocol assumes that 50% of network miners can have a serious impact on a smart contract application.
will always to be honest miners. Thus, adversaries com- Successful execution of such attacks may lead the smart
prising more than 50% hashing can gain control of the contract to perform in an expected manner. Hence, parties
network [33]. Weak consensus can also lead to numerous associated with the contract agreement might incur a severe
attacks related to the blockchain network. The Sybil attack loss.
permits an attacker to establish several malicious nodes
over the Bitcoin blockchain network. The malicious nodes A. REENTRANCY
are then used to corrupt the network, conduct unprivileged Reentrancy is considered to be one of the most catastrophic
transactions, or alter valid transactions. Similarly, an Eclipse attack techniques in the smart contract [36]. This attack
attack can be executed to manipulate the Peer to Peer (P2P) technique is able to fully destroy the contract or steal valuable
network in order to gain full control over the information a information. Reentrancy may occur when a function calls
node comprises. In addition, Border Gateway Protocol (BGP) for another contract through an outer call. Listing 1 below
hijacking makes false declarations over the routing system presents a code snippet which can be exploited to execute
to divert the traffic. Thus, regardless of the decentralized a Reentrancy attack. The exploitation allows an attacker to
feature, the blockchain network can still be compromised by execute a recursive callback of the main function, making an
various attack techniques due to weak consensus. unintended loop which is repeated many times. For instance,
when a vulnerable contract contains a revoke function, the
VOLUME 4, 2016 5

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

FIGURE 3: A Classification of Exploitation Based on the Fragile Methods.

TABLE 1: C LASSIFICATION OF ATTACKS BASED ON EXPLOITATION

Malicious Acts Weak Protocol Defraud Application Bugs


Mining Malware 51% Attack Double Spending Reentrancy
Cryptojacking 34% Attack 1 Confirmation Attack DELEGATECALL
Slack and Forums Attack Sybil Attack n Confirmation Attack Overflow/Underflow

contract may call the revoke function illicitly numerous function batchTransfer(address[] _acceptors,
times in order to drain any available balance the contract uint256 _value) public whenNotPaused
returns (bool) {
comprises. Single function Reentrancy attacks and cross-
function Reentrancy attacks are two different types that can uint cnt = _acceptors.length;
be exploited by the attackers. The exploitation allows the uint256 total = uint256(cnt) * _value;
attacker to use external calls to execute the desired tasks. require(cnt > 0 && cnt <= 20);
require(_value > 0 && balances[msg.sender
] >= total);
function revoke() remote{ balances[msg.sender] = balances[msg.
uint256 value = balances[msg.sender]; sender].sub(total);
require(msg.sender.call.value(value)()); for (uint i = 0; i < cnt; i++) {
balances[msg.sender] = 0; balances[_acceptors[i]] = balances[
} _acceptors[i]].add(_value);
Transfer(msg.sender, _acceptors[i],
Listing 1: A vulnerable function that can be exploited by _value);
Reentrancy. }
return true;
}
Listing 2: A vulnerable contract which can be exploited by
B. SMART CONTRACT OVERFLOW AND UNDERFLOW Smart contract overflow.
This vulnerability is relatively easy to initiate and occurs in
transactions that accept unauthorized input data or value [37].
Smart contract overflow mainly occurs when more value is Listing 2 shows smart contract code which comprises bugs
provided than the maximum value [38]. The contracts are at the following line [39],
mainly written in Solidity which can handle up to 256-bit uint256 total = uint256(cnt) * _value;
numbers, thus, an increment by 1 would cause an overflow.
Conventional testing approaches are inadequate for determin- An attacker is able to call this function with parameters to
ing overflow vulnerability in smart contacts. exploit the vulnerability. For instance, the code below shifts
6 VOLUME 4, 2016

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

the check to balances[msg.sender] >= total. An the reward. Since the vulnerable code does not specify the
attacker can input 2 addresses in the receivers function in visibility and the _sendEther() function is set as public,
order for the token smart contract to transmit ether to both an attacker will be able to steal the reward.
addresses.
total = _value * 2 = 0 contract GuessAddress {

Smart contract underflow occurs in the opposite way to function gainEther() {


// Winner while the last 8 hex
overflow [40]. However, the underflow attacks are more
characters of the address are 0.
simple to perform as achieving the required token to cause require(uint32(msg.sender) == 0);
overflow is often challenging for attackers. _sendEther();
}
C. SHORT ADDRESS ATTACK
function _sendEther) {
This vulnerability occurs due to the weakness of the msg.sender.transfer(this.balance);
Ethereum Virtual Machine (EVM) [41]. The EVM permits }
imprecise padded arguments allowing adversaries to dispatch }
specially crafted addresses which result in the exploitation.
Listing 3: A vulnerable contract drained by attacker to steal
The Short Address Attack follows a similar attacking strategy
Ether.
as a SQL injection bug [42]. When an underflow is detected
the EVM includes a zero at the end of the address in order
to ensure that it comprises a 256-bit datatype. However, an
adversary can take advantage of this vulnerability by omitting
the very last zero from the ether address. This vulnerability is F. TRANSACTION ORDERING DEPENDENCE(TOD)
an input validation bug and mainly occurs from the sender’s Transaction Ordering Dependence (TOD) is a vulnerability
side due to weak transaction generation code. that can allow corrupt miners to have a serious effect on
smart contracts [44]. This vulnerability is a very common
D. DELEGATECALL security bug in the smart contract, relying on the order of
Smart code developers leverage the CALL and DELEGATE- transaction execution [45]. For example, a newly generated
CALL to modularise written code [43]. The DELEGATE block contains 2 transactions enforcing the same smart con-
opcode comprises a similar function to the message CALL, tract. Such plots do not provide enough information to users
however, other than the code executed to call for a contract, to determine the state of the contract or when the individual
the msg.sender and msg.value does not get altered. invocation is initiated. Therefore, when the output of both
This attribute allows developers to generate re-usable code, transactions is dependent on the order, the contract results in
enhancing the chance of abrupt code-execution by the use of a TOD vulnerability.
DELEGATECALL. The DELEGATECALL feature shows In Ethereum blockchain, the miners are in charge of con-
that it is possible to introduce flaws while building custom trolling the order of transactions, prioritizing transactions
libraries and it can also lead to new vulnerabilities. DELE- with higher gas. Hence, any miner that closes a block can
GATECALL vulnerabilities can be avoided by observing for influence the order of a transaction. The ability for potential
a lapse on both the library contract and calling contract and, miners to influence the transaction order for illicit activities
in addition, developing state-less libraries whenever feasible. is an outcome of Transaction Ordering Dependence (TOD).
E. DEFAULT VISIBILITIES
G. TIMESTAMP DEPENDENCE
The visibility specifiers in the Solidity function control the
manner in which a function is to be called [43]. The visi- Timestamp Dependence is another vulnerability that can be
bility specifier also takes control when permitting users to exploited by corrupt miners [44]. In order to gain a benefit, a
call for external functions by derived contracts. Improper miner may re-arrange the timestamp by a few seconds. The
implementation of the visibility specifiers can cause serious timestamp dependence vulnerability occurs from a flawed
effects in the smart contract. The default visibility is always comprehension of timekeeping [46]. It enables the Ethereum
set to public for functions, allowing external contracts to call network to be detached from the synchronized global clock.
for visibility when functions do not explicitly mention it. For example, a smart contract utilizes the current timestamp
This vulnerability arises when developers neglect to set the to produce random numbers in order to determine the lottery
visibility specifier to private. result. Since the smart contract permits miners to put up a
Listing 3 shows a smart contract based on an address timestamp within 30 seconds of block validation, this gives a
guessing game [43]. A participant can win a reward by miner more opportunity for exploitation. Hence, the outcome
producing an Ethereum address which must contain zeroes in of the random number generator can be altered to gain
its last 8 hex characters. Once the requirements are fulfilled, benefits.
the gainEther() function can be executed to receive
VOLUME 4, 2016 7

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

V. SECURITY TECHNIQUES D. MANTICORE


In this section, we discuss 10 major security analysis tools Manticore is a Solidity audit tool that performs a symbolic
which are in place to find vulnerabilities in the smart contract. analysis of smart contracts [51]. The main functions of manti-
Most tools are mainly utilized for static and dynamic analysis core involve tracing inputs that terminate a program, logging
of smart contract codes. instruction-level implementation, and providing access to
its analysis engine through Python API. It has a dynamic
A. SLITHER symbolic execution feature which analyzes binaries as well
as Ethereum smart contracts [52]. The primary attributes in
Slither is a static analysis framework for smart contract Manticore’s architecture comprise the Core Engine, Native
code [47]. Its security detection techniques for potential bugs Execution Modules, and Ethereum Execution Modules. The
are fast and reliable. Slither can be used to perform main Satisfiability Modulo Theories (SMT-LIB) module, Event
tasks such as automated vulnerablity detection, automated System, and API are regarded as secondary attributes.
optimization detection, code understanding, and assisted
code review. A multi-stage procedure is initiated for the E. SECURIFY
security analysis. The Solidity compiler produces a Solidity Securify is a smart contract security analyzer tool [53].
Abstract Syntax Tree (AST) from the contract source code Securify is an automated tool able to determine whether
and the AST is used as an input to Slither. During the initial the contract performs accordingly, based on the provided
stage, Slither obtains significant contract information such as attributes. Securify is an open-source product whose security
the inheritance graph, Control-flow graph (CFG) [48], etc. analysis function goes through two stages to perform the
The next stage includes converting the full code to SlithIR. required task [54]. Up to this point, around 18000 contracts
In the following stage, the code analysis task is performed by have been submitted to Securify for security analysis. Secu-
computing a list of pre-defined analyses. rify accepts EVM bytecode for security analysis. Contracts
written in Solidity are also accepted as an input, however,
B. MYTHX the code needs to be compiled to EVM bytecode for the
MythX is a security analysis service that scans EVM-based security process to be effected. When a security violation is
smart contracts for vulnerabilities [49]. It comprises various triggered, Securify produces a command which induces the
analysis techniques which include static, dynamic, as well violation pattern to match. Similarly, when both the violation
as symbolic execution. The main objective of MythX is to and compliance pattern do not match, it generates a warning.
support DApp developers with the development of smart The security analysis technique of Securify is unique when
contracts to ensure a safer platform. MythX does not serve compared with other tools such as Oyente and Mythril [55].
the requirements by itself, rather it is integrated with develop- While Oyente and Mythril symbolically enumerate distinct
ment tools such as Truffle and Remix. It is not only compati- paths of a contract, Securify utilizes static analysis to analyze
ble with the Ethereum platform - developers associated with every path of the smart contract.
Tron, Vechain, Quorum, Roostock and a few other EVM-
based platforms can also take advantage of these security F. SMARTCHECK
tools to find bugs in a smart contract. MythX goes through SmartCheck is an automated extensive vulnerability analysis
three stages to analyze smart contract code. First, it requires tool for Solidity smart contracts [56], [57]. SmartCheck
developers to submit their code; second, a complete suite of is an open-source engine which not only points out the
analysis techniques needs to be activated; finally, it generates vulnerabilities in the smart contract code but also clarifies
an analysis report demonstrating if any errors exist. the cause of the vulnerabilities with proper description and
recommendation. SmartCheck was implemented by utilizing
C. MYTHRIL
XPath [xpa] queries on the intermediate representation (IR)
to detect vulnerability patterns. SmartCheck protects any
Mythril is a security tool that analyzes smart contracts written analyzed code that has been converted to IR and elements
by Solidity [50]. Mythril, an open-source tool, takes advan- associated with it are determined with XPath matching.
tage of the symbolic execution technique in order to deter- A security experiment was initiated by SmartCheck on
mine the errors in code. The examination of security flaws over 4600 valid contracts. It was determined that 86.6%
involves executing smart contract bytecode in a custom built of the contacts comprised zero balance, whereas a single
EVM. Mythril goes through four major working stages to contract consisted of a balance of only 38.4% of the total
accomplish its security analysis. When a flaw in a program is balance. The SmartCheck analysis indicated that 99.9% of
discovered, the input transactions are analyzed to determine analyzed contracts contained some kind of security flaw, with
the possible reasons. This security method helps to deduce 63.2% of contracts being severely vulnerable.
the main cause of the program vulnerability, and also mitigate
exploitation. If a developer produces the source code of the G. ECHIDNA
contract, Mythril is able to locate the bugs within the code. Echidna is an EVM smart fuzzer that identifies bugs in Solid-
ity code [58]. This tool only requires the Solidity propositions
8 VOLUME 4, 2016

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

to conduct deep analysis for bugs and provides a clear user VI. SECURITY ANALYSIS AND LIMITATIONS
interface (UI) to simplify its output. Echidna utilizes different Having bugs in smart contract code can have serious con-
combinations of inputs until it manages to break the provided sequences. Attacks such as DAO or Parity Wallet hacks,
property. Echidna contains a few similar attributes to Man- discussed in section II show the effects of such exploita-
ticore, which allows it to function at the EVM level [59]. In tions. In this section, we analyze the 10 security techniques
addition, it can also be consolidated to continuous integration discussed in section V. Our analysis reveals the limitations
(CI) in order to identify code bugs whilst development is in of particular techniques, and also determines their ability to
process. A myriad of tools are supplied by Echidna in order discover vulnerabilities.
to compose custom analyses for dealing with complicated Slither includes a few limitations. It lacks formal seman-
contracts. This tool utilizes stack, therefore, the required tics, which limits its ability to perform more detailed security
dependency will be based on the solc version that the contract analysis [47]. It also fails to determine low-level information
employs. precisely, for instance, the gas computation. Slither’s vulner-
ability detection process is similar to SmartCheck [63]. It
H. OYENTE misses vulnerable codes and terminates the scanning process
when the security regulations do not coincide in a severe ex-
Oyente is a symbolic execution tool which is used to
ternal call. However, besides these limitations, an experiment
find security bugs in smart contracts [60]. Oyente exam-
on detection capability demonstrates that Slither can detect
ines Ethereum smart contracts to identify security loopholes
major vulnerabilities such as Reentrancy, contract suicidal,
which can cause potential threats. Oyente not only detects
an abuse of Tx origin, and time manipulation.
unsafe bugs but also investigates every practical execution
MythX is able to detect some critical vulnerabilities such
path. An experiment carried out by Oyente on 19,366 smart
as access controls, integer overflow, and integer under-
contracts resulted in 8,833 of them being identified as vul-
flow [64]. The Remix Integrated Development Environment
nerable. The symbolic execution method symbolically rep-
(IDE) can be enhanced by a MythX plugin. The Mythx plugin
resents the nature of an execution path as a mathematical
uses the trial account credentials. The main limitation of
formula. OYENTE carries out a comparison between the new
the trial account is that it is able to examine only a limited
formula and formulas that comprise ordinary bugs to figure
number of vulnerabilities.
out if both formulas are valid simultaneously.
Although using a heuristic, Mythril is known for its high
accuracy in security analysis. However, experiments suggest
I. VANDAL that Mythril consists of a few limitations [65]. For instance,
Vandal is another security analysis framework for smart Mythril is unable to extend taints over memory fields when
contracts. Vandal comprises an analysis pipeline which trans- analyzed with taint analysis. Issues can be exacerbated when
forms EVM bytecode into semantic logic relations [61]. the parameters accept pass by reference. Moreover, the def-
Vandal is a very fast and efficient security analysis tool that inition of the pattern is complicated in searching for the
has examined over 95% of 141000 smart contracts with an best approximation for the behavior. Another experiment
average run-time overhead of only 4.15 seconds. The low indicates that although Mythril is able to defend against
overhead beats the overall performance of major existing se- vulnerabilities such as TOD, Reentrancy, and TX.origin, it
curity analysis tools. The security design of Vandal comprises was able to recognize only 12 vulnerabilities out of 18 [66].
a declarative language called Soufflé. Performing security Manticore defends against the popular Reentrancy vulner-
analysis in a declarative language helps security analysts with ability as well as Abuse of TX origin [63]. However, it is
the prototype of the latest analysis. unable to detect contract suicidal and time manipulation. It
also does not analyze various security issues such as TOD,
Random number, visibility, costly pattern, etc. One of the
J. ZEUS
major disadvantages of Manticore is that it performs analysis
Zeus is a practical framework to examine the validity of smart for different types of attack techniques; hence, the imple-
contracts [62]. It takes advantage of abstract interpretation, mentation is quite sluggish [51]. A Solidity compiler and
and symbolic model checking for analyzing the safety of state-of-the-art theorem prover z3 are the prerequisites for
smart contracts. The Zeus prototype has tested over 22400 running Manticore. Although symbolic analysis techniques
smart contracts, showing that about 94.6% of these contracts are being widely reviewed from a security perspective, they
are vulnerable. Zeus accepts the smart contract code and are not being fully exercised due to the limited flexibility
generates the authentic version in an XACML-styled tem- and user-availability. An experiment on smart contracts from
plate. The smart contract code and the policy specifications Ethereum blockchains with a set time out of 90 minutes on
are translated to LLVM bitcode to enhance the contract’s each contract shows that Manticore was able to produce an
behavior. Zeus performs static analysis of the furnished smart average coverage of 65.64%.
contract code to append the assert statement policy at the Securify is an advanced tool comprising formal guaran-
right spot of the program. tees. A security experiment suggests that Securify only tar-
gets 7 issues for security analysis among 18 blockchain based
VOLUME 4, 2016 9

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

challenges [66]. Besides some security advantages, Securify origin. Research suggests that Oyente protects against only 4
contains severe flaws. Securify does not comprehend numer- out of 18 blockchain-based security challenges [66]. Hence,
ical analysis [67]. Hence, it is unable to recognize overflows, this security approach is not fully protective.
allowing for potential bugs in the smart contract code [53]. The vandal security design faces challenges while translat-
Similarly, Securify determines that all contract instructions ing smart contract code into logic relations [61]. An analysis
can be reachable. Moreover, some of the attributes for prop- pipeline is used to transform Ethereum bytecode into logic
erty violations are also vulnerable and can be compromised relations. The challenge lies when the low-level stack-based
by potential adversaries. abstract machine executes the EVM bytecode. Moreover, the
SmartCheck is unable to detect some severe program bugs, Vandal decompiler cannot cope with transforming the EVM’s
which can only be detected by taint analysis or handled stack-based operations into a register-based intermediate rep-
through manual audits [56]. Taint analysis is a way of check- resentation; hence, it crashes when decompiling the major
ing program variables that can be affected by user input [68]. portion of the smart contract [73]. The implementation of
One of the possible reasons for a program to crash can Vandal also suffers from engineering limitations, thus proper
be illicit user input. Hence, in order for a program to run control of timeout may not be achieved [74]. A security
effectively, user input must be thoroughly checked. However, experiment shows that Vandal is able to detect only 5 out of
SmartCheck is an effective tool for identifying simple pro- 18 critical blockchain-based security issues [66].
gram bugs. An experiment among 4 security analysis tools, ZEUS comprises a few limitations. Attributes involving
namely, Oyente, Securify, Remix, and SmartCheck, indicates mathematical equations cannot be fully validated [62]. For
that SmartCheck is not very consistent in terms of perfor- such operations, ZEUS relies entirely on users to test prac-
mance and that additional security features must be included tices involving mathematical attributes. Solidity constructs,
for accuracy in vulnerability checks [69]. SmartCheck only such as throw and selfdestruct, are simulated as a
identifies vulnerabilities that are low risk to the contract. For program termination. The run-time behavior of ZEUS does
instance, incorrect compiler version, improper style guide, not consider such parameters. Similarly, it fails to reinforce
and redundant functions. Similarly, another experiment based virtual functions and examine contracts which contain as-
on the detection capability of various security tools shows sembly blocks. The validation of safety properties are ac-
that SmartCheck is unable to detect some serious attacks such knowledged by ZEUS. However, verification of liveness is
as Reentrancy and contract suicidal [63]. not endorsed by ZEUS. Static analysis tools may not be
Echidna generates inputs to fuzz smart contract code. fully able to detect cross-function Reentrancy vulnerabilities
However, one of the major limitations of Echidna is that it because every external function is required to be checked to
does not offer any direct application program interface (API) keep the contracts function safe [75]. In addition, ZEUS does
endorsing security checks of smart contracts [70]. Moreover, not involve policies to execute cross-function analysis.
Echidna fails to provide satisfactory security results [71]. The
randomness of inputs makes only a portion of the path space VII. CONCLUSIONS
obtainable, whereas some complicated parts of the program Smart contract technologies enable users to form decentral-
are secured by branch conditions. Random mutation does ized digital agreements without the need for a third party. The
not fulfill the requirements of branch conditions, hence the smart contract technology attracted sectors such as health,
program remains exploitable. In addition, Echidna exercises business management, shareholder agreement and insurance.
various generation methods for different data types [72]. However, the more this technology expands, the more it
While the Haskell is ignored, the address is the only data catches the attention of potential attackers, resulting in sev-
type that can produce an impact. When a list of addresses eral severe exploitations.
is determined as a yaml list, those addresses provide more In this paper, we revealed that this technology is not
chances to discover bugs as compared to fully random ad- free from vulnerabilities and attacks. Based on the attack
dresses. vector, we proposed an attack categorization to focus on
Oyente is a smart contract auto-auditing security analyzer vulnerabilities in the code of smart contracts. After analyzing
tool which is able to detect severe smart contract bugs. 10 security tools to detect vulnerabilities in order to assess
However, there still lie challenges as Oyente is able to detect their effectiveness, we found that not all vulnerabilities were
only 20.2% of Parity Wallet hacks [53]. An analysis indicates detected, providing a dangerous false sense of security that
that Oyente generates false positives and also underestimates attackers can abuse.
some serious bugs. It does not provide full protection to smart Our research points out that a proper solution to secure
contract code and fails to log 72.9% of TOD vulnerabilities. smart contracts remains a challenge and future work will
Moreover, Oyente also consistently fails to determine other involve developing strategies to detect and mitigate the major
critical vulnerabilities. An experiment on Oyente’s vulner- security flaws presented in this paper.
ability detection capability suggests that it is only able to
REFERENCES
defend against attacks such as Reentrancy and Time manipu-
[1] A. Rosic, What is Blockchain Technology? A Step-by-
lation [63]. However, it is wholly unsuccessful in identifying Step Guide For Beginners, 2016 (accessed 29 July, 2018),
vulnerabilities such as contract suicidal and Abuse of TX https://blockgeeks.com/guides/what-is-blockchain-technology/.

10 VOLUME 4, 2016

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

[2] ——, What is Ethereum?, 2016 (accessed 17 October, 2019), [28] B. Mueller, What Caused the Accidental Killing of the Parity Mul-
https://blockgeeks.com/guides/ethereum/. tisig Wallet & How to Detect Similar Bugs, 2019 (accessed 25 Oc-
[3] J. Alsayed Kassem, S. Sayeed, H. Marco-Gisbert, Z. Pervez, and K. Dahal, tober, 2019), https://hackernoon.com/what-caused-the-latest-100-million-
“Dns-idm: A blockchain identity management system to secure personal ethereum-bug-and-a-detection-tool-for-similar-bugs-7b80f8ab7279.
data sharing in a network,” Applied Sciences, vol. 9, no. 15, p. 2953, 2019. [29] M. Condon, Parity Wallet Hack 2: Electric Boogaloo, 2019 (accessed
[4] Bitcoin.org, How does Bitcoin work?, 2009 (accessed 29 July, 2017), 20 October, 2019), https://hackernoon.com/parity-wallet-hack-2-electric-
https://bitcoin.org/en/how-it-works. boogaloo-e493f2365303.
[5] A. Rosic, Smart Contracts: The Blockchain Technology That [30] J. J. Xu, “Are blockchains immune to all malicious attacks?” Financial
Will Replace Lawyers, 2016 (accessed 3 August, 2019), Innovation, vol. 2, no. 1, p. 25, 2016.
https://blockgeeks.com/guides/smart-contracts/. [31] S. Sayeed and H. Marco-Gisbert, “On the effectiveness of blockchain
[6] S. Velu, What Are Dapps? The New Decentralized Future, 2019 (accessed against cryptocurrency attacks.”
14 October, 2019), https://blockgeeks.com/guides/dapps/. [32] B. Bambrough, Warning Issued After Malware Is Found To Have
[7] F. Ma, Y. Fu, M. Ren, M. Wang, Y. Jiang, K. Zhang, H. Li, and X. Shi, Hijacked Bitcoin Blockchain, 2019 (accessed 29 October, 2019),
“Evm*: From offline detection to online reinforcement for ethereum https://www.forbes.com/sites/billybambrough/2019/09/07/serious-
virtual machine,” in 2019 IEEE 26th International Conference on Software malware-warning-over-bitcoin-blockchain/#cc2d8347c286.
Analysis, Evolution and Reengineering (SANER). IEEE, 2019, pp. 554– [33] S. Sayeed and H. Marco-Gisbert, “Assessing blockchain consensus and
558. security mechanisms against the 51% attack,” Applied Sciences, vol. 9,
[8] Y. Fu, M. Ren, F. Ma, H. Shi, X. Yang, Y. Jiang, H. Li, and X. Shi, no. 9, p. 1788, 2019.
“Evmfuzzer: detect evm vulnerabilities via fuzz testing,” in Proceedings [34] M. del Castillo, Customers Can Spend Bitcoin At Star-
of the 2019 27th ACM Joint Meeting on European Software Engineering bucks, Nordstrom And Whole Foods, Whether They
Conference and Symposium on the Foundations of Software Engineering, Like It Or Not, 2019 (accessed 27 August, 2019),
2019, pp. 1110–1114. https://www.forbes.com/sites/michaeldelcastillo/2019/05/13/starbucks-
[9] I.-C. Lin and T.-C. Liao, “A survey of blockchain security issues and nordstrom-and-whole-foods-now-accept-bitcoin-just-dont-ask-
challenges.” IJ Network Security, vol. 19, no. 5, pp. 653–659, 2017. them/659a4e592252.
[10] A. Soundararajan, 10 Blockchain and New Age Security [35] O. G. GÃijçlütürk, The DAO Hack Explained: Unfortunate
Attacks You Should Know, 2019 (accessed 29 July, 2018), Take-off of Smart Contracts, 2018 (accessed 19 October, 2019),
https://blogs.arubanetworks.com/solutions/10-blockchain-and-new- https://medium.com/@ogucluturk/the-dao-hack-explained-unfortunate-
age-security-attacks-you-should-know/. take-off-of-smart-contracts-2bd8c8db3562.
[11] N. Atzei, M. Bartoletti, and T. Cimoli, “A survey of attacks on ethereum [36] W. Shahda, Protect Your Solidity Smart Contracts From
smart contracts.” Reentrancy Attacks, 2019 (accessed 5 October, 2019),
[12] Pluralsight, What’s the Difference Between the Front-End and Back-End?, https://medium.com/coinmonks/protect-your-solidity-smart-contracts-
2015 (accessed 29 July, 2018), https://www.pluralsight.com/blog/film- from-reentrancy-attacks-9972c3af7c21.
games/whats-difference-front-end-back-end.
[37] J. Gao, H. Liu, C. Liu, Q. Li, Z. Guan, and Z. Chen, “Easyflow: Keep
[13] M. Andreessen, What is Blockchain Technology?, (accessed 25 Septem-
ethereum away from overflow,” in Proceedings of the 41st International
ber, 2019), https://www.coindesk.com/information/what-is-blockchain-
Conference on Software Engineering: Companion Proceedings. IEEE
technology.
Press, 2019, pp. 23–26.
[14] A. Rosic, What is Blockchain Technology? A Step-by-Step
[38] S. Sayeed and H. Marco-Gisbert, “On the effectiveness of control-flow
Guide For Beginners, 2016 (accessed 27 September, 2019),
integrity against modern attack techniques,” in ICT Systems Security and
https://blockgeeks.com/guides/what-is-blockchain-technology/.
Privacy Protection, G. Dhillon, F. Karlsson, K. Hedström, and A. Zúquete,
[15] D. Cosset, Blockchain: What is Mining?, 2018 (accessed 29 July, 2018),
Eds. Cham: Springer International Publishing, 2019, pp. 331–344.
https://dev.to/damcosset/blockchain-what-is-mining-2eod.
[39] L. Y. Thanh, Prevent Integer Overflow in Ethereum Smart Contracts,
[16] A. Hertig, How Ethereum Mining Works, 2019 (accessed 20 October,
2018 (accessed 19 June, 2019), https://medium.com/@yenthanh/prevent-
2019), https://www.coindesk.com/information/ethereum-mining-works.
integer-overflow-in-ethereum-smart-contracts-a7c84c30de66.
[17] A. Kosba, A. Miller, E. Shi, Z. Wen, and C. Papamanthou,
“Hawk: The blockchain model of cryptography and privacy-preserving [40] Blockgeeks, Understanding Overflow and Underflow At-
smart contracts,” Cryptology ePrint Archive, Report 2015/675, 2015, tacks on Smart Contracts, 2018 (accessed 19 July, 2019),
https://eprint.iacr.org/2015/675. https://blockgeeks.com/guides/underflow-attacks-smart-contracts/.
[18] H. Kalodner, S. Goldfeder, X. Chen, S. M. Weinberg, and E. W. Felten, [41] A. Bryk, Blockchain Attack Vectors: Vulnerabilities of the
“Arbitrum: Scalable, private smart contracts,” in 27th {USENIX} Security Most Secure Technology, 2018 (accessed 14 September, 2019),
Symposium ({USENIX} Security 18), 2018, pp. 1353–1370. https://www.apriorit.com/dev-blog/578-blockchain-attack-vectors.
[19] P. Das, L. Eckey, T. Frassetto, D. Gens, K. Hostáková, P. Jauernig, S. Faust, [42] S. Esra, ICO Smart contract Vulnerability: Short Address Attack, 2018 (ac-
and A.-R. Sadeghi, “Fastkitten: Practical smart contracts on bitcoin.” cessed 14 October, 2019), https://medium.com/huzzle/ico-smart-contract-
[20] J. M. Duffy, Connecting Ethereum, EOS, and Tron: Making Blockchain vulnerability-short-address-attack-31ac9177eb6b.
Interoperability a Reality, 2019 (accessed 29 October, 2019), [43] A. Manning, Solidity Security: Comprehensive list of known attack
https://medium.com/loom-network/connecting-ethereum-eos-and-tron- vectors and common anti-patterns, 2018 (accessed 19 July, 2019),
making-blockchain-interoperability-a-reality-e5ef6c67716. https://blog.sigmaprime.io/solidity-security.html.
[21] B. Magazine, What Is Ether?, 2019 (accessed 12 September, 2019), [44] S. Pro, Smart contract security issues: what are smart contract
https://bitcoinmagazine.com/guides/what-ether. vulnerabilities and how to protect, 2019 (accessed 19 Septem-
[22] Freshfields, What’s in a smart contract?, 2019 (accessed ber, 2019), https://smartym.pro/blog/smart-contract-security-issues-smart-
23 October, 2019), https://www.freshfields.com/en-gb/our- contract-vulnerabilities-and-how-to-protect/.
thinking/campaigns/digital/fintech/whats-in/whats-in-a-smart-contract/. [45] A. Das, S. Balzer, J. Hoffmann, and F. Pfenning, “Resource-aware session
[23] Prasanna, What is Ethereum Virtual Machine?, 2019 (accessed 23 October, types for digital contracts,” arXiv preprint arXiv:1902.06056, 2019.
2019), https://cryptoticker.io/en/ethereum-virtual-machine/. [46] H. Olickel, Why Smart Contracts Fail: Undiscovered bugs and
[24] L. Hollander, The Ethereum Virtual Machine âĂŤ How does it work?, what we can do about them, 2016 (accessed 29 July, 2019),
2019 (accessed 26 October, 2019), https://medium.com/mycrypto/the- https://medium.com/@hrishiolickel/why-smart-contracts-fail-
ethereum-virtual-machine-how-does-it-work-9abac2b7c9e. undiscovered-bugs-and-what-we-can-do-about-them-119aa2843007.
[25] D. Siegel, Understanding The DAO Attack, 2016 (accessed 27 September, [47] J. Feist, G. Grieco, and A. Groce, “Slither: a static analysis framework
2019), https://www.coindesk.com/understanding-dao-hack-journalists. for smart contracts,” in 2019 IEEE/ACM 2nd International Workshop on
[26] S. Falkon, The Story of the DAO âĂŤ Its History and Consequences, 2017 Emerging Trends in Software Engineering for Blockchain (WETSEB).
(accessed 19 October, 2018), https://medium.com/swlh/the-story-of-the- IEEE, 2019, pp. 8–15.
dao-its-history-and-consequences-71e6a8a551ee. [48] S. Sayeed, H. Marco-Gisbert, I. Ripoll, and M. Birch,
[27] S. Palladino, The Parity Wallet hack Explained, 2017 (accessed 20 Oc- “Control-flow integrity: Attacks and protections,” Applied Sciences,
tober, 2019), https://blog.openzeppelin.com/on-the-parity-wallet-multisig- vol. 9, no. 20, p. 4229, Oct 2019. [Online]. Available:
hack-405a8c12e8f7/. http://dx.doi.org/10.3390/app9204229

VOLUME 4, 2016 11

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

[49] MythX, Smart Contract Security Tool for Ethereum, 2019 (accessed 24 national Conference on Automated Software Engineering. ACM, 2018,
October, 2019), https://mythx.io/. pp. 259–269.
[50] B. Mueller, Practical Smart Contract Security Analysis [71] M. Fu, L. Wu, Z. Hong, F. Zhu, H. Sun, and W. Feng, “A critical-path-
and Exploitation, 2019 (accessed 25 October, 2019), coverage-based vulnerability detection method for smart contracts,” IEEE
https://medium.com/hackernoon/practical-smart-contract-security- Access, vol. 7, pp. 147 327–147 344, 2019.
analysis-and-exploitation-part-1-6c2f2320b0c. [72] D. Guido, Echidna,Basic Echidna usage, 2018 (accessed 11 September,
[51] H. Official, Introduction to Manticore, a symbolic analysis 2019), https://github.com/crytic/slightly-smarter-contracts/wiki/echidna.
tool for smart contract, 2018 (accessed 26 October, 2019), [73] N. Grech, L. Brent, B. Scholz, and Y. Smaragdakis, “Gigahorse: thorough,
https://medium.com/haloblock/introduction-to-manticore-a-symbolic- declarative decompilation of smart contracts,” in Proceedings of the 41st
analysis-tool-for-smart-contract-9de08dae4e1e. International Conference on Software Engineering. IEEE Press, 2019,
[52] M. Mossberg, F. Manzano, E. Hennenfent, A. Groce, G. Grieco, J. Feist, pp. 1176–1186.
T. Brunson, and A. Dinaburg, “Manticore: A user-friendly symbolic [74] N. Grech, M. Kong, A. Jurisevic, L. Brent, B. Scholz, and Y. Smaragdakis,
execution framework for binaries and smart contracts,” arXiv preprint “Madmax: Surviving out-of-gas conditions in ethereum smart contracts,”
arXiv:1907.03890, 2019. Proceedings of the ACM on Programming Languages, vol. 2, no. OOP-
[53] P. Tsankov, A. M. Dan, D. Drachsler-Cohen, A. Gervais, F. Buenzli, SLA, p. 116, 2018.
and M. T. Vechev, “Securify: Practical security analysis of smart [75] M. Rodler, W. Li, G. O. Karame, and L. Davi, “Sereum: Protect-
contracts,” CoRR, vol. abs/1806.01143, 2018. [Online]. Available: ing existing smart contracts against re-entrancy attacks,” arXiv preprint
http://arxiv.org/abs/1806.01143 arXiv:1812.05934, 2018.
[54] Securify, Securify: Security Scanner for Ethereum Smart Contracts, 2018
(accessed 26 October, 2019), https://securify.chainsecurity.com/.
[55] ChainSecurity, Securify is Now on GitHub, 2018 (accessed 10 Octo-
ber, 2019), https://medium.com/chainsecurity/securify-is-now-on-github-
d3bec281eafc.
[56] S. Tikhomirov, E. Voskresenskaya, I. Ivanitskiy, R. Takhaviev,
E. Marchenko, and Y. Alexandrov, “Smartcheck: Static analysis of
ethereum smart contracts,” in 2018 IEEE/ACM 1st International
Workshop on Emerging Trends in Software Engineering for Blockchain SARWAR SAYEED is a Ph.D.researcher at the
(WETSEB). IEEE, 2018, pp. 9–16. University of the West of Scotland , UK. He holds
[57] Smartdec, SmartCheck, 2018 (accessed 27 October, 2019), his Bachelor in Computing from University of
https://tool.smartdec.net/. East London, UK, Masters in IT from Cardiff
[58] trailofbits.com, Echidna, a smart fuzzer for Ethereum, 2018 (accessed Metropolitan University, UK, and MBA from An-
10 September, 2019), https://blog.trailofbits.com/2018/03/09/echidna-a-
glia Ruskin University, UK. His research interest
smart-fuzzer-for-ethereum/.
involves Control-flow Integrity, Blockchain Secu-
[59] Josselinfeist, Watch Your Language: Our First
rity, Blockchain based-attacks, etc. He has pub-
Vyper Audit, 2019 (accessed 11 November, 2019),
https://securityboulevard.com/2019/10/watch-your-language-our-first- lished a few articles related to blockchain and
vyper-audit/. Control-flow Integrity. He has also participated in
[60] L. Luu, D.-H. Chu, H. Olickel, P. Saxena, and A. Hobor, “Making a few research projects as a Co-Investigator.
smart contracts smarter,” in Proceedings of the 2016 ACM SIGSAC
Conference on Computer and Communications Security, ser. CCS ’16.
New York, NY, USA: ACM, 2016, pp. 254–269. [Online]. Available:
http://doi.acm.org/10.1145/2976749.2978309
[61] L. Brent, A. Jurisevic, M. Kong, E. Liu, F. Gauthier, V. Gramoli, R. Holz,
and B. Scholz, “Vandal: A scalable security analysis framework for
smart contracts,” CoRR, vol. abs/1809.03981, 2018. [Online]. Available:
http://arxiv.org/abs/1809.03981
[62] S. Kalra, S. Goel, M. Dhawan, and S. Sharma, “Zeus: Analyzing safety of
smart contracts,” in NDSS, 2018. DR. H. MARCO-GISBERT is an associate pro-
[63] S. Jarzabek, A. Poniszewska-Marańda, and L. Madeyski, Integrating fessor and cybersecurity researcher at the Uni-
Research and Practice in Software Engineering, ser. Studies in compu- versity of the West of Scotland, UK. He holds
tational intelligence. Springer International Publishing, 2019. [Online]. a PhD in Computer Science, Cybersecurity, from
Available: https://books.google.co.uk/books?id=LR2nDwAAQBAJ Universitat Politecnica de Valencia, Spain. Hector
[64] S. Bomko, Detecting Critical Smart Contract Vulnerabil- is senior member of the Institute of Electrical and
ities with re:MythX, 2019 (accessed 19 October, 2019), Electronics (IEEE), and member of the Engineer-
https://medium.com/@sergiibomko/detecting-critical-smart-contract- ing and Physical Sciences Research Council (EP-
vulnerabilities-with-re-mythx-c543615bc216.
SRC) in UK. Previously, he was research associate
[65] I. Goldberg and T. Moore, Financial Cryptography and Data Security:
at the Universitat Politecnica de Valencia where
23rd International Conference, FC 2019, Frigate Bay, St. Kitts and Nevis,
he co-founded the "cybersecurity research group". Hector was part of the
February 18–22, 2019, Revised Selected Papers, ser. Lecture Notes in
Computer Science. Springer International Publishing, 2019. [Online]. team developing the multi-processor version of the XtratuM hypervisor to
Available: https://books.google.co.uk/books?id=Gcm1DwAAQBAJ be used by the European Space Agency in its space crafts. He participated
[66] M. Di Angelo and G. Salzer, “A survey of tools for analyzing ethereum in multiple research projects as Principal Investigator and Co-Investigator.
smart contracts.” Hector is author of many papers of computer security and cloud computing.
[67] Enigmatic, Using Securify for Safer Smart Contracts, 2019 (accessed 20 He has been invited multiple times to reputed cybersecurity conferences such
October, 2019), https://medium.com/coinmonks/using-securify-for-safer- as Black Hat and DeepSec. Hector has published more than 10 Common
smart-contracts-8d59de22a762. Vulnerabilities and Exposures (CVE) affecting important software such as
[68] J. Salwan, Taint analysis and pattern matching with Pin, 2013 (ac- the Linux kernel. He has received honors and awards from Google, Packet
cessed 19 July, 2019), http://shell-storm.org/blog/Taint-analysis-and- Storm Security and IBM for his security contributions to the design and
pattern-matching-with-Pin/. implementation of the Linux ASLR.
[69] A. Dika, “Ethereum smart contracts: Security vulnerabilities and security
tools,” Master’s thesis, NTNU, 2017.
[70] B. Jiang, Y. Liu, and W. Chan, “Contractfuzzer: Fuzzing smart contracts
for vulnerability detection,” in Proceedings of the 33rd ACM/IEEE Inter-

12 VOLUME 4, 2016

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.2970495, IEEE Access

Author et al.: Preparation of Papers for IEEE TRANSACTIONS and JOURNALS

TOM CAIRA is a senior lecturer and researcher


at the University of the West of Scotland, UK. He
holds a BSc degree in Computing Science from
University of Glasgow, UK, and a Postgraduate
Diploma in Advanced Research and Professional
Practice from University of the West of Scotland,
UK. He is currently completing a Professional
Doctorate at University of the West of Scotland.
His research interests include network and data
security, data governance, personal data stores,
business process improvement, and digital transformation.

VOLUME 4, 2016 13

This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.

You might also like