The withdraw
and withdrawAll
functions do not validate the index
parameter before accessing the stake information. If the index
is invalid (i.e., it does not correspond to any stake), this can lead to undefined behaviour, potential reverts, or unintended actions by the contract.
Undefined Behavior: Accessing an invalid index can result in unpredictable contract behaviour.
Potential Reverts: The contract may revert if the index is out of bounds, causing transaction failure.
Security Risks: Malicious users might exploit this to disrupt contract operations or cause a denial of service.
Manual Review
Validate Index: Ensure the index
is within the valid range before accessing the stake information. Add a check to verify that the index exists in the user's stake list.
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.