btcd did not correctly re-implement Bitcoin Core's "FindAndDelete()" functionality
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- None · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub.
Summary
btcd is an alternative full node bitcoin implementation written in Go (golang). The btcd Bitcoin client (versions 0.10 to 0.24) did not correctly re-implement Bitcoin Core's "FindAndDelete()" functionality. This logic is consensus-critical: the difference in behavior with the other Bitcoin clients can lead to btcd clients accepting an invalid Bitcoin block (or rejecting a valid one). This consensus failure can be leveraged to cause a chain split (accepting an invalid Bitcoin block) or be exploited to DoS the btcd nodes (rejecting a valid Bitcoin block). An attacker can create a standard transaction where FindAndDelete doesn't return a match but removeOpCodeByData does making btcd get a different sighash, leading to a chain split. Importantly, this vulnerability can be exploited remotely by any Bitcoin user and does not require any hash power. This is because the difference in behavior can be triggered by a "standard" Bitcoin transaction, that is a transaction which gets relayed through the P2P network before it gets included in a Bitcoin block. `removeOpcodeByData(script []byte, dataToRemove []byte)` removes any data pushes from `script` that contain `dataToRemove`. However, `FindAndDelete` only removes exact matches. So for example, with `script = "<data> <data||foo>"` and `dataToRemove = "data"` btcd will remove both data pushes but Bitcoin Core's `FindAndDelete` only removes the first `<data>` push. This has been patched in btcd version v0.24.2. Users are advised to upgrade. There are no known workarounds for this issue.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| btcsuite | btcd | 0.10.0 to before 0.24.2 | 0.24.2 | Patch available | CNA |
| — | github.com/btcsuite/btcd (Go) | before 0.24.2-beta.rc1 | 0.24.2-beta.rc1 | Patch available | GHSA-27vh-h6mc-q6g8 |
- btcd Vendorbtcsuite Affected 0.10.0 to before 0.24.2 Fixed in 0.24.2 Patch available CNA
- github.com/btcsuite/btcd (Go) Vendor— Affected before 0.24.2-beta.rc1 Fixed in 0.24.2-beta.rc1 Patch available GHSA-27vh-h6mc-q6g8
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:btcd_project:btcd:*:*:*:*:*:*:*:* | 0.10.0 to before 0.24.2 | Vulnerable | Btcd Project |
- cpe:2.3:a:btcd_project:btcd:*:*:*:*:*:*:*:* Versions 0.10.0 to before 0.24.2 Vulnerable ·Btcd Project
Remediation
- Fix · CNA btcd (btcsuite) Fixed in 0.24.2
- Fix · GHSA-27vh-h6mc-q6g8 github.com/btcsuite/btcd (Go) Fixed in 0.24.2-beta.rc1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-38365
- 2026-10-03 Alias added: GHSA-27vh-h6mc-q6g8
References
Advisory 2
More Btcd Project Btcd vulnerabilities
- TI-2022-18763 Witness Block Parsing DoS Vulnerability in lnd CVSS 3.1HIGH 8.2
- TI-2022-22062 btcd before 0.23.2, as used in Lightning Labs lnd before 0.15.2-beta and other… CVSS 3.1CRITICAL 9.8
- TI-2024-22808 btcd before 0.24.0 does not correctly implement the consensus rules outlined in BIP 68… CVSS 3.1HIGH 7.5
- TI-2018-12252 Bitcoin Core 0.16.x before 0.16.2 and Bitcoin Knots 0.16.x before 0.16.2 allow remote… CVSS 3.1HIGH 7.5
Sources
- CVE-2024-38365 · CVE Program
- CVE-2024-38365 · NVD
- FIRST EPSS
- GHSA-27vh-h6mc-q6g8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences