The Recuable::initializeOwnership
function in the smart contract lacks proper access control mechanisms. This vulnerability allows any user to potentially frontrun the function, resulting in killing the contract.
The vulnerability is located in the initializeOwnership
function, defined as follows:
This function in implemented in all the core contracts CapitalPool
, DeliveryPlace
, PreMarkets
, SystemConfig
, TokenManager
. Anyone can frontrun the function call and as a result, when deployUpgradeableProxy is called, the initializeOwnership function will be called internally and it will be reverted with error AlreadyInitialized()
.
The funds used to deploy the contract will be lost, before setting it as a proxy in TadleFactory.
Manual code review
To mitigate this vulnerability, it is essential to implement proper access control mechanisms. Also consider passing the owner address into the constructor instead of a function.
Aside from `Rescuable.sol` being OOS, this is invalid based on codehawks guidelines regarding unprotected initializers. Additionally, this should be called concurrently when deploying a new proxy, but this submissions does not identify that particular issue of an uninitialized owner for proxy contracts
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.