The buySnow
function contains a critical flaw in its payment handling logic. When users send ETH in an amount that doesn't exactly match s_buyFee * amount
but have sufficient WETH balance/approval:
The contract falls back to using WETH for payment
The originally sent ETH remains trapped in the contract
User pays both the WETH fee AND loses their ETH
This violates core security principles by enabling silent fund theft through normal protocol usage.
Direct Financial Loss: Users permanently lose ETH sent to the contract
Double Payment: Users pay full price in WETH while losing ETH
Reputation Damage: Protocol appears to steal user funds
Permanent Fund Lock: Trapped ETH can only be recovered by privileged roles
Likelihood:
• Common user error (incorrect ETH amount calculations)
• Wallet UIs may auto-populate gas + value confusion
• No frontend validation guarantees
Impact:
• Permanent ETH loss to victims
• No recovery mechanism for users
• Undermines trust in entire protocol
Test Scenario:
Required fee for 100 tokens = 1 ETH
User accidentally sends 0.5 ETH
User has 1 WETH balance + approval
User receives 100 Snow tokens
User loses 0.5 ETH permanently
User loses 1 WETH (converted to 1 ETH value)
Net loss: 1.5 ETH value for 100 tokens (50% overpayment)
##Recommended Mitigation
Document Payment Rules:
"ETH payments must be exact - any over/under payment will be refunded and transaction reverted. WETH payments require exact token approval."
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.
The contest is complete and the rewards are being distributed.