CVE-2024-38365
btcd did not correctly re-implement Bitcoin Core's "FindAndDelete()" functionality
Also known as GHSA-27vh-h6mc-q6g8, GO-2024-3189
Mitigation
- Upgrade github.com/btcsuite/btcd to 0.24.2-beta.rc1 or later.
Who should check
- Projects that depend on Go package github.com/btcsuite/btcd (< 0.24.2-beta.rc1)
- Anyone running btcsuite btcd >= 0.10.0, < 0.24.2
Vulnerability facts
- Affected
- github.com/btcsuite/btcd < 0.24.2-beta.rc1
- Fixed in
- 0.24.2-beta.rc1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.4 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: High
- Availability impact: High
- EPSS
- 1.23% chance of exploitation in 30 days (percentile 69, 2026-11-26)
- CWE
- CWE-670
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Go github.com/btcsuite/btcd | < 0.24.2-beta.rc1 | 0.24.2-beta.rc1 | osv |
| btcsuite btcd | >= 0.10.0, < 0.24.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-38365. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-38365.md Affected: github.com/btcsuite/btcd < 0.24.2-beta.rc1 Fixed in: 0.24.2-beta.rc1 Steps: 1. Search this machine and project for github.com/btcsuite/btcd (Go), btcsuite btcd: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2024-38365 being exploited?
There is no confirmed exploitation: CVE-2024-38365 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.23% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-38365?
High: CVSS 7.4 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2024-38365?
github.com/btcsuite/btcd < 0.24.2-beta.rc1.
Is there a fix for CVE-2024-38365?
Yes. Fixed in 0.24.2-beta.rc1. Upgrade github.com/btcsuite/btcd to 0.24.2-beta.rc1 or later.
How do I check if I'm affected by CVE-2024-38365?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.