Description:Description\
The withdraw function in the contract calculates amountAfterFee, which represents the amount left after deducting network fees and protocol fees from the original amount. The function then compares this amountAfterFee with a user-provided minReceiveAmount to ensure the final amount received is at least the minimum specified by the user. However, this creates a potential vulnerability where an attacker can repeatedly set a minReceiveAmount greater than the amountAfterFee, causing the transaction to revert. This can be exploited to create a Denial of Service (DoS) attack.
Attack Scenario\
An attacker sets the minReceiveAmount to be higher than the expected amountAfterFee.
The withdraw function calculates amountAfterFee and checks if it is greater than or equal to minReceiveAmount.
Since minReceiveAmount is intentionally set too high, the check fails, and the transaction reverts.
By repeatedly calling the withdraw function with such high minReceiveAmount values, the attacker can create a Denial of Service (DoS) condition, causing legitimate withdrawal requests to fail.
Github username: @Jelev123 Twitter username: zhulien_zhelev Submission hash (on-chain): 0xef393fd0481e21a92c3a98c3928871a8a55c624473c321dcb2c8bf0bd05871c7 Severity: medium
Description: Description\ The
withdraw
function in the contract calculatesamountAfterFee
, which represents the amount left after deducting network fees and protocol fees from the original amount. The function then compares this amountAfterFee with a user-providedminReceiveAmount
to ensure the final amount received is at least the minimum specified by the user. However, this creates a potential vulnerability where an attacker can repeatedly set aminReceiveAmount
greater than theamountAfterFee
, causing the transaction to revert. This can be exploited to create a Denial of Service (DoS) attack.Attack Scenario\
Recommendation