sherlock-audit / 2024-04-teller-finance-judging

10 stars 9 forks source link

Afriaudit - Missing Initialization of OwnableUpgradeable in `LenderCommitmentGroup_Smart` Contract #244

Closed sherlock-admin4 closed 4 months ago

sherlock-admin4 commented 4 months ago

Afriaudit

medium

Missing Initialization of OwnableUpgradeable in LenderCommitmentGroup_Smart Contract

Summary

TheLenderCommitmentGroup_Smart contract inherits from OwnableUpgradeable but does not call the required initialization function __Ownable_init() to establish the contract's ownership.

Vulnerability Detail

The contract uses the OpenZeppelin upgradeable contracts framework, which requires explicit initialization of inherited contracts due to the lack of a constructor in the proxy pattern. The OwnableUpgradeable contract provides ownership management features, but without proper initialization, the owner of the contract will not be set, leading to potential issues with access control and ownership-dependent functions.

Impact

Failure to initialize OwnableUpgradeable means that the owner() function will return the zero address, and functions restricted to the owner, such as pauseBorrowing() and unpauseBorrowing(), cannot be called successfully. This compromises the contract's administrative controls and emergency stop mechanisms.

Code Snippet

https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol#L158

Tool used

Manual Review

Recommendation

Include a call to __Ownable_init() within the initialize function to properly set the initial owner of the contract.

Duplicate of #35