Miggo Logo

CVE-2020-26241: Shallow copy bug in geth

6.5

CVSS Score
3.1

Basic Information

EPSS Score
0.4348%
Published
6/29/2021
Updated
1/30/2025
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/ethereum/go-ethereumgo>= 1.9.7, < 1.9.171.9.17

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the dataCopy precompile (0x00..04) performing a shallow copy of its input. The dataCopy.Run function in core/vm/contracts.go returns the input slice directly, creating a reference to the original EVM memory. When this memory is later overwritten (as described in the attack scenario), the return data becomes corrupted. The RunPrecompiledContract function in the same file exacerbated this by not making a defensive copy of the precompile's output before returning it. The combination of these two factors allowed memory aliasing to create consensus-critical discrepancies. The commit patched this by modifying gas handling and return data management patterns, though the direct fix for the shallow copy would require changes to dataCopy.Run or its consumers.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T*is is * *ons*nsus vuln*r**ility, w*i** **n ** us** to **us* * ***in-split w**r* vuln*r**l* no**s r*j**t t** **noni**l ***in. **t*’s pr*-*ompil** `**t**opy` (*t `*x**...**`) *ontr**t *i* * s**llow *opy on invo**tion. *n *tt**k*r *oul* *

Reasoning

T** vuln*r**ility st*ms *rom t** `**t**opy` pr**ompil* (*x**..**) p*r*ormin* * s**llow *opy o* its input. T** `**t**opy.Run` *un*tion in `*or*/vm/*ontr**ts.*o` r*turns t** input sli** *ir**tly, *r**tin* * r***r*n** to t** ori*in*l *VM m*mory. W**n t*