A voter can indicate their ranked candidates, sign it and let anyone execute on their behalf by providing their signature. However, this leads to a signature replay attack where anyone can use the signature at any point in time before the election ends, overwriting any future candidate rankings that the voter has made before the election ends.
The vulnerability lies in the rankCandidatesBySig
function of the contract, L50-L58.
The function checks that the signature is valid and proceeds to execute the rest of the function with the decoded parameters after checking its validity. However, the signature can be replayed and executed by anyone that has access to the signature before the election ends.
This vulnerability leads to signature replay attacks where the user's latest candidate ranking would get overwritten if anyone has access to their signatures for an outdated ranking, skewing the results.
Foundry, manual review
Implement an expiry timestamp for the signature to be valid
Include current user nonce along with the signature so that the signature is only valid once before execution
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.