MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: low
Invalid

initializer function `Distribution_init` can be `frontrun` by an attacker result in setting parameters according to attacker's interest.

Vulnerability Details

The Distribution_init function in the Distribution smart contract is susceptible to a potential front-running vulnerability during initialization. Which can cause re-deployment of the proxy contract or in worst case. If deployer forgot to check the set parameters than parameters will be set according to attacker's interest.

The vulnerability is primarily associated with the transparency of the initialization process. The Distribution_init function initializes the contract and deploys pools using the provided parameters.

File : contracts/Distribution.sol
54: function Distribution_init(
55: address depositToken_,
56: address l1Sender_,
57: Pool[] calldata poolsInfo_
58: ) external initializer {
59: __Ownable_init();
60: __UUPSUpgradeable_init();
61:
62: for (uint256 i; i < poolsInfo_.length; ++i) {
63: createPool(poolsInfo_[i]);
64: }
65:
66: depositToken = depositToken_;
67: l1Sender = l1Sender_;
68: }

contracts/Distribution.sol#L54C5-L68C6

Impact

An attacker could monitor the Ethereum mempool for transactions deploying new instances of the smart contract. can cause re-deployment of the proxy contract or in worst case. If deployer forgot to check the set parameters than parameters will be set according to attacker's interest.

Recommendations

To mitigate the front-running vulnerability during initialization, consider implementing the following measures:
Add any access control mechanism to Distribution_init function. Like when deploying implementation contract add one immutable var. set deployer's address into that. Only that set address should be able to call Distribution_init initializer function.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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