Christmas Dinner

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

The host can withdraw assets before the deadline

Summary

The host can withdraw funds before the deadline.

Vulnerability Details

The Host role is described as follows:

  • The person doing the organization of the event. Receiver of the funds by the end of deadline

However, the host can withdraw assets before the deadline.

Impact

The host can withdraw funds bel=fore the deadline, after that no participants can refund their funds before deadline.

Tools Used

Manual review

Recommendations

Add check that deadline has been passed to the withdraw function (also add new error BeforeDeadline):

function withdraw() external onlyHost {
+ if(deadline > block.timestamp) {
+ revert BeforeDeadline();
+ }
+
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)));
}
Updates

Lead Judging Commences

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

withdraw is callable before deadline ends

Support

FAQs

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