Skip to content
Business logic Audit finding Intermediate

Ineffective proposal threshold validation allows setting arbitrary high values

The setProposalThresholdPercentage function checks the current stored threshold instead of the new value, so the 10% maximum limit is never enforced. An attacker could pass a governance proposal to set the threshold arbitrarily high, potentially freezing governance by making it impossible to create new proposals.

Incogknito Follow with 0x23r0, 0xAadi and 34 others

Originally disclosed on Code4rena

Submitted by Incogknito, also found by 0x23r0, 0xAadi, 0xaudron, 0xmujahid002, 0xvd, anchabadze, Arjuna, aster, BALADOU, bareli, Bizarro, Brene, dreamcoder, eLSeR17, eta, eternal1328, Eurovickk, felconsec, gxh191, hrmneffdii, IceBear, Ishenxx, Lamsy, Manga, muellerberndt, noname_09, Petrus, phaseTwo, Shinobi, sohrabhind, Sparrow, Tamer, Topmark, unnamed, willycode20, and xKeywordx

https://github.com/code-423n4/2025-01-iq-ai/blob/b16b866d4c8d3e4a69b37a02c4e396d4b294537e/src/TokenGovernor.sol#L81-L86

The setProposalThresholdPercentage function in TokenGovernor checks the wrong variable when trying to enforce the maximum 10% threshold limit. Instead of validating the new incoming value, it checks the current stored value, making the protection completely ineffective.

This means anyone can propose and pass a governance proposal that sets the threshold to any value (even 100% or higher), which could effectively break the governance system by making it impossible for token holders to create new proposals.

The impact is severe because:

  • It could lock out all governance participation if set too high
  • It breaks the intended maximum 10% threshold protection
  • It could require another governance proposal to fix, which might be impossible if the threshold is set too high

Proof of Concept

function setProposalThresholdPercentage(uint32 _proposalThresholdPercentage) public {
    if (msg.sender != address(this)) revert NotGovernor();
    if (proposalThresholdPercentage > 1000) revert InvalidThreshold(); // Max 10%
    proposalThresholdPercentage = _proposalThresholdPercentage;
    emit ProposalThresholdSet(_proposalThresholdPercentage);
}

Attack scenario:

  1. Attacker creates a governance proposal to set proposalThresholdPercentage to 9000 (90%)
  2. The check if (proposalThresholdPercentage > 1000) looks at the current value (let’s say 100), not 9000
  3. The check passes because 100 < 1000
  4. The threshold is set to 9000, requiring 90% of total supply to create proposals
  5. The governance system becomes effectively frozen as gathering 90% support for new proposals is practically impossible

Recommended Mitigation Steps

Change the validation to check the new input value instead of the current value:

function setProposalThresholdPercentage(uint32 _proposalThresholdPercentage) public {
    if (msg.sender != address(this)) revert NotGovernor();
-  if (proposalThresholdPercentage > 1000) revert InvalidThreshold(); // Max 10%
+   if (_proposalThresholdPercentage > 1000) revert InvalidThreshold(); // Max 10%
    proposalThresholdPercentage = _proposalThresholdPercentage;
    emit ProposalThresholdSet(_proposalThresholdPercentage);
}

0xnev (judge) commented:

Borderline medium/low, the intended check is indeed incorrect, however, it would require a malicious voted proposal. Since function is affected, I would agree with Medium per C4 guidelines.

2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.

tom2o17 (IQ AI) confirmed and commented:

Agree With finding. Will fix.

0xnev (judge) commented:

Will confirm as Medium, because there is a risk of a whale coming in with sufficient quorum (now currently at 4%) to propose a proposal and executing it, which would thereafter possibly allow mismanaging of funds owned by the Agent and TokenGovernor contracts.

tom2o17 (IQ AI) mitigated:

PR 11

Status: Mitigation confirmed.


The original report as published on Code4rena, by Incogknito. 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

The validation condition uses the state variable proposalThresholdPercentage instead of the function parameter _proposalThresholdPercentage.

Impact

The governance system could be effectively frozen, making it impossible for token holders to create new proposals, and fixing it might require another governance proposal that could also be impossible to pass.

What the attacker needed

Attacker can create a governance proposal; Proposal passes with sufficient votes

The fix

The validation should check the new input value (_proposalThresholdPercentage) instead of the current stored value; the project has mitigated this in PR 11.

How it was found

  1. Attacker creates a governance proposal to set proposalThresholdPercentage to 9000 (90%).
  2. The check looks at the current value (e.g., 100) instead of the new value (9000).
  3. The check passes because 100 < 1000.
  4. The threshold is set to 9000, requiring 90% of total supply to create proposals.
  5. The governance system becomes effectively frozen as gathering 90% support for new proposals is practically impossible.

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.

This is a smart contract bug where a function that is supposed to limit a setting to 10% accidentally checks the old value instead of the new one. That means someone could set the limit to 90% or more, making it very hard for anyone to propose changes in the future.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Incogknito

View all

2 more disclosed reports, best first.

More from IQ AI

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.