Normally, withdrawals should safely transfer funds to users without allowing further calls that could manipulate the contract’s state.
The current withdrawWinnings() implementation sends funds before updating the user’s state, enabling a reentrancy attack where a malicious contract can repeatedly withdraw funds before balances are updated.
Likelihood:
Occurs whenever a malicious contract calls withdrawWinnings() with reentrant logic before the user’s balance is updated.
Occurs whenever the contract does not follow the checks-effects-interactions pattern for withdrawals.
Impact:
Impact 1: An attacker can repeatedly withdraw funds, draining the vault.
Impact 2: Other users’ funds can be compromised, causing total loss of assets in the vault.
The PoC shows that an attacker can repeatedly call withdrawWinnings() before the user’s balance is updated. This reentrancy allows draining the vault and compromising all users’ funds.
Explanation:Follow the checks-effects-interactions pattern: update the user’s balance before transferring funds to prevent reentrancy attacks and protect all vault assets.
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.