Nouns Builder contest - cryptphi's results

A permissionless, governed protocol to deploy nouns-style DAOs complete with treasury, generative collections, and governance mechanisms.

General Information

Platform: Code4rena

Start Date: 06/09/2022

Pot Size: $90,000 USDC

Total HM: 33

Participants: 168

Period: 9 days

Judge: GalloDaSballo

Total Solo HM: 10

Id: 157

League: ETH

Nouns Builder

Findings Distribution

Researcher Performance

Rank: 50/168

Findings: 2

Award: $271.16

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: davidbrai

Also found by: Ch_301, Chom, PwnPatrol, bin2chen, cryptphi, pashov

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

Awards

205.2074 USDC - $205.21

External Links

Lines of code

https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/lib/token/ERC721Votes.sol#L207-L231

Vulnerability details

Impact

There are multiple situations in ERC721Votes._moveDelegateVotes() that would cause a revert due to either an overflow or underflow.

For example In line 216, the call to _writeCheckpoint() uses a local variable prevTotalVotes which is 0 for a first time delegate, hence the difference prevTotalVotes - _amount would underflow and revert.

Proof of Concept

https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/lib/token/ERC721Votes.sol#L207-L231

Tools Used

Manual review

There should be a check for zero result of prevTotalVotes before the call to _writeCheckpoint

#0 - GalloDaSballo

2022-09-27T01:49:29Z

Dup of #203

The check against 0 may help solve it although this finding is not fully developed

  1. Missing zero address check he following functions are missing zero address checks which may require redeployment of contracts Manager.constructor() Auction._authorizeUpgrade()

  2. Missing zero value check The following functions are missing zero value checks. Setting the state variable to 0 would affect other functions in the contract, possibly causing reverts.

Auction.setDuration() Auction.setReservePrice() Auction.setTimeBuffer() Auction.setMinimumBidIncrement()

#0 - GalloDaSballo

2022-09-26T21:25:16Z

1L for zero-check on adress

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter