Scanning Live Ethereum of Unchecked-Send Error Contracts. Part 2
3r33333. 3r3-31. 3r3196. 3r3197. 3r33338. Continuing article Scanning Live Ethereum of Unchecked-Send Error Contracts. Part 1. 3r33333. 3r33351. 3r33333. 3r33338. Almost a year ago (while Ethereum was in its “border” release), the popular lottery contract EtherPot [9]3r33333. also suffered from the same error. An earlier version of BTCRelay also showed this error 3r33258.[7]3r33333. . Although a danger was discovered in a previous security audit, an incorrect patch was first applied to 3r-?667.[8]3r33333. . 3r33333. 3r318. 3r33333. 3r33351. 3r33333. 3r3196. “Unchecked-send” error detection on live blockhain
3r33351. 3r33333. 3r33338. How common are these errors? Do you heed warnings? Do best practices apply? We answer these questions empirically by analyzing the block-chain Ethereum data, as well as the Solidity code repository found on etherscrape.com. To do this, we are developing a simple software analysis tool that checks the block-chain contract and uses heuristics to check whether one of the most effective protection methods is being used. Listing 2 shows the first protection technique, as recommended by the Ethereum documentation, which should check for the return value of 3r3189. send
and throw an exception. To detect the use of this method, we use a rough approximation: we simply look for whether the return value of
is ignored. send
or not. 3r33351. 3r33333. 3r33351. 3r33333. Listing 4 illustrates the second protection technique recommended in the UMD manual, which directly checks if r3r3189 is full. callstack
by sending a test message. To discover this technique, we again use an approximate approximation: we simply check if the message is being sent in addition to the 3r3189 command. send
. 3r33351. 3r33333. 3r33351. 3r33333. If none of these heuristic indicators are present, we conclude that none of the best practice recommendations are followed. We implement these heuristics using a simple pattern mapping with a compiled EVM bytecode. More information on how we do this is provided in Appendix
[12]3r33333. . 3r33351. 3r33333. 3r33333. 3r33351. 3r33333. 3r33351. 3r33333. 3r3196. How many contracts are vulnerable? 3r3197. 3r33351. 3r33333. 3r33338. We start by checking the heuristics in the Etherscrape repository of the Solidity source code. As of March 2? 201? Etherscrape retransmission contained 361 Solidity contract programs, 56 of which contained the send instruction. Of these contract programs, we assume that most (at least 36 out of 56) do not use any of the protective programming methods. 3r33351. 3r33333. 3r33351. 3r33333. Even if the contract does not use any of the security technologies, it may or may not have a real vulnerability. We manually checked the Solidity contracts to confirm the presence of the vulnerability. For our purposes, we treat a contract as vulnerable if its condition may change, even if the team is 3r3189. send
does not work (so we will look at the vulnerable code in Listing 5). We confirmed that the vulnerability is present in the vast majority, 32 out of 36 of these contracts. 3r33351. 3r33333. 3r33333. 3r33351. 3r33333. 3r33338. Similarly, our heuristics do not guarantee the correct application of defensive programming. Take, for example, “WeiFund”, a decentralized open-source crowdfunding DApp.
This contract is It has two functions:
refund ()
and 3r3189. payout ()
that cheat our heuristics. The following is an excerpt from 3r3189. refund
. 3r33351. 3r33333. 3r33333. 3r33351. 3r33333. 3r33338. 3r33333. 3r3384. function refund (uint _campaignID, uint contributionID) public {3r-3363.
3r395. 3r33351. 3r33333. 3r33338. In this code, the message is sent to WeiFundConfig (c.config) to call the refund method, but only under certain conditions. If c.config is zero, then the contract is really vulnerable to a callstack attack. When testing *, none of the Solidity programs that have passed our heuristic test have actually applied the recommended best practice of testing callstack directly. *
receiver.send (donation.amountContributed); 3r33333. donation.refunded = true; 3r33333.
if (c.config! = address (0))
WeiFundConfig (c.config) .refund (_campaignID, donation.contributor,
Donation.amountContributed); 3r33333.}
3r33333. 3r33351. 3r33333. Then we turn our attention to contracts drawn up on the live block-chain Ethereum. We looked at a snapshot of March 2? 2016 (time stamp: 1184243). This snapshot contains a total of 1?645 block chains, which appear to be generated by the Solidity compiler, of which only ?618 (11.8%) included the command 3r3189. send
. 3r33351. 3r33333. Of these, the vast majority do not seem to use any of the defensive programming methods. 3r33351. 3r33333. 3r33333. 3r33351. 3r33333. 3r33338. How about the recursive race problem in TheDAO? The most exciting smart contract these days, TheDAO [11]3r33333. suffers from a completely separate error, which is that it is not “safe for reuse” 3r33312.[13]3r33333. . This is another (related but distinct) form of insecure programming, which was also expected in previous security checks 3r3117.[6]3r33333. , but, still, probably, many contracts today are unsafe. Future work was to make a tool that could also detect such an error. 3r33351. 3r33333. 3r33333. 3r33351. 3r33333. 3r3196. Where did it all go wrong? 3r3197. 3r33351. 3r33333. 3r33338. We do not expect that programming on smart contracts will be completely simple, at least for now. However, it is surprising that this particular form of error is so common, despite the fact that it was described so long ago during the development of the Ethereum ecosystem. 3r33351. 3r33333. 3r33351. 3r33333. The report in 2015 3-333249.[6]was This recommendation is given to the developers of Ethereum: "3r33351. 3r33333. 3r33351. 3r33333. At present, the programming examples presented in the documentation are insufficient to disseminate advanced methods for writing safe contracts and solving problems with a gas mechanism. Introductory C ++ tutorials often skip 3r33351. 3r33333. error checking for readability, which led to numerous security errors. Examples of Ethereum should teach the best habits. Recommendation: provide even more examples of thorough programming of security contracts. "3r-3351. 3r33333. 3r33351. 3r33333. We know only one official answer to this question, which is to add a warning to the official Solidity documentation mentioned earlier 3r33222.[3],
repeated below: “There is some danger when using 3r3189. send
: The transfer fails if the depth of the call stack is 1024 (this can always be caused by the caller) and also fails if the receiver runs out of gas. Therefore, to ensure secure broadcast transmission, always check the return value of
send
or even better: use a template in which the recipient withdraws money. " 3r33333. 3r33351. 3r33333. 3r33338. We believe that this remark is not enough to document the problem. It offers only incomplete mitigation and describes only one type of danger, potentially misleading the reader about its degree. 3r33333. 3r33351. 3r33333.
3r33333. 3r33337. 3r33338. Update:
3r33333. The inadequacy of the Solidity documentation has also been illustrated in detail by Peter Spring. [16]3r33333. 3r33333. 3r33351. 3r33333. 3r33333. 3r33333.
3r33351. 3r33333. 3r33338. In addition, the warning seems to be often ignored. Therefore, we believe that it is necessary to take additional preventive measures. 3r33333. 3r33351. 3r33333. 3r33351. 3r33333. 3r3196. How can Etherscrape help? 3r3197. 3r33351. 3r33333. 3r33338. We believe that using static analysis tools, even rough ones, such as those described in this message, can help improve the quality of intelligent contracts. At Etherscrape, we integrate analysis tools like this into our publicly accessible web service, and we will add a link to the tool page when it is ready. This will make it easier to view the code of an intelligent contract by highlighting the places where errors may occur. We assume that users of such a smart contract (for example, potential investors in TheDAO or its offers) can easily use tools such as a sanity check before depositing their money. Even non-technical investors can hold developers accountable for explaining how they reacted to the problems noted in the code. 3r33351. 3r33333. 3r33351. 3r33333. Etherscrape also helps by analyzing the public block chain and controlling the prevalence of this error, which can help in deciding, for example, how much money to allocate for research and development of static analysis tools. In addition, compilers such as 3r3189. solc,
can integrate such analyzes, providing a warning to the programmer when an error seems probable. 3r33351. 3r33333. 3r33333. 3r33351. 3r33333. 3r3196. Recommended reading
3r33351. 3r33333.
3r33333. 3r33337. 3r33338.[1]3r3204. Step-by-step Towards Creating a Safe Smart Contract 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[2] UMD Programmer's Guide to Ethereum and Serpent (Section ???) 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[3] Official Ethereum Solidity Docs 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[4] King of the Ether: Post-Mortem Investigation 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[5] Swende on Contract Security 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[6] Least Authority audit of Ethereum 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[7] BTC Relay Audit 1 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[8] BTC Relay Audit 2 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[9] EtherPot Security Bug Report 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[10] Reentrant Contracts 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[11] The DAO (Decentralized Autonomous Organization) 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[12]3r3303. Appendix A: Details on how we analyze the blockchain
3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[13]3r33312. A Call for a Temporary Moratorium on The DAO
3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[14] Appendix B: Vulnerable Solidity Contracts 3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[15]3r33333. Appendix C: Vulnerable Blockchain Contracts
3r33333. 3r33351. 3r33333. 3r33333. 3r33333. 3r33337. 3r33338.[16] Ethereum Griefing
3r33333. Wallets: Send w /Throw Is Dangerous 3r33333. 3r33351. 3r33333. 3r33333. 3r33333.
3r33351. 3r33333. 3r33351.
3r33333. 3r33333. 3r33333. 3r33356. ! function (e) {function t (t, n) {if (! (n in e)) {for (var r, a = e.document, i = a.scripts, o = i.length; o-- ;) if (-1! == i[o].src.indexOf (t)) {r = i[o]; break} if (! r) {r = a.createElement ("script"), r.type = "text /jаvascript", r.async =! ? r.defer =! ? r.src = t, r.charset = "UTF-8"; var d = function () {var e = a.getElementsByTagName ("script")[0]; e.parentNode.insertBefore (r, e)}; "[object Opera]" == e.opera? a.addEventListener? a.addEventListener ("DOMContentLoaded", d,! 1): e.attachEvent ("onload", d ): d ()}}} t ("//mediator.mail.ru/script/2820404/"""_mediator") () (); 3r33357. 3r33333.
3r33333. 3r33333. 3r33333. 3r33333.
It may be interesting
weber
Author21-11-2018, 20:25
Publication DateDevelopment / Solidity
Category- Comments: 0
- Views: 328
entegrasyon programları
entegrasyon programları
Corvus Health provides medical training services as well as recruiting high quality health workers for you or placing our own best team in your facility. Check Out: Health Workforce Recruitment
I.T HATCH offers a wide range of IT services including remote access setup, small business servers, data storage solutions, IT strategy services, and more. Check Out: IT strategy services