MorpheusAI

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

`createPool` Function should have a access modifier

Summary

In the Distribution.sol contract the createPool function has a onlyOwner access modifier but in DistributionV2.sol there is no onlyOwner access modifier for the createPool function.

Vulnerability Details

function createPool(IDistribution.Pool calldata pool_) public {
pools.push(pool_);
}

https://github.com/Cyfrin/2024-01-Morpheus/blob/76898177fbedcbbf4b78b513d9fa151bbf3388de/contracts/mock/DistributionV2.sol#L18

Impact

Anybody will be able to create their own pool, with their own custom parameters.

Tools Used

Manual Review

Recommendations

Add the onlyOwner modifier to the createPool function.

function createPool(IDistribution.Pool calldata pool_) public onlyOwner {
pools.push(pool_);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`createPool` from DistributionV2.sol misses all the checks and access control available in Distribution.sol

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`createPool` from `DistributionV2.sol` misses all the checks and access control available in `Distribution.sol`

Support

FAQs

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