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

Voter can vote without owning any Noun DAO NFT if they can borrow Noun DAO NFT on the creationBlock and hold it for 1 block then return it #277

Closed
code423n4 opened this issue Aug 27, 2022 · 1 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 invalid This doesn't seem right

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-08-nounsdao/blob/c1c7c6201d0247f92472419ff657b570f9104565/contracts/governance/NounsDAOLogicV2.sol#L588-L615

Vulnerability details

Impact

Voter can vote without owning any Noun DAO NFT if they can borrow Noun DAO NFT on the creationBlock and hold it for 1 block then return it. Voters can get too many voting power while using a little ETH (Borrowing fee), Then voters can spam voting NO or YES to targeted proposal. If NO voting has been spammed, it may cause valid proposal to be rejected.

Hacker can monitor mempool to know when the proposal is created and bribe a validator to attach Noun DAO NFT borrowing transaction into the same block as proposal creation block.

Proof of Concept

        /// @notice: Unlike GovernerBravo, votes are considered from the block the proposal was created in order to normalize quorumVotes and proposalThreshold metrics
        uint96 votes = nouns.getPriorVotes(voter, proposalCreationBlock(proposal));

Votes are considered from the block the proposal was created. If someone can hold Noun DAO NFT on that block, they will have voting power. If they throw Noun DAO NFT away even 1 block after that block, they still has voting power. So, just borrow Noun DAO NFT on proposal creation block, return it back 1 block later and then vote the proposal using cheap borrowed voting power.

Recommended Mitigation Steps

Use proposalCreationBlock(proposal) - 12 to avoid mempool observation since proposal creation event shouldn't be able to be known 12 blocks in advance.

@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 Aug 27, 2022
code423n4 added a commit that referenced this issue Aug 27, 2022
@davidbrai
Copy link
Collaborator

Duplicate of #140

@davidbrai davidbrai marked this as a duplicate of #140 Aug 29, 2022
@gzeoneth gzeoneth added the invalid This doesn't seem right label Sep 18, 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 invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants