Contract can be re-initialized by malicious party if the underlying implementation get upgraded / changed.
The contract Starklane
inherits from Openzeppelin's UUPSOwnableProxied
and the initialize()
function is guarded by the modifier onlyInit()
As we can see, if the implementation changes when the contract is upgraded, malicious user can recall init to reset the owner address and take control over the bridge and cause massive loss of fund.
As the attacker sets his address as the owner. Malicious attacker can set worthless l2 nft to valuable l1 nft and bridge l2 nft to l1 nft to unlock the l1 nft using the function Starklane::setL1L2CollectionMapping
Manual Review
Access control should be implemented in initialize()
function.
If frontrun at the first deployment, protocol will deploy again, no real impact: informational. Moreover it is already deployed and initialize on mainnet. For the upgrades, `initialize` can/will change for the next update since the owner is already set. A lot of protocol make that change. That’s why I consider it like a future feature and it is out of scope.
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.