29006 - [SC - Medium] Lack of Success check of the Timelock executeT...
Submitted on Mar 4th 2024 at 16:26:05 UTC by @HX000 for Boost | Puffer Finance
Report ID: #29006
Report type: Smart Contract
Report severity: Medium
Target: https://etherscan.io/address/0x3C28B7c7Ba1A1f55c9Ce66b263B33B204f2126eA#code
Impacts:
It will impact the functionality of the protocol and reduces the efficiency of an important role
Contract fails to deliver promised returns, but doesn't lose value
Description
Brief/Intro
In Timelock.sol the function executeTransaction() internally calls _executeTransaction() and directly emites the event TransactionExecuted() without checking if the execution succeeded or not.
Vulnerability Details
in the code executeTransaction() first checks to make sure the tx is valid then - to avoid any reentrancy risk - resets its spot in the queue which is the same effect for the cancelTransaction() function, And finally TransactionExecuted() event is emitted. The problem is, if the transaction failed for any reason(e.g., due to an invalid target contract address, out-of-gas in the called contract, or a revert in the called contract) , the tx will not revert. it will only return "false" which is never handled AND the side-effects still happening i.e queue[txHash] = 0; and emit TransactionExecuted(txHash, target, callData, operationId);
Impact Details
This bug will result in 2 impacts: 1- Distrub functionality of the operations_multisig who can not re-execute the failed/ canceled transaction unless re-queue it and stand the delay time again. 2- The wrong-emitted event can lead to bad consequences for any dapp/smart contract depending on those events.
Proof of Concept
Last updated