|
The fourth Bitcoin halving has been completed, and this decentralized system has been successfully running for 15 years. However, in 2018, a vulnerability in the Bitcoin Core client was disclosed, posing a direct threat to the stability of the Bitcoin system and being one of its biggest vulnerabilities. Today, let's introduce the client double-spend vulnerability disclosed on September 20, 2018, known as CVE-2018-17144.
What is Bitcoin Core?
Bitcoin Core, initiated by Satoshi Nakamoto, is considered the "orthodox" Bitcoin client and is currently the most widely used. This software can verify all transactions ever made on the blockchain and transfer funds.
What is CVE-2018-17144?
A highly serious vulnerability exists in versions 0.14 to 0.16.2 of Bitcoin Core, which can cause the program to crash and result in double-spending issues. In other words, one transaction input can be outputted multiple times, leading to unlimited issuance, disrupting the consensus of Bitcoin's total supply of 21 million coins and causing inflation. It was later publicly documented as CVE-2018-17144.
Why did this vulnerability occur?
This can be traced back to 2016. Although the vulnerability was discovered in 2018, the groundwork was laid in 2016 when a developer proposed to Bitcoin Core a merge hoping to remove redundant input checks during transaction verification, saving about 600 microseconds. The merge was subsequently approved, setting the stage for the vulnerability.
In the 0.14.x version, this vulnerability was officially introduced into the client code. If fully exploited, it would cause the client receiving the broadcast to crash, but it would not affect the on-chain data. Other clients could discard the broadcast from the attacking node, and triggering this attack would require the attacker to discover a block, which comes at a very high cost and would only cause some clients to crash without generating profits for the attacker.
It wasn't until the release of version 0.15 in September 2017 that developers optimized the structure of the UTXO database, inadvertently allowing the client to continue operating in the event of duplicate inputs, opening the possibility for double spending.
How was the vulnerability discovered?
After the release of version 0.15, it wasn't until September 17, 2018, that the vulnerability was discovered. For a year, no one noticed it until BCH developer awemany, sitting in a small van by the sea at noon, found a comment in the BCH code repository stating "Check for duplicate inputs — note that this check is slow so we skip it in CheckBlock." Awemany felt something was wrong, tested duplicate inputs in regtest mode, and received a direct prompt "Wham! assert(), Aborted." He realized that this could be exploited, leading to inflation and the risk of chain split. He then wrote, "BitcoinABC does not check for duplicate inputs when processing a block, only when inserting a transaction into the mempool. This is dangerous as blocks can be generated with duplicate transactions and then sent through e.g. compact block missing transactions and avoid hitting the mempool, creating money out of thin air." He immediately reported the vulnerability and fix patch to Bitcoin Core and Bitcoin ABC (BCH development team). In his retrospect, after submitting the patch, he breathed a sigh of relief. He had discovered a vulnerability worth millions of dollars, which could have a huge impact on a currency worth $100 billion (now $1.2 trillion). In fact, he could have rented hash power to short BTC and become rich overnight, but he chose to report the vulnerability. At 21:58 on the same day, Bitcoin ABC released the patch, fixed the vulnerability, and sent the message to the majority of nodes, urging them to upgrade. After most nodes completed the upgrade, the vulnerability was fully disclosed.
However, the impact was not limited to Bitcoin and BCH. Various forked versions of Bitcoin Core, such as altcoins, were also affected by this vulnerability. Because this vulnerability was merged by the Bitcoin Core team, many people criticized the Bitcoin Core team.
Due to a 600-microsecond change, the double-spend vulnerability lurked on the chain for a year. If this vulnerability had been exploited, it could have led to a hard fork. Would Bitcoin's price still be what it is now? Would it have given rise to another ETC, as Ethereum did during its hard fork years ago? |
|