Malicious Organizer / Innovator can steal all funds from proxy contract.
When Organizer is set in setContest function he is in charge of distributing funds. He can act maliciously and steal all of the funds intended for users (supporters). It can be done using deployProxyAndDistribute function with right input parameters (bytes calldata data).
First there must be precalculated address of the proxy which will hold funds provided by the sponsor (which also can be malicious, later about that).
Then the funds must be sent to the proxy address by the sponsor.
Owner calls setContest function with malicious organizer address as an organizer parameter, bytes32 contestId (not relevant it this attack), uint256 closeTime (can be set to as little as block.timestamp + 1 which would definitly benifit the attacker) and address implementation (also does not affect the attack scenario here).
When actual block.timestamp is past the closeTime (which mentioned before can be block.timestamp + 1) malicious organizer calls deployProxyAndDistribute with bytes calldata data as follows (snippet from POC provided later in the report):
As the result organizer transfers all of the tokens (intended for supporters) to his address paying only COMMISSION_FEE which is 5% of the funds.
Snippet from logs after running POC in foundry
This is one scenario when malicious organizer steals sponsor's funds intended for supporters.
I mentioned above that sponsor can be malicious too. The second scenario is when the sponsor also acts as an organizer. The flow of the attack stays the same but in this situation the attacker uses his own funds and then can send them back to his address. There is no restriction when it comes to sponsor and organizer being the same address. Citing readme file from CodeHawks contest "Sponsor: the person who is willing to fund the contest. Sponsor can be anyone include the organizer." There are no checks that prevent passing organizer / sponsor address in the winners array.
Copy the code and paste it in test folder.
Funds are directly stolen by malicious actor.
VScode, Foundry
Make sure that sponsor and organizer can not be included in the winners array by implementing checks for these addresses. Or you can validate the inputs before deployProxyAndDistribute is called by organizer.
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.