-
Notifications
You must be signed in to change notification settings - Fork 160
There may be bad data points in CommitStateDB when exec evm transaction with multi msgs #667
Comments
Actually there're 2 issues. Since they were fixed, we now release detailed info as follows: Storage Caching Lifecycle Inconsistency detailed vuln report: Affected Version: Vulnerability Overview: Details and Root Cause: First, we found some ground truth:
Clearly, 3a and 3b are not consistent with each other, thus, this is the root cause of the vulnerability. Steps to Exploit: The idea is triggering the vuln according to the idea of 3b, then expand the modification(e.g gain benefit) by accessing the compromised storage cache and stabilizing it in a 'success' tx, finally the previous modification was 'discard' when the block ends and the storage falls into an unreasonable state. e.g.:
Let's see what's happening here:
Credit to: OKLink & Chaitin Tech |
Contract Bytecode Wrongfully Stored in Failed Tx detailed vuln report: Affected Version: Vulnerability Overview: Details and Root Cause:
Thus, deploying a contract in a failed tx will end up with bytecode being written to persistent store but the Storage changes will not. In other words, adversary can manage to omit the execution of constructor. Steps to Exploit:
2.Broadcast it. Although the execution of this whole Tx fails, the bytecode of the contract is still written to the KVStore at the Endblock stage, and the Storage was not stored persistently. Credit to: OKLink & Chaitin Tech |
This issue is stale because it has been open 45 days with no activity. Remove |
Hi, Is there any plan to fix these issues? |
System info: [Include Ethermint commit, operating system name, and other relevant details]
Additional info: [Include gist of relevant config, logs, etc.]
The "storage" data from "CommitStateDB" are written to the "Store"(keeper) at the time of the "deliverTx"(handler) and are cleared at the "endBlock" stage.
The "code" data from "CommitStateDB" are written to the "Store"(keeper) and cleared at the "endBlock" stage.
If there are 2 msgs in a tx, in the deliverTx (handler) stage, where msg1 executes successfully and msg2 fails, then all store data(Keeper) will be rolled back. However, the storage data in commitStateDB and the code are still Reserved, if another tx2 is executed later in the deliverTx phase, the bad data points from tx1 will be used
The problem encountered is Similar to issue668,issue669
solution:
Multiple msgs are not allowed in one tx
Update and clear all cache data of commitStateDB in the handler phase
The text was updated successfully, but these errors were encountered: