Описание
Consensus flaw during block processing in github.com/ethereum/go-ethereum
Impact
A consensus-vulnerability in Geth could cause a chain split, where vulnerable versions refuse to accept the canonical chain.
Description
A flaw was repoted at 2020-08-11 by John Youngseok Yang (Software Platform Lab), where a particular sequence of transactions could cause a consensus failure.
-
Tx 1:
sender
invokescaller
.caller
invokes0xaa
.0xaa
has 3 wei, does a self-destruct-to-selfcaller
does a1 wei
-call to0xaa
, who thereby has 1 wei (the code in0xaa
still executed, since the tx is still ongoing, but doesn't redo the selfdestruct, it takes a different path if callvalue is non-zero)
-
Tx 2:
sender
does a 5-wei call to 0xaa. No exec (since no code).
In geth, the result would be that 0xaa
had 6 wei
, whereas OE reported (correctly) 5
wei. Furthermore, in geth, if the second tx was not executed, the 0xaa
would be destructed, resulting in 0 wei
. Thus obviously wrong.
It was determined that the root cause was this commit from this PR. The semantics of createObject
was subtly changd, into returning a non-nil object (with deleted=true
) where it previously did not if the account had been destructed. This return value caused the new object to inherit the old balance
:
It was determined that the minimal possible correct fix was
Patches
See above. The fix was included in Geth v1.9.20
"Paragade".
Credits
The bug was found by @johnyangk and reported via bounty@ethereum.org.
For more information
If you have any questions or comments about this advisory:
- Open an issue in go-ethereum
- Email us at security@ethereum.org
Ссылки
- https://github.com/ethereum/go-ethereum/security/advisories/GHSA-xw37-57qp-9mm4
- https://nvd.nist.gov/vuln/detail/CVE-2020-26265
- https://github.com/ethereum/go-ethereum/pull/21080
- https://github.com/ethereum/go-ethereum/pull/21409
- https://github.com/ethereum/go-ethereum/commit/87c0ba92136a75db0ab2aba1046d4a9860375d6a
- https://github.com/ethereum/go-ethereum/releases/tag/v1.9.20
- https://pkg.go.dev/vuln/GO-2021-0105
Пакеты
github.com/ethereum/go-ethereum
>= 1.9.4, < 1.9.20
1.9.20
Связанные уязвимости
Go Ethereum, or "Geth", is the official Golang implementation of the Ethereum protocol. In Geth from version 1.9.4 and before version 1.9.20 a consensus-vulnerability could cause a chain split, where vulnerable versions refuse to accept the canonical chain. The fix was included in the Paragade release version 1.9.20. No individual workaround patches have been made -- all users are recommended to upgrade to a newer version.
Go Ethereum, or "Geth", is the official Golang implementation of the E ...