Submitted by juancito, also found by Atharv, Banditx0x, den-sosnowsky, dobrevaleri, DoD4uFN, FalseGenius, Greed, hakunamatata, komronkh, KupiaSec, LonelyWolfDemon, potatoad-sec, Samueltroydomi, shui, th3_hybrid, Topmark, wellbyt3, willycode20, Xcrypt, and zaevlad
https://github.com/code-423n4/2025-01-iq-ai/blob/main/src/TokenGovernor.sol#L55
The expected quorum for proposals is 25% of the voting power.
An attacker can execute any proposal with as low as 4% of the voting power.
Proposals that dont get enough quorum are expected to fail because of that threshold, but the bug bypasses that protection by a 6.25x lower margin. Deeming High severity as a form of executing malicious proposals against expectations.
The error is in the 4 in the line GovernorVotesQuorumFraction(4). It doesnt represent 1/4th of supply but 4/100 actually.
Ref: https://github.com/code-423n4/2025-01-iq-ai/blob/main/src/TokenGovernor.sol#L55
This can be seen in the GovernorVotesQuorumFraction OpenZeppelin contract that is inherited.
Note how the quorumDenominator() is 100 by default and how the quorum() is calculated as supply * numerator / denominator.
In other words, 4% for the protocol governor (instead of 25%).
Ref: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.2.0/contracts/governance/extensions/GovernorVotesQuorumFraction.sol#L62-L74
Coded Proof of Concept
Here is a coded POC to show that those values are not overriden, and the flawed logic holds as described in the previous section.
The test shows how an adversary with only 4% of the voting power can successfully execute a malicious proposal.
Set the 25% quorum correctly:
tom2o17 (IQ AI) disputed and commented:
0xnev (judge) commented:
KupiaSec (warden) commented:
0xnev (judge) commented:
McToady (warden) commented:
0xnev (judge) commented:
0xnev (judge) commented:
