Skip to content
DoS Audit finding Intermediate

Once EntropyRateBps is set too high, can lead to denial-of-service (DoS) due to an invalid ETH amount

If the entropy rate is set too high, the remaining ETH after paying creators can fall below the minimum purchase amount, causing the auction settlement to revert and permanently block the protocol.

ayden Follow with ayden, mahdirostami and 12 others

Originally disclosed on Code4rena

Submitted by ayden, also found by ayden, mahdirostami, hals, KupiaSec, SpicyMeatball (1, 2), ast3ros, nmirchev8, wangxx2026, 0xCiphky, AS, fnanni, ktg, Inference, Brenzee, and rvierdiiev

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

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

https://github.com/code-423n4/2023-12-revolutionprotocol/blob/main/packages/protocol-rewards/src/abstract/RewardSplits.sol#L41

Once entropy is set too high, the remaining ETH used to invoke buyToken is very small, which can lead to the protocol permanently being stuck.

Proof of Concept

After auction is end someone invoke settleAuction or settleCurrentAndCreateNewAuction to settle current round and start a new round. Protocol send some eth to the creator per to entropyRateBps AuctionHouse.sol::_settleAuction

if (creatorsShare > 0 && entropyRateBps > 0) {
    for (uint256 i = 0; i < numCreators; i++) {
        ICultureIndex.CreatorBps memory creator = verbs.getArtPieceById(_auction.verbId).creators[i];
        vrgdaReceivers[i] = creator.creator;
        vrgdaSplits[i] = creator.bps;

        //Calculate paymentAmount for specific creator based on BPS splits - same as multiplying by creatorDirectPayment
        uint256 paymentAmount = (creatorsShare * entropyRateBps * creator.bps) / (10_000 * 10_000);
        ethPaidToCreators += paymentAmount;//@audit if there is eth stuck in this contract.

        //Transfer creator's share to the creator
        _safeTransferETHWithFallback(creator.creator, paymentAmount);
    }
}

the remaining eth will used to buy token from ERC20TokenEmitter for all the creators AuctionHouse.sol::_settleAuction

if (creatorsShare > ethPaidToCreators) {
    creatorTokensEmitted = erc20TokenEmitter.buyToken{ value: creatorsShare - ethPaidToCreators }(
        vrgdaReceivers,
        vrgdaSplits,
        IERC20TokenEmitter.ProtocolRewardAddresses({
            builder: address(0),
            purchaseReferral: address(0),
            deployer: deployer
        })
    );
}

however if the value of creatorsShare - ethPaidToCreators is less than minPurchaseAmount protocol always revert RewardSplits.sol::computeTotalReward

function computeTotalReward(uint256 paymentAmountWei) public pure returns (uint256) {
    if (paymentAmountWei <= minPurchaseAmount || paymentAmountWei >= maxPurchaseAmount) revert INVALID_ETH_AMOUNT();

    return
        (paymentAmountWei * BUILDER_REWARD_BPS) /
        10_000 +
        (paymentAmountWei * PURCHASE_REFERRAL_BPS) /
        10_000 +
        (paymentAmountWei * DEPLOYER_REWARD_BPS) /
        10_000 +
        (paymentAmountWei * REVOLUTION_REWARD_BPS) /
        10_000;
}

Assuming ReservePrice is set to 0.005 ether and EntropyRateBps is set to 9999

function testEntropyPecentLeadToDos() public {
    //set entropy to 9999
    auction.setEntropyRateBps(9999);
    //set reserve price to 0.005 ether
    auction.setReservePrice(0.005 ether);

    uint256 verbId = createDefaultArtPiece();

    uint256 balance = 1 ether;
    address alice = vm.addr(uint256(1001));
    vm.deal(alice,balance);

    auction.unpause();
    vm.stopPrank();

    vm.prank(alice);
    auction.createBid{value:0.005 ether}(verbId,alice);

    (, , , uint256 endTime, , ) = auction.auction();
    vm.warp(endTime + 1);

    vm.expectRevert(abi.encodeWithSignature("INVALID_ETH_AMOUNT()"));
    auction.settleCurrentAndCreateNewAuction();
}

output:

Running 1 test for test/auction/AuctionBasic.t.sol:AuctionHouseBasicTest
[PASS] testEntropyPecentLeadToDos() (gas: 1458836)
Test result: ok. 1 passed; 0 failed; 0 skipped; finished in 10.98ms

Tools Used

Foundry

Recommended Mitigation Steps

Recommend to check creatorsShare - ethPaidToCreators is greater than minPurchaseAmount before invoke buytoken

rocketman-21 (Revolution) confirmed

0xTheC0der (Judge) decreased severity to Medium and commented:

Underlying core issue: Owner misconfiguration of entropyRateBps and/or creatorRateBps (while still within allowed boundaries of setter method) leads to protocol DoS.


The original report as published on Code4rena, by ayden. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the contract does not check that the remaining ETH after creator payments exceeds the minimum purchase amount before calling buyToken.

Impact

The protocol could be permanently stuck because settlement always reverts, preventing new auctions.

What the attacker needed

Owner sets entropyRateBps too high; Auction ends with a winning bid

The fix

The contract should check that the remaining ETH after creator payments is greater than the minimum purchase amount before calling buyToken.

How it was found

  1. Set entropyRateBps to 9999 and reserve price to 0.005 ether.
  2. Create an art piece and unpause the auction.
  3. Place a bid of 0.005 ether.
  4. Advance time past the auction end.
  5. Call settleCurrentAndCreateNewAuction, which reverts with INVALID_ETH_AMOUNT.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The protocol pays creators a portion of the auction proceeds based on a configurable rate. If that rate is set very high, the leftover amount becomes too small to buy tokens, and the system rejects the transaction, so the auction cannot be settled.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by ayden

View all

4 more disclosed reports, best first.

More from Revolution Protocol

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.