sherlock-audit / 2024-03-nouns-dao-2-judging

1 stars 0 forks source link

auditsbyradev - `NounsAuctionHouseV2.sol` - If `reservedPrice` is changed through an active auction, the auction still can be settled. This will result in losses for the NFT owner or auction bidder #36

Closed sherlock-admin4 closed 8 months ago

sherlock-admin4 commented 8 months ago

auditsbyradev

high

NounsAuctionHouseV2.sol - If reservedPrice is changed through an active auction, the auction still can be settled. This will result in losses for the NFT owner or auction bidder

Summary

The NounsAuctionHouseV2.sol contract is designed to facilitate the auctioning of Nouns NFTs, playing a central role in the Nouns DAO ecosystem. This contract manages the entire lifecycle of an auction, from creation, bidding, to settlement. Each auction involves minting a new Noun NFT, setting it up for auction, accepting bids, and ultimately transferring the NFT to the highest bidder, with the process designed to be transparent and fair to all participants.

Auction Process

  1. Auction Creation: Initiated by the contract, often following the settlement of the previous auction. It involves minting the NFT and setting the auction parameters.
  2. Bidding: Participants can place bids on the NFT, with each bid needing to be higher than the last by a specified minimum increment.
  3. Settlement: Upon auction completion, the highest bidder wins the NFT. The contract then prepares for the next auction, repeating the cycle.

Vulnerability Detail

The problem is that the reservedPrice parameter can be altered during an active auction. Since reservedPrice directly influences the validity of bids and the auction's outcome, changes to this parameter mid-auction can lead to unintended consequences. If the reservedPrice is increased, the NFT owner risks the auction settling below this new threshold, incurring a loss. Conversely, lowering the reservedPrice could lead to bidders overpaying based on the initial auction conditions.

Impact

Code Snippet

Tool used

Manual Review

Recommendation

possible solution is to add a whenPaused modifier in the setReservePrice() function so that the reservePrice cannot be changed while there is an active auction.

sherlock-admin3 commented 8 months ago

2 comment(s) were left on this issue during the judging contest.

WangAudit commented:

assume owners are trusted not to this and it at max low/info

takarez commented:

this is invalid as the admin has the responsibility to change this parameters.

radeveth commented 7 months ago

I believe my bug is valid because it highlights a fundamental risk in the NounsAuctionHouseV2.sol contract, irrespective of the level of trust placed in the administrators. The ability to alter the reservedPrice mid-auction directly conflicts with the principles of transparency and fairness that are crucial to the auction process. This vulnerability can lead to tangible financial losses for NFT owners or cause bidders to overpay, undermining confidence in the Nouns DAO ecosystem. Trust in administrators does not negate the potential for human error or the unforeseen need to adjust auction parameters in response to dynamic market conditions. Furthermore, relying solely on administrative discretion without implementing safeguards diminishes the decentralized ethos of blockchain applications, where smart contract mechanisms are designed to provide trustless interactions. Implementing a whenPaused modifier on the setReservePrice() function is a practical and necessary step to prevent unintended consequences and ensure that auction integrity is maintained, regardless of administrator actions.

Finally, by the judge's comments, you are telling me that the reserved price will only change if there is no active auction (otherwise the bug exists)? The bug is not related to a trusted owner or anything like that!

Also for reference I will provide a Nouns-like DAO protocol (turnover protocol) that implements logic that prevents the auction from being settled if the reservedPrice changes through this active auction.

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

radeveth commented 7 months ago

The problem is that the reservedPrice parameter can be altered during an active auction. Since reservedPrice directly influences the validity of bids and the auction's outcome, changes to this parameter mid-auction can lead to unintended consequences. If the reservedPrice is increased, the NFT owner risks the auction settling below this new threshold, incurring a loss. Conversely, lowering the reservedPrice could lead to bidders overpaying based on the initial auction conditions.

WangSecurity commented 7 months ago

Firstly, the problem is that report can be viable only if the owner makes a mistake or acts maliciously, therefore, I think owners are trusted not to do so. I understand that in edge case it can happen, but this is only informational finding or low severity at max, cause it relies on owner to make a mistake.

Another problem, when settling the reserve price mid-auction, it doesn't effect already created bids or settling of the auction. reservePrice, i.e. the check that user's bid is higher than reservePrice, is only checked during creation of the bid.

Therefore, if there is current reserve price is 0.01ETH, current bid is 0.02 ETH and owner changes reservePrice to 0.03 ETH, the auction will still settle without any issue and the bidder will bet his NFT. And vice versa, I don't think "overpaying" is sufficient enough to be medium scenario in that case, cause as I see on NounsDAO site, their auctions always end up much much higher than the reservePrice. Yes, it's not a very strong argument, but what I mean here is that in case of "overpaying" both likelihood and impact are extremely low.