Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

H2- Ether Payment Cannot Be Withdrawn by Host

Summary

The contract allows attendees to send Ether via the receive function, but the host cannot withdraw these funds using the withdraw function. The withdraw function only transfers balances of specific tokens (WETH, WBTC, USDC), leaving Ether balances locked and unusable for the host.

Vulnerability Details

The withdraw function does not handle Ether balances stored in the contract, leaving Ether funds unwithdrawable by the host. Although the _refundETH function allows attendees to claim refunds, this mechanism prevents the host from accessing Ether payments for legitimate use.

Affected Code

receive() external payable {
etherBalance[msg.sender] += msg.value;
emit NewSignup(msg.sender, msg.value, true);
}
function withdraw() external onlyHost {
address _host = getHost();
i_WETH.safeTransfer(_host, i_WETH.balanceOf(address(this)));
i_WBTC.safeTransfer(_host, i_WBTC.balanceOf(address(this)));
i_USDC.safeTransfer(_host, i_USDC.balanceOf(address(this)));
}
function _refundETH(address payable _to) internal {
uint256 refundValue = etherBalance[_to];
_to.transfer(refundValue);
etherBalance[_to] = 0;
}

Impact

  • Ether sent to the contract becomes inaccessible to the host.

  • Hosts are unable to utilize Ether payments for event-related expenses.

  • Attendees are the only parties able to reclaim their Ether balances.

Tools Used

  • Manual Review

Recommendations

Update the withdraw function to include Ether balances in addition to token balances.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 8 months ago
Submission Judgement Published
Validated
Assigned finding tags:

withdraw function lacks functionality to send ether

0xtimefliez Lead Judge 8 months ago
Submission Judgement Published
Validated
Assigned finding tags:

withdraw function lacks functionality to send ether

Support

FAQs

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