Skip to content
DoS Audit finding Intermediate

If pfBidder gets blacklisted the settlement process would be broken and every other bidders and the seller would lose their funds

During batch auction settlement, the contract immediately sends refund and payout to a partially filled bidder. If that bidder's address is blacklisted by a token like USDC, the transfer reverts, blocking settlement and trapping all other bidders' and the seller's funds.

Avci Follow with Aymen0909, FindEverythingX and 5 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-03-axis-finance-judging/issues/90

Found by

Avci, Aymen0909, FindEverythingX, bhilare_, jecikpo, merlin, poslednaya, seeques

Summary

During batch auction settlement, the bidder whos bid was partially filled gets the refund amount in quote tokens and his payout in base immediately. In case if quote or base is a token with blacklisted functionality (e.g. USDC) and bidder's account gets blacklisted after the bid was submitted, the settlement would be bricked and all bidders and the seller would lose their tokens/proceeds.

Vulnerability Detail

In the AuctionHouse.settlement() function there is a check if the bid was partially filled, in which case the function handles refund and payout immediately:

Solidity
            // Check if there was a partial fill and handle the payout + refund
            if (settlement.pfBidder != address(0)) {
                // Allocate quote and protocol fees for bid
                _allocateQuoteFees(
                    feeData.protocolFee,
                    feeData.referrerFee,
                    settlement.pfReferrer,
                    routing.seller,
                    routing.quoteToken,
                    // Reconstruct bid amount from the settlement price and the amount out
                    uint96(
                        Math.mulDivDown(
                            settlement.pfPayout, settlement.totalIn, settlement.totalOut
                        )
                    )
                );

                // Reduce funding by the payout amount
                unchecked {
                    routing.funding -= uint96(settlement.pfPayout);
                }

                // Send refund and payout to the bidder
                //@audit if pfBidder gets blacklisted the settlement is broken
                Transfer.transfer(
                    routing.quoteToken, settlement.pfBidder, settlement.pfRefund, false
                );

                _sendPayout(settlement.pfBidder, settlement.pfPayout, routing, auctionOutput);
            }

If pfBidder gets blacklisted after he submitted his bid, the call to settle() would revert. There is no way for other bidders to get a refund for the auction since settlement can only happen after auction conclusion but the refundBid() function needs to be called before the conclusion:

Solidity
    function settle(uint96 lotId_)
        external
        virtual
        override
        onlyInternal
        returns (Settlement memory settlement, bytes memory auctionOutput)
    {
        // Standard validation
        _revertIfLotInvalid(lotId_);
        _revertIfBeforeLotStart(lotId_);
        _revertIfLotActive(lotId_); //@audit
        _revertIfLotSettled(lotId_);
        
       ...
}
Solidity
    function refundBid(
        uint96 lotId_,
        uint64 bidId_,
        address caller_
    ) external override onlyInternal returns (uint96 refund) {
        // Standard validation
        _revertIfLotInvalid(lotId_);
        _revertIfBeforeLotStart(lotId_);
        _revertIfBidInvalid(lotId_, bidId_);
        _revertIfNotBidOwner(lotId_, bidId_, caller_);
        _revertIfBidClaimed(lotId_, bidId_);
        _revertIfLotConcluded(lotId_); //@audit

        // Call implementation-specific logic
        return _refundBid(lotId_, bidId_, caller_);
    }

Also, the claimBids function would also revert since the lot wasn't settled and the seller wouldn't be able to get his prefunding back since he can neither cancel() the lot nor claimProceeds().

Impact

Loss of funds

Code Snippet

https://github.com/sherlock-audit/2024-03-axis-finance/blob/main/moonraker/src/AuctionHouse.sol#L503-L529 https://github.com/sherlock-audit/2024-03-axis-finance/blob/main/moonraker/src/modules/Auction.sol#L501-L516 https://github.com/sherlock-audit/2024-03-axis-finance/blob/main/moonraker/src/modules/Auction.sol#L589-L600 https://github.com/sherlock-audit/2024-03-axis-finance/blob/main/moonraker/src/modules/Auction.sol#L733-L741 https://github.com/sherlock-audit/2024-03-axis-finance/blob/main/moonraker/src/modules/auctions/EMPAM.sol#L885-L891

Tool used

Manual Review

Recommendation

Separate the payout and refunding logic for pfBidder from the settlement process.

Discussion

sherlock-admin4

The protocol team fixed this issue in the following PRs/commits: https://github.com/Axis-Fi/moonraker/pull/140

10xhash

The protocol team fixed this issue in the following PRs/commits: Axis-Fi/moonraker#140

Fixed Now the payment of partial bid is separated from the settlement

sherlock-admin4

The Lead Senior Watson signed off on the fix.

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

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 settlement function performs an immediate token transfer to the partially filled bidder without handling the case where that transfer reverts due to a blacklist.

Impact

Settlement is permanently blocked, so all bidders and the seller could lose their tokens or proceeds.

What the attacker needed

Quote or base token supports blacklisting; partially filled bidder gets blacklisted

The fix

The payout and refund for the partially filled bidder should be separated from the settlement process; the protocol team fixed this in a pull request.

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.

Some tokens, such as USDC, can block specific addresses from sending or receiving them. This auction contract tries to pay a partially filled bidder during the final settlement step. If that bidder is blocked, the payment fails and the whole settlement stops, so nobody can get their money out.

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 Avci

View all

6 more disclosed reports, best first.

More from Axis Finance

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.