Original Lace Sheep
Medium
Multiple contracts failing to initialize inherited OpenZeppelin upgradeable contracts will cause a systemic issue for protocol users as uninitialized contracts may operate with improper state variables and access controls.
In the following contracts, there are missing initializations of inherited OpenZeppelin upgradeable contracts:
- In
LenderCommitmentGroup_Smart.sol
, the contract inherits ReentrancyGuardUpgradeable but fails to call__ReentrancyGuard_init()
- In
TellerV2.sol
, the contract inherits OwnableUpgradeable but fails to call__Ownable_init()
- In
SmartCommitmentForwarder.sol
, the contract inherits ReentrancyGuardUpgradeable but fails to call__ReentrancyGuard_init()
- Contracts must be deployed and initialized through their respective proxy patterns
- For LenderCommitmentGroup_Smart and SmartCommitmentForwarder, reentrancy protection would need to be required for a function execution
- For TellerV2, ownership functionality would need to be invoked
No external pre-conditions required as this is an implementation issue.
For TellerV2:
- Contract is deployed and initialized without proper
__Ownable_init()
- Initial owner state may be improperly set
- Ownership functions could behave unexpectedly or fail
- Critical owner-only functions may become inaccessible or improperly secured
For LenderCommitmentGroup_Smart and SmartCommitmentForwarder:
- Contracts are deployed without proper
__ReentrancyGuard_init()
- Reentrancy guard state variables are not properly initialized
- nonReentrant modifier may not provide expected protection
- Potential for reentrancy attacks on protected functions
The affected parties (protocol and users) face multiple risks:
- LenderCommitmentGroup_Smart:
- Missing reentrancy protection could allow unauthorized reentrant calls
- Critical functions marked with nonReentrant may be vulnerable
- Potential loss of funds through reentrancy attacks
- TellerV2:
- Ownership functionality may be compromised
- Administrative functions could become inaccessible
- Security of owner-protected functions may be compromised
- SmartCommitmentForwarder:
- Similar to LenderCommitmentGroup_Smart, reentrancy attacks possible
- Protected functions may be vulnerable to exploitation
- Potential loss of funds or unauthorized operations
The overall protocol security could be significantly compromised, potentially leading to unauthorized access, fund loss, or contract functionality failure.
No response
- Add proper initialization calls in the affected contracts'
initialize()
functions:
// LenderCommitmentGroup_Smart.sol
function initialize(...) initializer {
__ReentrancyGuard_init();
// Rest of initialization logic
}
// TellerV2.sol
function initialize(...) initializer {
__Ownable_init();
// Rest of initialization logic
}
// SmartCommitmentForwarder.sol
function initialize(...) initializer {
__ReentrancyGuard_init();
// Rest of initialization logic
}
- Ensure the
initializer
modifier is used to prevent multiple initializations