CVE-2024-38365: btcd did not correctly re-implement Bitcoin Core's "FindAndDelete()" functionality
7.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.1223%
CWE
Published
10/10/2024
Updated
10/17/2024
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/btcsuite/btcd | go | < 0.24.2-beta.rc1 | 0.24.2-beta.rc1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from btcd's removeOpcodeByData implementation differing from Bitcoin Core's FindAndDelete. The commit diff shows the critical change from substring matching (bytes.Contains) to exact matching (bytes.Equal) in script.go. This matches the advisory's description of the vulnerability where btcd removed partial matches while Bitcoin Core required exact matches. The function's role in signature validation (modifying scriptCode for sighash) directly impacts consensus-critical behavior.