Christmas Dinner

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

Functions Send ETH Away From Contract Without Checking the Recipient

Location

  • Found in src/ChristmasDinner.sol [Line: 137]()

    function refund() external nonReentrant beforeDeadline {

Issue
When the refund() function executes, it transfers Ether (_refundETH) and ERC20 tokens (_refundERC20) to msg.sender (the caller). However, there is no verification to ensure that the recipient address is valid or that it matches some intended whitelist or logic. In typical scenarios, msg.sender should be the rightful owner of the deposited funds, but if any contract logic were changed or a re-entrancy exploit introduced, the lack of address checks might allow unintended entities to receive funds.

Impact
Unintended recipients may receive funds if the contract logic or some external call is manipulated. In extreme cases, a malicious contract could initiate refunds on behalf of others or intercept calls.

Recommendation

  • Validate msg.sender: Consider adding additional checks to ensure that the caller is indeed the entity to be refunded or that _to is a valid address (e.g., not the zero address).

  • Optional: Introduce role-based or signature-based checks if further trust constraints are needed (e.g., requiring an off-chain signature to authorize refunds).

Updates

Lead Judging Commences

0xtimefliez Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!