The ConvertFacet::convert
function allows users to convert deposits from one token to another. Due to the absence of a validation check for the output amount (toAmount
) being greater than zero, it is possible to execute a conversion that results in no output tokens being received by the user, while still withdrawing the input tokens from their account.
The vulnerability arises from the lack of a check to ensure that the toAmount
(the amount of tokens to be received from the conversion) is greater than zero. The contract performs a duplicate check on the input amount (fromAmount
) being greater than zero but fails to verify that the conversion will result in a non-zero amount of output tokens. This oversight allows for the execution of conversions that can lead to users losing their deposits without receiving any output.
The users could lose their deposited tokens without receiving any tokens in return, effectively resulting in a loss of funds. This could undermine user trust in the platform and lead to financial losses for users.
Manual review
Add a validation check to ensure that toAmount is greater than zero.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.