TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Chasing the DAO Attacker’s Wake – A second exploit

194 pointsby freedaemonalmost 9 years ago

21 comments

DennisPalmost 9 years ago
As the article briefly suggests, this problem can be completely avoided if every method has no more than one external call and always puts it last.<p>I&#x27;m messing around with contracts to do about a dozen different things, and it turns out to be easy to meet this restriction, as long as I&#x27;m willing to design the UI accordingly. (E.g. don&#x27;t send money to lots of users in one step, just update their balances and make them call a withdraw function.)
评论 #11947143 未加载
评论 #11947195 未加载
评论 #11951956 未加载
评论 #11947519 未加载
评论 #11948391 未加载
Animatsalmost 9 years ago
So one contract can call a function in another contract, in the middle of their transaction:<p><pre><code> if (_recipient.call.value(_amount)()) { &#x2F;&#x2F; vulnerable </code></pre> That&#x27;s inherently a scary feature, and it was exploited.<p>Etherium&#x27;s &quot;Solidity&quot; suffers from the desire to have it be a general-purpose computer. It should have been if-then rules, or a logic tree, or a decision logic table - a finite representation of business logic subject to exhaustive case analysis. Contract executions should have been atomic transactions - either everything commits, or everything gets rolled back. Stack overflow and running-out-of-gas terminations are inherently trouble.<p>Etherium needs to go back into the shop for a redesign. At least we found out early that this isn&#x27;t going to work.
评论 #11937054 未加载
评论 #11936480 未加载
heliumcraftalmost 9 years ago
&quot;This impacts all contracts on Ethereum, not just the DAO. This is an issue with Ethereum’s JavaScript-like programming language (Solidity).&quot;<p>No it doesn&#x27;t, no it&#x27;s not. It affects contracts that use this functionality with arbitrary untrusted contracts (which is a bad idea), and most contracts just don&#x27;t use this functionality at all.
评论 #11947144 未加载
评论 #11947091 未加载
评论 #11947058 未加载
JulianMorrisonalmost 9 years ago
Isn&#x27;t this just a normal data race with stateful actors? Something modified the data while A is calling B (doesn&#x27;t have to be B, could be any X) in between a call and its response.<p>The answer to this is that mutation needs to be kept under control. Immutable data structures in mutable buckets. Locking around the data that mustn&#x27;t change. Deep copy all state before calling out. And so forth.<p>This is basically an understood problem and I&#x27;m a bit appalled that Ethereum didn&#x27;t build protection against it into their design.
评论 #11947167 未加载
评论 #11946809 未加载
mbrockalmost 9 years ago
I don&#x27;t understand &quot;you can&#x27;t assume anything about the state of the contract.&quot; Surely the contract&#x27;s state is only modified by the contract&#x27;s own code, which means you can assume that the state is not altered arbitrarily but only according to the rules set up by the contract. Yes, you need to be careful about external calls that make altering calls to you.
评论 #11946958 未加载
评论 #11946703 未加载
nawitusalmost 9 years ago
&quot;that impacts all of Ethereum&quot;<p>Well, all of Ethereum smart contracts which are written in Solidity and which use a &quot;call construct&quot; in a certain way.
homogeneousalmost 9 years ago
With all this fuss over ethereum security flaws, can someone explain to me the practical use case for these smart contracts? I just don&#x27;t understand where the benefit comes in. It seems like any type of contract that would be useful requires a human to qualify the meaning of the terms since these contracts cannot autonomously measure the state of the world.<p>Even something as trivial as betting on sports requires deference to a trusted authority to say &quot;this team won&quot;. What advantages does an ethereum smart contract provide over, say, some kind of trusted bitcoin escrow site?
评论 #11947312 未加载
评论 #11947356 未加载
评论 #11947199 未加载
评论 #11947181 未加载
thom_nicalmost 9 years ago
Interesting Ethereum uses the term &quot;function&quot; however in programming we understand a <i>pure</i> function to be an operation that always returns the same result given the same inputs.<p>I don&#x27;t know anything about Ethereum, but if functions rely on external shared state then they aren&#x27;t pure functions, are they?
评论 #11946994 未加载
评论 #11946841 未加载
评论 #11947035 未加载
refulgentisalmost 9 years ago
What if the DAO invested in short-selling Ethereum? 🤔🤑
评论 #11946978 未加载
评论 #11949333 未加载
评论 #11946640 未加载
saynseditalmost 9 years ago
Any code that calls arbitrary callbacks is prone to failure. The context in which a callback is called matters.<p>Calling a callback at the end of a method avoids interfering with the caller&#x27;s state but ignores the state of the caller&#x27;s caller.<p>An ethereum contract will only be tractably analyzable if it avoids dynamically invoking arbitrary callbacks.
woahalmost 9 years ago
None of these &quot;exploits&quot; really sound much more dramatic than using a database without transactions
评论 #11946725 未加载
int_19halmost 9 years ago
Given that trust is the single most critical aspect of the entire platform, why doesn&#x27;t it use languages (for both the platform, and the contracts), programs in which can be easily formally verified, and for which tools for such verification already exists?
boukalmost 9 years ago
Seems like this is what mutexes were invented for
评论 #11946988 未加载
评论 #11946771 未加载
IncRndalmost 9 years ago
Solidity is to Solid as Oracle is to Unbreakable.<p>These really are solved problems.
unfortunatefacealmost 9 years ago
The backers of the DAO selflessly created a $150 million bug bounty for Ethereum and their Smart Contract - Good for them.
评论 #11947177 未加载
htnsalmost 9 years ago
I&#x27;d be interested in knowing how this has been dealt with (or not) before. Was the problem recognized when designing E?
deeglesalmost 9 years ago
Will the attacker be able to spend any of the funds?
cel1nealmost 9 years ago
So what they should have implemented is communicating sequential processes &#x2F; actors instead of arbitrary calls.<p>The more I read about ethereum&#x27;s technical details, the more it sounds like a joke to me.
评论 #11946965 未加载
HoopleHeadalmost 9 years ago
Every article I see on etherium mentions the DAO. Not one of them explains what it means.<p>Gotta love unexplained acronyms!
评论 #11946786 未加载
评论 #11947532 未加载
评论 #11946802 未加载
评论 #11946787 未加载
niftichalmost 9 years ago
This reads a little sensational. The original source [1] referred to in the article looks at the issue in more detail.<p>[1] <a href="http:&#x2F;&#x2F;pdaian.com&#x2F;blog&#x2F;chasing-the-dao-attackers-wake&#x2F;" rel="nofollow">http:&#x2F;&#x2F;pdaian.com&#x2F;blog&#x2F;chasing-the-dao-attackers-wake&#x2F;</a>
评论 #11946959 未加载
评论 #11946812 未加载
AJ007almost 9 years ago
Nearly a year ago I made the comment --<p>&quot;Who are these people[1] and what credentials do they have to build and run a cryptocurrency platform?&quot; [1] <a href="https:&#x2F;&#x2F;angel.co&#x2F;ethereum-1" rel="nofollow">https:&#x2F;&#x2F;angel.co&#x2F;ethereum-1</a><p>Today, not a single cryptographer, mathematician, or anyone with software security experience is listed on the Ethereum Foundation member list[2]. I am not attacking any individuals by themselves, but as a group this says a lot.<p>For the record, what I see listed online today is a: consultant, magazine founder, a programmer, and a lawyer. On the advisory board a sales person, a psychologist, a leveraged debt consultant. On the &quot;special advisors&quot; list, which I have no idea what this means, maybe someone who answered a phone call a few times, one person with a bunch of business credentials, something &quot;fintech&quot; related with little explanation, and a tech CEO.<p>Maybe the Ethereum Foundation doesn&#x27;t need anyone with deep experience in cryptography and security?<p>[2] <a href="https:&#x2F;&#x2F;www.ethereum.org&#x2F;foundation" rel="nofollow">https:&#x2F;&#x2F;www.ethereum.org&#x2F;foundation</a>
评论 #11946839 未加载
评论 #11946774 未加载
评论 #11946966 未加载
评论 #11946856 未加载
评论 #11947038 未加载
评论 #11946916 未加载
评论 #11946934 未加载
评论 #11946813 未加载