delvingbitcoin

Combined summary - CVE-2024-38365 public disclosure (btcd `FindAndDelete` bug)

Combined summary - CVE-2024-38365 public disclosure (btcd `FindAndDelete` bug)

The discussion delves into the intricacies of Bitcoin's scripting capabilities, specifically focusing on the potential to achieve outcomes similar to those facilitated by public key recovery without actually employing it.

The conversation touches upon the utility of opcodes such as OP_PICK and OP_ROLL for manipulating or inspecting the stack within the scriptCode, suggesting alternative approaches to addressing script-related vulnerabilities. This exploration points to a deeper understanding of Bitcoin's script execution mechanisms and identifies sophisticated methods for script manipulation that could have implications for network consensus and integrity. It raises concerns about how discrepancies in the handling of ECDSA signature lengths and dummy data by different versions of Bitcoin nodes could lead to vulnerabilities, especially given the behavior of pre-0.24.2 btcd peers in removing valid consensus signatures before verification.

A programmer has developed a Bitcoin Core unit test patch designed to generate specific transactions, highlighting hesitance to publicly share this information due to potential misuse by individuals with minimal technical skills. The intention is to initially share the patch privately to mitigate the risk of facilitating malicious activities, with considerations for broader disclosure at a later time. This approach underscores the balance between transparency and security in the dissemination of potentially sensitive information.

Public key recovery is presented as a valuable technique in cryptographic systems, enabling the derivation of a public key from a digital signature independently. Its application extends to creating scripts for signature verification, where it facilitates efficiency in data storage and transmission while enhancing security protocols. This method allows for the validation of transaction authenticity without direct exposure of the public key, offering advantages in environments where anonymity or identity protection is paramount.

Niklas Gögge and Antoine Poinsot have identified a critical flaw in Btcd software versions prior to 0.24.2, noting a deviation from legacy signature verification consensus rules established by Bitcoin Core. Their discovery centers on the removeOpcodeByData implementation in Btcd, which contrasts with the expected behavior of removing only exact matches of the signature being verified, potentially allowing for the exploitation of vulnerable nodes. This vulnerability, stemming from a 2014 commit meant to address a discrepancy highlighted by a new Bitcoin Core unit test, was reported to Olaoluwa Osuntokun, leading to collaborative efforts to resolve the issue. Acknowledged through a bug bounty, the resolution process involved detailed investigation, communication of findings, reservation of CVE identifiers, and the introduction of a covert fix in version 0.24.2 of the software. The responsible disclosure process exemplifies a comprehensive approach to identifying, communicating, and rectifying a significant security concern within the Bitcoin network.

Discussion History

0
AntoineP Original Post
October 10, 2024 09:02 UTC
1
October 10, 2024 23:22 UTC
2
October 11, 2024 06:47 UTC
3
October 11, 2024 19:13 UTC
4
October 12, 2024 09:22 UTC