A malicious staker can maliciously withdraw more than they have because the withdrawal functions in Temple Staking contract do not update balances.
These are the vulnerable functions:
In each of them, a staker can withdraw more than the tokens they staked. Once a staker has withdrawn their due tokens, they can go aheaad to withdraw more because the functions will still operate with the staker's old balances.
Here is a PoC:
Alice staked 300 tokens in the contract
Alice called with withdraw
function and got his 300 tokens
Alice can keep calling this function until she drains the contract or it is paused
Reentrancy
Manual review
Update balances immediately after withdrawal!
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.