92 points · by sahin · 8y ago · 61 comments
Related, here's an unfixed btcd (Go Bitcoin client) DoS [2].
[1] https://bugs.chromium.org/p/oss-fuzz/issues/list?q=imagemagi...
The problem with Bitcoin is that any vulnerability can usually be exploited very easily for huge gains. You have a DDoS? Short BTC, run it, make millions. Remote code execution in the client? Steal funds, make millions. Easy and untraceable if you're careful. That's the whole drawback of the immutable ledger approach, if you get screwed the only solution is to convince everybody else to do a hardfork. If you're a bitcoin billionaire with relations in the big bitcoin shops you could get it to work, if you're a rando with a dozen bitcoins stolen from your account you're on your own.
Even something as bad as heartbleed seems almost benign in comparison since it's significantly harder to exploit, especially at a large scale.
I personally pondered if this particular issue would have any market effects and concluded that it would not substantially. This is based on fact that there's altcoins in existence with > 800 day consensus level failures disclosed privately, or publicly known, which still have reasonably active trading. Some altcoins manage to exist with almost no operational network at all, just a pool, a node or two run by the creator, and an exchange with substantial internal volume and not a lot else.
For altcoins in particular it's difficult to actually know if this is representative of what would happen in Bitcoin, some of the issues I'm aware of in altcoins simply haven't been exploited because there's not enough profit in it at the moment, even though the design decisions in these altcoins (eg, facets of proof of stake) are then used to justify the safety of other systems.
In a healthy market, assets that do not deliver on their most basic premise should trade down to zero eventually.
Usually, if one person gets screwed (by no fault of their own), that means everyone else could also get screwed the same way, so it's not that hard to convince people to hard-fork.
https://github.com/bitcoin/bitcoin/pull/14249/files
checkTransaction is defined in verify.cpp:
https://github.com/bitcoin/bitcoin/blob/master/src/consensus...
The last argument, fCheckDuplicateInputs, causes inputs to be checked for duplicates. A comment inside this method notes:
// Check for duplicate inputs - note that this check is slow so we skip it in CheckBlock
To summarize, the fix appears to replace the faster call to checkTransaction in CheckBlock with the slower version that checks for duplicate inputs in each transaction of a new block. What's not clear to me yet is how failure to check for duplicate inputs in a block's transactions leads to DoS.
Many consider Bitcoin Core to define the Bitcoin protocol. If this is true, then the new release can be considered a soft fork update.
Previously, blocks containing transactions with duplicate inputs would have been considered valid. Now, such a block will be rejected by patched nodes.
This case is an excellent example of how difficult it is to determine what exactly the Bitcoin protocol actually requires.
We only gradually "discover" the protocol by exhaustively following every branch of the Bitcoin Core code base.
No, they would have crashed the node, they would not have been accepted as valid. This is not a soft fork.
A softfork is a change to the bitcoin protocol wherein only previously valid blocks/transactions are made invalid. ...
https://en.bitcoin.it/wiki/Softfork
It's not clear to me yet under what conditions a node would crash. With a single duplicate input? With dozens of duplicate inputs? Duplicate inputs spending segwit outputs?
If some duplicate inputs would have been permitted without crashing nodes then the update appears to fit the definition of soft fork.
edit: also, it appears the DoS vuln doesn't apply to pre-0.14 nodes. Either those nodes would have rejected dup-input blocks (making 0.14 a hard fork?) or the update just released could be seen as a soft fork.
Therefore fixing the crash is not a "soft fork* because nothing was accepted in the first place.
Yes, if it actually accepted the duplicate input, that would cause unlimited inflation, which is obviously a huge deal.
Or in other words. We got extremely lucky.
If this were the case it would be a complete failure of the system, rather than a DoS.
A state-actoru, could certainly burn that, and much more.
Some exchanges would probably have gone offline for a few hours.
Nobody would have lost any money or bitcoins.
That's not entirely true. The current crop of Lightning Network nodes rely on their host being up for the safety of their channels. If their node is not contactable for more than 24 hours they risk having their money stolen.
Large changes in the network graph has been shown in Bitcoin to take quite a while to sort out, due to the way the rumoring network attempts to find stable and reliable peers. This is still a substantial problem now, as there's only a few thousand listening peers that can accept incoming connections out of over 10,000 total. If only those nodes were remaining online there would be substantially reduced capacity to relay blocks and transactions for a period.
This flaw alone isn't likely enable such an attack. Furthermore, most nodes will upgrade very quickly, greatly reducing the attack surface.
This requires no action other than pushing a specific binary to an unpatched node in order for it to crash.
The cost of producing the binary is one time, approximately $80k USD depending on luck.
Someone else in the thread pointed out that there is a way to get around the crashing node assert check, and instead create infinite inflation.
The bug is significantly more network destroying than what was previously thought, if this claim is true.
As such invalid blocks need to be mined anyway, only those willing to disregard block reward of 12.5BTC ($80,000) could actually do any real damage.
Do the blocks need to be mined twice? Or do you just have to submit a garbage block for the second one?
No. One transaction included twice in a single block.
The cost of the attack would far exceed ~80k USD in bitcoin block rewards because it requires a substantial amount of hashing power to have a realistic chance of successfully producing a block that reaches consensus and is added to the canonical chain.
No, the cost is simply $80k on average to find a block, or around $5k for BCash. If the cost to produce a block exceeded its value substantially, it would be on a whole unprofitable for Bitcoin miners to continue existing at this point in time (network difficulty, bitcoin price).
It's Bitcoin Cash.
https://medium.com/@jonaldfyookball/why-some-people-call-bit...
Then it would be a total cost of ~$160k with the loss of potential revenue.
> While this certainly seems unlikely (barring any digital Tyler Durden-types wanting to destroy something beautiful), it does raise eyebrows. The great defence of Bitcoin is that it’s far too decentralized to be brought down by any single entity.
Generic turmoil of the platform could panic selling. $80K to cause mass disruption could pay off considerably for someone shorting either bitcoin or an altcoin.
The most notable is Ethereum, with the DAO hack and the subsequent bailout. Did lead to Ethereum Classic, which is a fork that gained some traction.
The traditional markets attempt to assign a value to the expected future value of all (public) companies. As technology advances, goods and services can be produced and delivered more efficiently, allowing $1 to buy more. Investing in the stock market is using your money to drive the improvements, and selling your stock is reaping those rewards.
Bitcoin is just a list of financial transactions that a couple of different computers agreed on the order of.
I don't see how they are comparable.