ProxyFactory.deployProxyAndDistributeBySignature
is vulnerable to getting front-ran as it lacks proper checks.
The function takes following parameters -
organizer
- address of the organizer
contestId
- bytes32 representing the contest's id
implementation
- address of the implementation contract
signature
- signature of the organizer
data
- data that will be passed to the proxy and then to the implementation contract, it has winners and their percentage of winning amount
The function assumes to be called only by the organizer
with their signature
. However, when the signature
is exposed in the mempool it can be used by front-running bots with manipulated data
to benefit only the attacker.
Alice is the organizer and she calls this function with all necessary arguments with likely data
being
the front running bot sees the function being called and uses the provided signature
with other parameters and sends function with following data
as this particular function fails to check whether the msg.sender
is actually the organizer
or not.
the function will proceed and it will be the HackerAddress
taking all the rewards.
Intended winners will not get any rewards
Manual Review
Add necessary checks to ensure only suitable organizer
can call this function.
The following check can be improved to check whether the recovered address is msg.sender
or not
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.