The InitDiamond
contract contains an init
function that can be called multiple times without any access control. This leads to significant security risks, including the potential to reset critical state variables and to mint an unlimited amount of Bean tokens, thereby disrupting the protocol's functionality and stability.
The InitDiamond.init
function calls the InitalizeDiamond.initializeDiamond
function, which sets various critical state variables and initializes the system. Since init
is publicly accessible and lacks access control, it can be called repeatedly by any user. This can lead to several issues:
State Resetting: The initializeDiamond
function initializes multiple parameters essential for the protocol's operation, including season parameters, field parameters, and various system settings. By resetting these parameters, an attacker can disrupt the normal functioning of the protocol. For instance:
Season Parameters: The function resets the current season to 1 and initializes the timestamp, which can disrupt time-dependent functionality within the protocol.
Field Parameters: It sets the weather parameters, which can affect farming operations within the protocol.
Silo Parameters: By resetting silo settings, the function can interfere with storage and asset management processes within the protocol.
InitalizeDiamond#L198-L202
Unlimited Token Minting: Each time the init
function is called, it mints INIT_SUPPLY
(100e6) Beans to the caller's address. Without restrictions, a malicious actor can repeatedly call this function to mint an unlimited number of tokens, leading to severe inflation and devaluation of the token.
Protocol Functionality Disruption: Resetting state variables can lead to inconsistencies and unexpected behavior within the protocol, affecting its overall functionality and reliability.
Unlimited Token Minting: Malicious actors can exploit the unrestricted init
function to mint an unlimited amount of Bean tokens for themselves. This can lead to severe inflation, impacting the token's price and stability, ultimately undermining the protocol's economic model.
VSCode
Restrict Access: Implement access control mechanism to restrict the init
function to be callable only by authorized accounts, such as the DAO.
Ensure One-Time Initialization: Ensure that the initialization process can only occur once, preventing multiple calls that could lead to the aforementioned issues.
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.