Proposal can be created if proposer owns no tokens when token supply is low #604
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
Lines of code
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L466-L470
https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L116-L175
Vulnerability details
Impact
At the early stage of the deployed DAO, it is possible that the following
proposalThreshold
function returns 0 because the token supply is low.https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L466-L470
When calling the following
propose
function,if (getVotes(msg.sender, block.timestamp - 1) < proposalThreshold()) revert BELOW_PROPOSAL_THRESHOLD()
is executed. IfproposalThreshold()
returns 0, callingpropose
will not revert. As a result, even if the proposer owns no token, she or he can still be able to create a proposal when the token supply is low.https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L116-L175
Proof of Concept
Please append the following test in
test\Gov.t.sol
. This test will pass to demonstrate the described scenario.Tools Used
VSCode
Recommended Mitigation Steps
A minimum proposal threshold governance configuration that is at least 1 can be added. When
proposalThreshold()
returns 0 because the token supply is low, callingpropose
could still revert ifgetVotes(msg.sender, block.timestamp - 1)
is less than the minimum proposal threshold.The text was updated successfully, but these errors were encountered: