There is no access control on the init function
the init function is missing access control allowing any user to front run the owner and set himself as owner of the contract.
above we can see the init function of the contract bridge.sol, the init function has a single modifier named onlyInit
Let us take a look at the code of this modifier below.
As we can see the modifier above only checks if the impl has already been initialized, if not we continue code execution. Therefore since there is no real access control on who can can the initialize
function, this function can be called by anyone and they will be set as the owner.
Malicious user can take ownership of the contract
manual reveiw
ensure only he correct owner can initialized the contract but having stricter access control on the function.
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
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.