Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: low
Invalid

Reinitialization Vulnerability in `SystemConfig` Contract Due to Missing `initializer` Modifier

Github

  • https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/SystemConfig.sol#L25

Summary

SystemConfig:initialize function lacks the initializer modifier. This missing modifier allows the function to be called multiple times, which could lead to reinitialization attacks or accidental misconfigurations. Such vulnerabilities could result in the loss of system control or incorrect fee settings, posing significant risks to the contract's security and functionality.

Vulnerability Details

The SystemConfig contract contains an initialize function intended to set the initial values for basePlatformFeeRate and baseReferralRate. However, the function lacks the initializer modifier, which is crucial in preventing multiple calls to the function. Without the initializer modifier, owner could call the initialize function again after the contract has already been deployed and initialized. This allows to modify critical parameters such as basePlatformFeeRate and baseReferralRate, potentially destabilizing the entire system. The absence of protection against multiple initializations could lead to accidental reinitializations by the contract owner or other authorized users. This could result in incorrect fee settings or other unintended consequences, affecting the contract's performance and security.

Impact

Multiple initializations could cause inconsistent state within the contract, leading to errors in fee calculations and other operations.

Tools Used

Manual Review

Recommendations

Implement the initializer modifier from OpenZeppelin's Initializable contract to ensure the initialize function can only be called once. This prevents reinitialization and secures the contract against related attacks.

Updates

Lead Judging Commences

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

[invalid] finding-Admin-Errors-Malicious

The following issues and its duplicates are invalid as admin errors/input validation/malicious intents are1 generally considered invalid based on [codehawks guidelines](https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity#findings-that-may-be-invalid). If they deploy/set inputs of the contracts appropriately, there will be no issue. Additionally admins are trusted as noted in READ.ME they can break certain assumption of the code based on their actions, and

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.