Smart Contracts: Russian Roulette with Four Bullet Rounds
TechnologyBit News Today2 min read
In a week where EOS has been in the news for the wrong reasons due to a RAM vulnerability, a code auditor has revealed just how common smart contract bugs are. Hosho, a security company that teamed up with community management group Amazix, discovered that one out of four projects has critical vulnerabilities.
Ethereum Ramps Risks
Ethereum, a favorite launchpad for ICOs, has been the worst hit, with stories abounding of vulnerable code that has led to the theft or locking up of hundreds of millions of dollars worth of ether. But with Ethereum’s totally flexible, Turing-complete system, there is a bigger margin for error.
Finding and removing every potential security flaw is a grueling task that even experienced Solidity developers struggle to accomplish. Several Ethereum-based projects have had to conduct token swaps after messing up their initial smart contract.
A research paper by five students from the UK and Singapore revealed how widespread vulnerable smart contracts are. In their paper, titled "Finding The Greedy, Prodigal, and Suicidal Contracts at Scale", the researchers noted that smart contracts hold billions of dollars worth of coins and cannot be updated after being deployed. On a smaller subset of 3,759 contracts, the researchers determined exploits to be real in 89% of cases, affecting 3,686 contracts. Because of this, attackers have incentives to put this research into practice to lock up and steal funds.
In the summer of 2016, an attacker exploited such a bug to take more than $50 million in Ether from TheDAO. Prompted by this, researchers at the National University of Singapore created a tool named Oyente to find flaws in Ethereum smart contracts. Oyente discovered that 8,833 out of 19,366 contracts were vulnerable. Named Maian, a new tool can scan for flaws and is specialized in at-scale scanning. The researchers hesitate to release Maian, fearing that attackers could use it to target smart contract vulnerabilities. They warn users to deploy smart contract analysis software to check for flaws before backing a contract. These vulnerabilities include prodigal contracts that send funds to the wrong address during an attack, suicidal contracts that outsiders can kill, and greedy contracts where non-owners can lock funds indefinitely.
The causes underlying these vulnerabilities often result not from seasoned professionals but from web developers without an adequate understanding of Solidity, a key language for blockchain. Sawhney of Hosho reported that the firm finds at least a couple of vulnerabilities in every smart contract audit it performs, even when serving as a second or third auditor.
A regulation warning by the Commodity Futures Trading Commission (CFTC) noted that the 20-year-old concept of smart contracts is only as reliable as the information they receive and the guiding code, while also presenting technical and cybersecurity challenges. Regulators have cautioned that these vulnerabilities pose risks of fraud and reduced transparency and accountability.
According to Amazix CMO Kenneth Berthelsen, auditing smart contracts and performing penetration testing are essential parts of blockchain security given the lack of industry standards.



