The Starklane contract's initialize() function, which sets critical parameters including ownership, lacks access control. This vulnerability allows any user to potentially front-run the deployment transaction and gain unauthorized control of the contract.
The initialize() function in the Starklane contract is responsible for setting up crucial contract parameters:
Bridge.sol#L44-L66
This function is protected by the onlyInit modifier, which ensures it can only be called once:
However, there's no access control on who can call this function for the first time. An attacker could monitor the mempool for the deployment transaction and front-run it with their own call to initialize(), setting themselves as the owner and set critical parameters like starknetCoreAddress, starklaneL2Address, and starklaneL2Selector.
An attacker could gain full ownership and control of the contract.
Manual Review
To prevent the implementation contract from being used, you should invoke the _disableInitializers() function from Openzeppelin in the constructor to automatically lock it when it is deployed:
Likelyhood: Low/Medium Impact: Very low, the attacker can at most run the protocol on their side and lead a phishing campaign with an address deployed by Ark.
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.