Not checking the return state of the calls in UTBExecutor::execute
can cause loss/locking of funds
#544
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-25
edited-by-warden
insufficient quality report
This report is not of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-01-decent/blob/011f62059f3a0b1f3577c8ccd1140f0cf3e7bb29/src/UTBExecutor.sol#L54
https://github.com/code-423n4/2024-01-decent/blob/011f62059f3a0b1f3577c8ccd1140f0cf3e7bb29/src/UTBExecutor.sol#L67
Vulnerability details
Impact
The function
UTBExecutor::execute
does not handle the return value of the callsrefund.call{value: amount}("")
andrefund.call{value: extraNative}("")
, which could lead to a loss of funds for users. This is because if the refund call fails, the contract does not revert the transaction, and the funds intended for refund remain in the contract.This behavior violates one of the protocol's invariants which is the prevention of the accumulation of funds in contracts other than UTBFeeCollector and DcntEth :
Proof of Concept
The issue lies in the following line of code:
In both calls, if the call to the refund address fails, the contract does not revert or handle the failure. This can result in the funds being unintentionally locked in the contract.
Tools Used
Manual review
Recommended Mitigation Steps
Check and handle the success state of the call :
Assessed type
call/delegatecall
The text was updated successfully, but these errors were encountered: