Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

Rescuable.initializeOwnership(address _newOwner) will always revert

Summary

Rescuable.sol is Ownable contract so by default the deployer is assigned as its initial owner. The function initializeOwnership(address _newOwner) does not account for that hence, it will always revert when called.

Vulnerability Details

All core contracts in the protocol inherit from Rescuable.sol to be able to rescue user funds if needed.

Rescuable.sol in turn inherits from Ownable.sol and hence it has an initial owner which is the deployer of the contract. However, the initializeOwnership() implementation assumes the contract has no owner

function initializeOwnership(address _newOwner) external {
if (owner() != address(0x0)) { <=@
revert AlreadyInitialized();
}
_transferOwnership(_newOwner);
}

Therefore, Any attempt to call this function will revert leaving the contract unable to change the ownership when needed this will lead to paralyzing all onlyOwner functionality of the protocol.

Impact

The impact is totally dependent on:

  • The initial owner condition ( available or not)

  • The protocol is already deployed or not.
    The impact can range from Low ( if the initial owner is easy to access or the protocol is still in deployment stage)
    to High (if the initial owner is not reachable and the protocol already in high demand or high risk)

Tools Used

Manual review

Recommendations

Use onlyOwner modifier to ensure that no one other than the initial owner can call the function and make the illustrated changes below

- function initializeOwnership(address _newOwner) external {
+ function initializeOwnership(address _newOwner) external onlyOwner {
- if (owner() != address(0x0)) {
- revert AlreadyInitialized();
- }
_transferOwnership(_newOwner);
}

And -of course - making the owner a multi-sig account will omit the danger of an unavailable owner.

Updates

Lead Judging Commences

0xnevi Lead Judge
12 months ago
0xnevi Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

[invalid] finding-Rescuable-initializeOwner-lack-access-control

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

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.