Skip to content
Access control Audit finding Beginner

No max for advanceIncentive

The setAdvanceIncentive function lacks a maximum value check, allowing an admin to set an arbitrarily large incentive. This could cause the advance function to mint an excessive amount of malt tokens, diluting the token supply and enabling a rug pull.

gpersoon Follow

Originally disclosed on Code4rena

Submitted by gpersoon, also found by 0x1f8b

The function setAdvanceIncentive of DAO.sol doesn’t check for a maximum value of incentive. If incentivewould be very large, then advanceIncentive would be very large and the function advance() would mint a large amount of malt.

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

Proof of Concept

https://github.com/code-423n4/2021-11-malt/blob/d3f6a57ba6694b47389b16d9d0a36a956c5e6a94/src/contracts/DAO.sol#L98-L104

function setAdvanceIncentive(uint256 incentive)  externalonlyRole(ADMIN_ROLE, "Must have admin role") {
  ...
  advanceIncentive = incentive;

https://github.com/code-423n4/2021-11-malt/blob/d3f6a57ba6694b47389b16d9d0a36a956c5e6a94/src/contracts/DAO.sol#L55-L63

function advance() external {
...
  malt.mint(msg.sender, advanceIncentive * 1e18);

Recommended Mitigation Steps

Check for a reasonable maximum value in advance()

0xScotch (sponsor) confirmed and disagreed with severity:

Definitely need to guard against arbitrarily large incentives. Disagree the risk is medium though.

Alex the Entreprenerd (judge) commented:

Agree with the finding, this is an example of admin privilege, where the admin can set a variable which can be used to dilute the token and rug the protocol.

Because this is contingent on the admin’s action, I believe medium severity to be proper

Alex the Entreprenerd (judge) commented:

The simple rationale on the medium severity is that the owner could set the incentive to an exorbitant amount with the goal of minting a lot of tokens for an exit scam

The original report as published on Code4rena, by gpersoon. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the setAdvanceIncentive function does not enforce a maximum limit on the incentive value, allowing an admin to set it arbitrarily high.

Impact

An admin could set an exorbitant incentive and then call advance to mint a large amount of tokens, diluting the token and potentially performing a rug pull.

What the attacker needed

Admin privileges

The fix

The function should check for a reasonable maximum value for the incentive to prevent excessive minting.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In a smart contract, an admin can set a reward amount called an incentive. If there is no upper limit, the admin could set it to a huge number, and when someone calls the advance function, the contract would create (mint) a massive number of new tokens. This would make existing tokens worth much less, effectively stealing value from holders.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by gpersoon

View all

47 more disclosed reports, best first.

More from Malt Protocol - Versus contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.