Nouns Builder contest - yixxas'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: 59/168

Findings: 2

Award: $222.37

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: TomJ

Also found by: 0xSky, Chom, PwnPatrol, ayeslick, pedr02b2, yixxas, zkhorse

Labels

bug
duplicate
2 (Med Risk)
edited-by-warden

Awards

161.6008 USDC - $161.60

External Links

Lines of code

https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L596-L602

Vulnerability details

Impact

updateVetoer() is extremely important to the security of this contract as the vetoer holds the power to stop any proposal from being executed. If vetoer is set wrongly by accident, to one without an owner, it can open up the protocol to governance attack as described by Dialectic here. If vetoer is set wrongly to a malicious actor, all funds in the protocol will be stuck in contract as all proposals can be vetoed.

Proof of Concept

updateVetoer() does not require the target address to accept this transfer of vetoer privilege.

Governor.sol#L596-L602

    function updateVetoer(address _newVetoer) external onlyOwner {
        if (_newVetoer == address(0)) revert ADDRESS_ZERO();

        emit VetoerUpdated(settings.vetoer, _newVetoer);

        settings.vetoer = _newVetoer;
    }

Consider adding an acceptVetoer() function as commonly done for critical operations such as transfer of ownership or admin privilege.

#0 - GalloDaSballo

2022-09-19T22:59:52Z

2 step is basically always Non Critical

#1 - GalloDaSballo

2022-09-19T23:00:00Z

NC

#2 - GalloDaSballo

2022-09-19T23:01:21Z

Undoing the QA and changing to the 51% attack

#3 - GalloDaSballo

2022-09-20T19:12:44Z

Dup of #533

Lines of code

https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/governor/Governor.sol#L116 https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/governance/treasury/Treasury.sol#L141-L172

Vulnerability details

Impact

propose() function in Governor.sol takes in input from user of unbounded _targets[] array. This can lead to too high a gas consumption required to execute the entire proposal, one that exceeds the block gas limit which prevents anyone from executing this proposal even though it has sufficient for votes casted.

Proof of Concept

  1. Proposal is submitted via the _propose() function.
  2. Votes are then casted by users.
  3. If sufficient users votes in favour of the proposal, execute() can be called.

Treasury.sol#L141-L172

    function execute(
        address[] calldata _targets,
        uint256[] calldata _values,
        bytes[] calldata _calldatas,
        bytes32 _descriptionHash
    ) external payable onlyOwner {
        ...
        // Cache the number of targets
        uint256 numTargets = _targets.length;

        // Cannot realistically overflow
        unchecked {
            // For each target:
            for (uint256 i = 0; i < numTargets; ++i) {
                // Execute the transaction
                (bool success, ) = _targets[i].call{ value: _values[i] }(_calldatas[i]);

                // Ensure the transaction succeeded
                if (!success) revert EXECUTION_FAILED(i);
            }
        }
        ...
    }

However, since numTargets == _targets.length is unbounded, a proposal that is made with too many targets can lead to gas consumptions which exceeds the block gas limit, causing a proposal that has passed the voting phase to be unable to be executed.

Set a hard limit on _targets.length as done in nounsDAO. ( max number of targets is set to 10 there )

#0 - GalloDaSballo

2022-09-19T19:10:07Z

R

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