There is possibility that leave a contract "uninitialized" and that contract will be used for malicious attack
Summary
The vulnerability is leaving the implementation contract uninitialized , which allows a malicious attacker to call initialize() function to upgrade the implementation contract. That allow malicious attacker to upgrade malicious contract as a new implementation contract and steal fund locked in contract by executing bad functions.
Vulnerability Detail
The vulnerability is leaving the implementation contract (ex. TimeLockNonTransferablePool.sol) uninitialized , which allows a malicious attacker to call initialize() function to upgrade the implementation contract. As a result, an attacker can insert any attack contract that includes bad functionalities into a parameter of new implementation contract. Then, once an attacker is successful to update the implementation contract, they can execute the bad functions.
Impact
A malicious attacker can steal fund locked in contract by executing bad functions such as a function that withdraw all locked fund, etc.
To avoid leaving a contract uninitialized, you should invoke the _disableInitializers() function in the constructor to automatically lock it when it is deployed:
0xmuxyz
high
There is possibility that leave a contract "uninitialized" and that contract will be used for malicious attack
Summary
uninitialized
, which allows a malicious attacker to callinitialize()
function to upgrade the implementation contract. That allow malicious attacker to upgrade malicious contract as a new implementation contract and steal fund locked in contract by executing bad functions.Vulnerability Detail
uninitialized
, which allows a malicious attacker to callinitialize()
function to upgrade the implementation contract. As a result, an attacker can insert any attack contract that includes bad functionalities into a parameter of new implementation contract. Then, once an attacker is successful to update the implementation contract, they can execute the bad functions.Impact
Code Snippet
Tool used
Recommendation
For example, in the TimeLockNonTransferablePool.sol, _disableInitializers() should be added with constructor like below. https://github.com/sherlock-audit/2022-10-merit-circle/blob/main/merit-liquidity-mining/contracts/TimeLockNonTransferablePool.sol#L6-L20