Miggo Logo

CVE-2022-44797:
btcd mishandles witness size checking

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.39046%
CWE
-
Published
11/7/2022
Updated
5/20/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/lightningnetwork/lndgo< 0.15.2-beta0.15.2-beta
github.com/btcsuite/btcdgo< 0.23.20.23.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The commit diff shows the witness size check was modified in wire/msgtx.go's BtcDecode method. The vulnerability stemmed from enforcing SegWit v0-era witness size limits (11KB) at the wire parsing layer, while the correct approach is to handle this at the transaction validation layer with higher limits (~4MB). The Go vulnerability database (GO-2022-1098) explicitly lists MsgTx.BtcDecode as an affected symbol, and the patch increases maxWitnessItemSize to 4MB in this function's context.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*t** ***or* *.**.*, *s us** in Li**tnin* L**s ln* ***or* *.**.*-**t* *n* ot**r *it*oin-r*l*t** pro*u*ts, mis**n*l*s witn*ss siz* ****kin*. ### Sp**i*i* *o P**k***s *****t** *it*u*.*om/*t*suit*/*t**/wir*

Reasoning

T** *ommit *i** s*ows t** witn*ss siz* ****k w*s mo*i*i** in `wir*/ms*tx.*o`'s `*t****o**` m*t*o*. T** vuln*r**ility st*mm** *rom *n*or*in* S**Wit v*-*r* witn*ss siz* limits (**K*) *t t** wir* p*rsin* l*y*r, w*il* t** *orr**t *ppro*** is to **n*l* t*