NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

Ether Lockup Risk Due to Unhandled msg.value in withdrawTokens Function.

Summary

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.

Vulnerability Details

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.

function withdrawTokens(uint256[] calldata request) external payable returns(address) {
// function logic here
}

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.

Impact

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.

Recommendations

To prevent Ether from being stuck in the contract, the following actions are recommended:

Remove payable from the Function Signature:

- function withdrawTokens(uint256[] calldata request) external payable returns(address) {
+ function withdrawTokens(uint256[] calldata request) external returns(address) {
// function logic here
}
Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.