Bitcoin Core Vulnerability (CVE-2024-35202) Enables Remote Node Crashes
A high-severity vulnerability, tracked as CVE-2024-35202 and assigned a CVSS v3.0 base score of 7.5, has been disclosed in the Bitcoin Core software. Exploitation of this vulnerability permits remote attackers to crash Bitcoin Core nodes running versions prior to v25.0.
The issue arises when Bitcoin Core attempts to reconstruct blocks received via cmpctblock messages. When Bitcoin nodes receive block announcements, they try to rebuild the announced block using transactions stored in their mempool, as well as other available transactions. If reconstruction fails due to missing data, the node sends a getblocktxn message to request the missing transactions from the peer that announced the block. In return, the peer is expected to send the requested transactions in a blocktxn message.
Bitcoin Core’s compact block protocol uses shortened transaction identifiers (short-ids) to reduce bandwidth usage. These short-ids are only 6 bytes in size, which increases the likelihood of collisions, where different transactions share the same short-id. In the event of such a collision, Bitcoin Core uses a fallback mechanism, requesting the full block to resolve the issue.
However, as explained in the disclosure, “Bitcoin Core will create an instance of PartiallyDownloadedBlock whenever a new compact block is received. If missing transactions are requested, the instance is persisted until the corresponding blocktxn message is processed“. The flaw occurs when a second blocktxn message is received for the same block, which triggers the FillBlock function twice, violating a core assumption in the code that this function is only called once. This results in a node crash.
Attackers don’t need luck to exploit CVE-2024-35202. They can deliberately include transactions in the blocktxn message that do not match the block’s merkle root, causing the node to crash. According to the disclosure, “An attacker does not need to get lucky by triggering a collision, as the collision handling logic can easily be triggered by simply including transactions in the blocktxn message that are not committed to in the block’s merkle root.”
This vulnerability highlights how even sophisticated and well-established systems like Bitcoin Core can be vulnerable to flaws in transaction processing protocols. A successful exploitation of this vulnerability could lead to denial-of-service attacks against Bitcoin Core nodes, disrupting the stability and functionality of the network.
The ability to remotely crash nodes presents a serious threat to Bitcoin’s decentralized network. While the crash doesn’t enable the attacker to compromise funds or steal data, it can cause significant disruptions, particularly if leveraged at scale. Nodes affected by this crash will need to restart, potentially leading to temporary gaps in transaction processing.
Bitcoin Core v25.0 has addressed the issue, and users are strongly encouraged to update their nodes to this version. The vulnerability was discovered and fixed by Niklas Gögge, who also submitted a patch to resolve the problem.