Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No max for defaultIncentive #189

Closed
code423n4 opened this issue Nov 30, 2021 · 3 comments
Closed

No max for defaultIncentive #189

code423n4 opened this issue Nov 30, 2021 · 3 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists invalid This doesn't seem right

Comments

@code423n4
Copy link
Contributor

Handle

gpersoon

Vulnerability details

Impact

The function setDefaultIncentive of StabilizerNode.sol doesn't check for a maximum value of _incentive.
If _incentive would be very large, then defaultIncentive would be very large and the function _replenishLiquidityExtension() would mint a large amount of malt.

The function setDefaultIncentive() can only be called by an admin, but a mistake could be made.
Also if an admin would want to do a rugpull, this would be an ideal place to do it.

Proof of Concept

https://github.com/code-423n4/2021-11-malt/blob/d3f6a57ba6694b47389b16d9d0a36a956c5e6a94/src/contracts/StabilizerNode.sol#L402-L411

function setDefaultIncentive(uint256 _incentive) external
..
    require(_incentive > 0, "No negative incentive");
    defaultIncentive = _incentive;

https://github.com/code-423n4/2021-11-malt/blob/d3f6a57ba6694b47389b16d9d0a36a956c5e6a94/src/contracts/StabilizerNode.sol#L344

function _replenishLiquidityExtension(uint256 rewards) internal returns (uint256 remaining) {
...
    malt.mint(msg.sender, defaultIncentive*10**18);

Tools Used

Recommended Mitigation Steps

Check for a reasonable maximum value in setDefaultIncentive()

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Nov 30, 2021
code423n4 added a commit that referenced this issue Nov 30, 2021
@0xScotch 0xScotch added the duplicate This issue or pull request already exists label Dec 10, 2021
@0xScotch
Copy link
Collaborator

#190

@GalloDaSballo
Copy link
Collaborator

Duplicate of #190

@GalloDaSballo GalloDaSballo marked this as a duplicate of #190 Jan 23, 2022
@GalloDaSballo
Copy link
Collaborator

While the finding is valid, because this is a duplicate from the same warden, am marking as invalid

@GalloDaSballo GalloDaSballo added the invalid This doesn't seem right label Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate This issue or pull request already exists invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants