-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return value of low level call
not checked
#25
Comments
raymondfam marked the issue as insufficient quality report |
raymondfam marked the issue as primary issue |
This has been reported by several other bot reports. It should be deemed inconsequential because refund is typically the EOA that initiated the transaction according to the function NatSpec. |
This and all relevant exhibits detail that low-level In all referenced instances, either the Based on the above, I consider this and all relevant exhibits as invalid. #641 is also kind of similar and can be consulted for a separate judgment of the same type of issue. |
alex-ppg marked the issue as unsatisfactory: |
Hi @alex-ppg, thank you for the detailed response. I think this is still an issue since even if calls are intentionally not checked to respect the non-blocking pattern, they would still cause locking of those funds in the UTBExecutor contract. There is no withdrawal mechanism implemented to rescue those funds. Since this falls under the fund accumulation attack idea suggested in the README as well, please consider re-evaluating this issue. Thank you for your time. |
Hey @mcgrathcoutinho, the contract is unable to confirm the transfer of funds unless it results in a blocking pattern. Given that a blocking pattern would introduce a high-severity vulnerability while funds lost due to a misconfigured refund recipient by the user is arguable, it is advisable for the project to retain their current behavior rendering my original ruling to remain valid. |
Lines of code
https://github.com/code-423n4/2024-01-decent/blob/07ef78215e3d246d47a410651906287c6acec3ef/src/UTBExecutor.sol#L67-L67
https://github.com/code-423n4/2024-01-decent/blob/07ef78215e3d246d47a410651906287c6acec3ef/src/UTBExecutor.sol#L70-L70
Vulnerability details
Impact
The function in question contains two lines where low-level calls are made and their return values are not checked:
extraNative
without checking the return value:In this line,
extraNative
currency is attempted to be sent to therefund
address using a low-levelcall
. The issue with this line is that it does not check the success of thecall
. If thecall
fails, the contract will not be aware of it, and no revert will occur. This can lead to a situation where theextraNative
funds are not successfully refunded, but the contract continues execution as if they were.This line is performing a
call
to thetarget
address without sending any native currency and assigning the success status to a variablesuccess
. However, after this assignment, there is no accompanying check to determine whethersuccess
is true or false. If thiscall
fails (i.e.,success
is false), the contract will not be aware of it, and subsequent code may execute under the false premise that thecall
was successful. This could lead to unintended behavior and state inconsistency within the contract.For both issues, the lack of checking the return value poses risks such as loss of funds (in the case of a failed refund) and incorrect execution flow (if the contract continues after a failed call to
target
).Proof of Concept
Code
Output
Ether transfer to the initiating contract does not succeed, yet the transaction does not revert, consequently causing the ether to remain in the
Vault
contract.Incorporating a mechanism to verify the outcome of the
call
could avert this problem.Tools Used
Manual review
Recommended Mitigation Steps
It is imperative that these calls are followed by checks on their return values, and appropriate actions are taken if they are false. Without these checks, the contract is at risk of executing further logic based on the assumption that previous operations were successful when they may not have been, potentially leading to inconsistencies in contract state and unintended loss of funds.
For the first case:
For the second case:
Assessed type
call/delegatecall
The text was updated successfully, but these errors were encountered: