Revolution Protocol - Ward's results

A protocol to empower communities to raise funds, fairly distribute governance, and maximize their impact in the world.

General Information

Platform: Code4rena

Start Date: 13/12/2023

Pot Size: $36,500 USDC

Total HM: 18

Participants: 110

Period: 8 days

Judge: 0xTheC0der

Id: 311

League: ETH

Collective

Findings Distribution

Researcher Performance

Rank: 21/110

Findings: 2

Award: $304.35

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: bart1e

Also found by: 0xDING99YA, BowTiedOriole, Ward

Labels

bug
3 (High Risk)
insufficient quality report
partial-25
upgraded by judge
edited-by-warden
duplicate-49

Awards

296.992 USDC - $296.99

External Links

Lines of code

https://github.com/code-423n4/2023-12-revolutionprotocol/blob/main/packages/revolution/src/base/VotesUpgradeable.sol#L206-L213 https://github.com/code-423n4/2023-12-revolutionprotocol/blob/main/packages/revolution/src/NontransferableERC20Votes.sol#L29 https://github.com/code-423n4/2023-12-revolutionprotocol/blob/main/packages/revolution/src/base/erc20/ERC20VotesUpgradeable.sol#L24

Vulnerability details

Impact

As stated in the comment on line 12 of NontransferableERC20Votes.sol, delegation of vote power can be done through the delegate function or by providing a signature to be used with delegateBySig. However, these functions do not prevent users from delegating to address(0), leading users to permanently lose their voting power, intentionally or accidentally.

Proof of Concept

A test demonstrating that delegation to address(0) is possible and indeed results in the loss of voting power. You can paste this into NontransferableERC20.t.sol. Also see: Issue in Nouns Builder repo for the same bug https://github.com/code-423n4/2022-09-nouns-builder-findings/issues/203

function testVotingAndDelegationToAddress0() public {
        address delegate = address(0);
        uint256 mintAmount = 1000 * 1e18;

        // Mint tokens to the owner
        vm.startPrank(address(erc20TokenEmitter));
        erc20Token.mint(address(this), mintAmount);
        vm.stopPrank();

        // Delegate voting power
        erc20Token.delegate(delegate);

        // @bug Voting power is lost.
        assertEq(erc20Token.getVotes(delegate), 0);

        // Ensure that no tokens were transferred in the process of delegation
        assertEq(erc20Token.balanceOf(delegate), 0, "Delegation should not transfer tokens");
}

Tools Used

Manual Review

Don't allow delegation to address(0) by adding checks to both delegate and delegateBySig functions as the following:

require(delegatee != address(0), "Votes: delegate to the zero address");

Assessed type

Context

#0 - c4-pre-sort

2023-12-23T01:38:11Z

raymondfam marked the issue as duplicate of #49

#1 - c4-pre-sort

2023-12-23T01:38:15Z

raymondfam marked the issue as insufficient quality report

#2 - c4-judge

2024-01-06T23:29:03Z

MarioPoneder marked the issue as unsatisfactory: Out of scope

#3 - c4-judge

2024-01-10T19:57:21Z

MarioPoneder changed the severity to 3 (High Risk)

#4 - c4-judge

2024-01-10T19:57:41Z

MarioPoneder marked the issue as partial-25

Awards

7.359 USDC - $7.36

Labels

bug
downgraded by judge
grade-b
insufficient quality report
primary issue
QA (Quality Assurance)
Q-05

External Links

Lines of code

https://github.com/code-423n4/2023-12-revolutionprotocol/blob/main/packages/revolution/src/AuctionHouse.sol#L171-L200

Vulnerability details

Impact

Without ensuring the sequencer's uptime or validating the transaction order, there's a risk of transaction reordering and delay of the settlement of auctions. This could allow someone to manipulate the order in which bids are placed or settled. For instance an attacker could potentially front-run bids, impacting the fairness and outcome of the auction. Also see: https://github.com/sherlock-audit/2023-06-Index-judging/issues/40, lack of sequencer uptime may negatively impact English Auctions as I have described, as well as Dutch auctions.

Tools Used

Manual Review

Determine the maximum tolerable delay for the sequencer and invalidate the auction if the sequencer was down for maximum tolerable delay or more during the auction period.

Assessed type

Other

#0 - c4-pre-sort

2023-12-23T03:58:48Z

raymondfam marked the issue as insufficient quality report

#1 - c4-pre-sort

2023-12-23T03:58:52Z

raymondfam marked the issue as primary issue

#2 - raymondfam

2023-12-23T03:59:04Z

QA low.

#3 - c4-judge

2024-01-06T19:14:35Z

MarioPoneder changed the severity to QA (Quality Assurance)

#4 - c4-judge

2024-01-07T15:50:12Z

MarioPoneder marked the issue as grade-b

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