The Rescuable contract that is inherited from by many contracts like CapitalPool and TokenManager, contains a function Rescuable::initializeOwnership that can initialize a new owner whenever the contract has no owner.
Steps to reproduce:
Owner of contract decides to call Ownable::renounceOwnership at one point.
Now anyone can call Rescuable::initializeOwnership to set themselves as owner of the contract
Put this in PreMarkets.t.sol Foundry test suite:
If the developers one day decide to call Ownable::renounceOwnership to give up ownership of the contract... The contract can be taken over by anyone by calling Rescuable::initializeOwnership.
Even if the "real" owner calls Rescuable::initializeOwnership after renouncing ownership of the contract, the transaction can be frontrunned.
Code inspection
Remove the function Rescuable::initializeOwnership since it provides no benefit, since the owner is already set on deployment. Function cannot be called anyway unless the contract gets its ownership removed.
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.