Consensus flaw during block processing in github.com/ethereum/go-ethereum
Published 29 Jun 2021 · Updated 10 Sept 2026
Is your project on an affected github.com/ethereum/go-ethereum?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- >=1.9.4 <1.9.20
- Fixed in
- 1.9.20
go get github.com/ethereum/go-ethereum@v1.9.20Details
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:
senderinvokescaller.callerinvokes0xaa.0xaahas 3 wei, does a self-destruct-to-selfcallerdoes a1 wei-call to0xaa, who thereby has 1 wei (the code in0xaastill 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:
senderdoes 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:
func (s *StateDB) CreateAccount(addr common.Address) {
newObj, prev := s.createObject(addr)
if prev != nil {
newObj.setBalance(prev.data.Balance)
}
}It was determined that the minimal possible correct fix was
+++ b/core/state/statedb.go
@@ -589,7 +589,10 @@ func (s *StateDB) createObject(addr common.Address) (newobj, prev *stateObject)
s.journal.append(resetObjectChange{prev: prev, prevdestruct: prevdestruct})
}
s.setStateObject(newobj)
- return newobj, prev
+ if prev != nil && !prev.deleted {
+ return newobj, prev
+ }
+ return newobj, nilPatches
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](mailto:security@ethereum.org)
Is GHSA-xw37-57qp-9mm4 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/ethereum/go-ethereum, and gives you the command that fixes it.
More advisories for github.com/ethereum/go-ethereum
- LowCVE-2026-26314Go Ethereum affected by crash via malicious p2p message in github.com/ethereum/go-ethereum · 24 Feb 2026
- LowCVE-2026-26313Go Ethereum affected by DoS via malicious p2p message in github.com/ethereum/go-ethereum · 24 Feb 2026
- LowCVE-2026-26315Go Ethereum Improperly Validates the ECIES Public Key in RLPx Handshake in github.com/ethereum/go-ethereum · 24 Feb 2026
- MediumCVE-2026-26315Go Ethereum Improperly Validates the ECIES Public Key in RLPx Handshake · 18 Feb 2026
- HighCVE-2026-26314Go Ethereum affected by DoS via malicious p2p message · 18 Feb 2026
- MediumCVE-2026-26313Go Ethereum affected by DoS via malicious p2p message · 18 Feb 2026
References
- Linkgithub.com/ethereum/go-ethereum/security/advisories/GHSA-xw37-57qp-9mm4
- Advisorynvd.nist.gov/vuln/detail/CVE-2020-26265
- Linkgithub.com/ethereum/go-ethereum/pull/21080
- Linkgithub.com/ethereum/go-ethereum/pull/21409
- Linkgithub.com/ethereum/go-ethereum/commit/87c0ba92136a75db0ab2aba1046d4a9860375d6a
- Packagegithub.com/ethereum/go-ethereum
- Linkgithub.com/ethereum/go-ethereum/releases/tag/v1.9.20
- Linkpkg.go.dev/vuln/GO-2021-0105
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.