-
Notifications
You must be signed in to change notification settings - Fork 7
shogoki - Possible loss of Funds - Liquidation transfers may silently fail #101
Comments
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Agree with escalation, it was wrongly duped. |
I agree that all the issues that came about race approvals were wrongly duped. Likewise, the rest of the issues that reported incorrect use of transferfrom instead of safetrasnferfrom were always duplicated in the same way in other contest regardless that whats happens. So I think this is a duplicate x example of #11 #34 #5 #42 #88 and others issue as this, this is not duplicate of #2 #35 and others issue as this that are duplicate of #203 |
Result: |
Escalations have been resolved successfully! Escalation status:
|
This is a duplicate of #214. So why was the status of 214 changed from |
#151 is a dup of this issue yet the status was changed from reward to non-reward and to low/info. Why ? @hrishibhat |
@kirinfilip I don't think #151 clearly describes any issue. Please add a little more detail in the future from the context of the code in the submissions. |
@hrishibhat understandable, thanks for the explanation. |
Fix looks good. |
shogoki
high
Possible loss of Funds - Liquidation transfers may silently fail
Summary
Transfers at Liquidation may silently fail, causing collateral be paid out withoud debt being paid, or liquidator not getting collateral.
Vulnerability Detail
in D3VaultLiquidation.sol:liquidate the caller pays the outstanding debt, and received the collateral tokens with a discount in exchange.
However, the transfer of the tokens to pay the debt, as well as the transfer of the collateral Tokens are using the
transferFrom
function of the ERC20 interface instead ofsafeTransferFrom
(which is used in other functions).Moreover, the return value of this function is not checked. As not all ERC20 tokens revert on a failed transfer, this could lead to a silent failure of a transfer. As the function will go on in this case this could lead to the liquidation to finish with either:
Impact
Possible loss of user or protocol funds.
Code Snippet
https://github.com/sherlock-audit/2023-06-dodo/blob/main/new-dodo-v3/contracts/DODOV3MM/D3Vault/D3VaultLiquidation.sol#L55
https://github.com/sherlock-audit/2023-06-dodo/blob/main/new-dodo-v3/contracts/DODOV3MM/D3Vault/D3VaultLiquidation.sol#L59
Tool used
Manual Review
Recommendation
Usage of
safeTransferFrom
as in other functions of the same contract is recommended.The text was updated successfully, but these errors were encountered: