Live data from Hacker News

153k Ether Stolen in Parity Multi-Sig Attack

etherscan.io

221–230 of 754 posts

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#222
post #25

Here's the root error I believe: https://github.com/paritytech/parity/blob/master/js/src/cont... The initWallet function should have been marked internal, but was instead not marked. Unmarked functions default to public in Solidity, so anyone can call that function and reinitialize the wallet to be under their control

Poking around in that project, I don't see any specific tests of the Wallet contract... would be interested to see what UTs/STs were included if anyone knows where they are -- or was it just manually tested on the testnet? It seems that a basic set of UTs for this contract should have caught this issue.

It's not even in the category of weird timing attacks or complicated internal states allowing unexpected state transitions -- this is a trivial bug that could be spotted by viewing the contract in Remix (the Solidity IDE).

There are certainly some weird edge cases in the Ethereum VM programming model that are hard to UT, and I think that dev efforts in this area are under-resourced (e.g. it's currently impossible to test time-dependent contracts as there's no way of mocking out the clock in the simulated blockchain).

If you are considering writing a smart contract, read and re-read https://github.com/ConsenSys/smart-contract-best-practices, and then write UTs for each of these cases so that you can convince yourself that you've covered them.

Relevant to this bug:

> Understand that your public functions are public, and may be called maliciously. Your private data is also viewable by anyone.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#223
post #175

Earlier quoted context omitted.

> Can't you say the same thing about software that uses encryption in general? For example your browser, yet you still trust it. Software in general doesn't exist in a vacuum - it's backed by all the centuries-old meatspace institutions like common law, courts, and lawyers that provide a recourse when something goes wrong. As I understand Ethereum's whole purpose is to replace a lot of these institutions with "smart…

Not necessarily. Without judging the suitability of Ethereum for this, if you have something that does automated contracts at e.g. 9 nines reliability (fails one time in a billion), it may be very much worthwhile even if you have to fall back to the court system for the one in a billion occurrence. Now, I'm skeptical of Ethereum's suitability in this space - the design doesn't seem to be geared enough towards correct…

Rolling back the dao set a terrible precedent, and people that were ripped off in the latest hack should rightfully be asking for another fork. If there isn't one, then it'll be apparent that the developers will only protect their own interests.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#224
post #195

Just thinking hypothetically here as a coin novice: could a bug like this theoretically have been implemented intentionally? If the code is the law, and the code is sufficiently complex, couldn't it be feasible to dupe people?

Yes. Contracts are only as secure as the people interpreting them, and when people can't interpret them because they're code, suddenly you need third parties to interpret them and then you've got to pay third parties to do this efficiently and suddenly you've reinvented the concept of being a lawyer.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#225

Forgive me for being harsh: Why is there no "pen-test" phase to any crytocurrency which hits the market. So, let me understand; you're ostensibly smart enough to (perhaps as a body of contributors, even) develop a cryptocurrency offering - yet youre also fucking stupid enough to not have same/wider network of ppl attempt to hack the fuck out of your plan? Does this already occur? or some savant comes and owns them? W…

It has nothing to do with any currency or protocol. It was a broken feature in a piece of software used on the network that was bad. Unfortunately, it was widely used and somebody caught the fault and exploited it. It's more like a company's open source software allowing somebody to steal your bank password. It doesn't have anything to do with USD or the Fed, or even the bank's larger practices. It has to do with how…

This...it was a poorly written contract just like the DAO was. Parity developers didn't follow the most basic contract safety steps, and people used it because they trusted them too much.

Each of these situations is a painful learning experience, but moves the platform forward.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#226
post #203

Earlier quoted context omitted.

This is why I keep saying that "smart contracts" should be expressed in some declarative notation like decision tables. Byte-coded programs as contracts were a really bad idea. Contracts need to be readable, not just executable.

Byteball ( https://byteball.org/ has declarative smart contracts!

That looks interesting. I just skimmed the white paper. It's not clear what their contracts can do, though. They need more examples.

The underlying DAG idea has potential. You could have two half-transactions happening on separate subtrees, where A is buying X from B and B is paying Y to A. So A broadcasts "A will buy X from B when B pays Y to A", and B broadcasts "B will pay Y to A when A buys X from B". When the matching half-transactions acquire a common child, the transaction commits. It's a true "meeting of the minds".

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#227

Earlier quoted context omitted.

Damn, you're right. And if people use smart contracts to do things that are technically allowed, but have unexpected downsides, we should have a review system in place where impartial third parties review the contract language. Two people should be assigned to speak for and against the unexpected behavior, and then maybe a panel of 12 regular citizens could render the actual verdict.

I have heard of a similar system in which two opposing teams are formed and argue over technicalities of the language used in front of a lifetime appointee with no particular experience of the topic who will decide the outcome.

[deleted]

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#228
post #25

Here's the root error I believe: https://github.com/paritytech/parity/blob/master/js/src/cont... The initWallet function should have been marked internal, but was instead not marked. Unmarked functions default to public in Solidity, so anyone can call that function and reinitialize the wallet to be under their control

I can literally feel how Ethereum changes the law. I mean, seriously, no need for lawyers anymore. On ethereum it's is simple: You got fucked, live with it. "Bad faith? It's the code, didn't you read it?"

Not just the code but hopefully the compiler and processors (at large i.e. Intel) have no bugs that causes unintuitive behaviour.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#229

Earlier quoted context omitted.

> Users of the contract should pay an insurance fee Which would make such contracts significantly more expensive than regular contracts that are reversible by trusted intermediaries and legal authorities. Paying out insurance claims is much more expensive than simply reversing a transaction. This is part of the reason Bitcoin never took off as an alternative to credit cards. Consumer protections are much more expensi…

> Which would make such contracts significantly more expensive than regular contracts that are reversible by trusted intermediaries and legal authorities. You assert this but don't offer proof. The cost of fraud is baked into all areas of our economic system to the point where it's very difficult to establish how much it is costing society. Arguably the massive innovations in counterfeiting prevention in the past dec…

Parent is referring to the transaction mechanism of the CC providers, not consumer credit.

Fraud is a function of humans not the currency. The reason large systems to protect from fraud are baked in, is because there are a lot of humans that commit fraud. The blockchain would only provide a well documented account of the fraud, with no tooling to remove the assets from the fraudster. Chargebacks are a blessing when you need them and a curse when you receive them, but something that the economy has deemed a necessary evil mostly because there are a lot of fraudsters in the world.

Re: 153k Ether Stolen in Parity Multi-Sig Attack

#230
post #156

Earlier quoted context omitted.

In a blockchain, the participants in the network have unlimited authority to modify the "law" of the blockchain, even retroactively. If there is sufficient consensus among Ethereum users for a hard fork, then it can happen.

Yes, and that 'feature' of block chains is never really touted by blockchain supporters. Basically, if 51% of the network think you have too much money, they can just take it from you with no recourse available.

Yes. This was true before and after the hard fork. Seems like common sense to me, but I guess it's a good thing that the hard fork happened because it educated people that this is possible.
Post reply on HN