The ThePredicter::withdrawPredictionFees
function incorrectly calculates the fees available for withdrawal, potentially allowing the organizer to withdraw unclaimed entrance fees from unapproved users.
The current implementation calculates fees as:
This calculation assumes all users in the contract are approved players, which may not be the case. Users can register without being approved, and the README
file states that unapproved users should be able to cancel their registration and withdraw their entrance fees.
This vulnerability allows the organizer to withdraw more funds than intended, including unclaimed entrance fees from unapproved users. This violates the protocol's design as described in the README
, where unapproved users should be able to reclaim their entrance fees. It could lead to financial losses for unapproved users who haven't yet canceled their registration.
Manual review, Foundry
Modify the fee calculation to only consider prediction fees:
withdrawPredictionFees incorrectly computes the value to be transferred to the organizer, which leads to pending players not being able to cancel their registration, approved players not being able to claim their rewards and other errors.
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.