The withdrawTokens function in the smart contract is marked as payable, allowing the function to receive Ether.
However, the function does not handle or account for the received Ether, leading to the risk of Ether being permanently
locked within the contract.
In the withdrawTokens function, the payable keyword allows the function to receive Ether when called.
However, the function logic does not include any mechanism to process, refund, or utilize the msg.value.
As a result, any Ether sent to this function will be stuck in the contract, as there is no way to retrieve or manage it.
Since msg.value is ignored within the function, any Ether sent to the contract will remain locked, with no way to return it to the sender.
The primary impact of this vulnerability is the loss of Ether. Users may inadvertently send Ether to the withdrawTokens function,
which will then become unrecoverable, leading to financial loss. This issue can also affect the contract's reputation and user trust,
as the inability to recover stuck Ether may be perceived as a critical flaw.
To prevent Ether from being stuck in the contract, the following actions are recommended:
Remove payable from the Function Signature:
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
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.