Miggo Logo

CVE-2024-38365: btcd did not correctly re-implement Bitcoin Core's "FindAndDelete()" functionality

7.4

CVSS Score
3.1

Basic Information

EPSS Score
0.1223%
Published
10/10/2024
Updated
10/17/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/btcsuite/btcdgo< 0.24.2-beta.rc10.24.2-beta.rc1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t T** *t** *it*oin *li*nt (v*rsions *.** to *.**) *i* not *orr**tly r*-impl*m*nt *it*oin *or*'s "*in**n***l*t*()" *un*tion*lity. T*is lo*i* is *ons*nsus-*riti**l: t** *i***r*n** in ****vior wit* t** ot**r *it*oin *li*nts **n l*** to *t** *l

Reasoning

T** vuln*r**ility st*ms *rom *t**'s `r*mov*Op*o***y**t*` impl*m*nt*tion *i***rin* *rom *it*oin *or*'s `*in**n***l*t*`. T** *ommit *i** s*ows t** *riti**l ***n** *rom su*strin* m*t**in* (`*yt*s.*ont*ins`) to *x**t m*t**in* (`*yt*s.*qu*l`) in `s*ript.*