In the StabilityPool contract, the ReentrancyGuard from OpenZeppelin is inherited but not initialized in the constructor. This can lead to vulnerabilities where functions susceptible to reentrancy attacks may be exploited, as the reentrancy protection mechanism is not enabled.
Issue:
The StabilityPool contract inherits from ReentrancyGuard, but the constructor does not call the _initialize function from ReentrancyGuard. As a result, the reentrancy guard is not properly initialized, leaving the contract exposed to reentrancy attacks.
Affected Code:
The constructor should initialize the ReentrancyGuard contract:
Root Cause:
The ReentrancyGuard initialization is missing in the initialize function, which may leave the contract vulnerable to reentrancy attacks on functions that involve external calls.
Initialize ReentrancyGuard in Constructor:
Ensure the ReentrancyGuard is initialized properly during contract setup by calling:
Modify initialize Function:
Add the initialization call in the constructor:
By initializing the ReentrancyGuard, the contract will be protected from potential reentrancy attacks, enhancing its security.
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.