Skip to content
Business logic Audit finding Intermediate

Auctions run for less time than intended

The auction contract incorrectly sets the first bid time to the auction creation time instead of zero, so the auction duration starts counting before any bid is placed. If the first bid arrives late, the auction runs for less time than intended, potentially reducing bids and causing suboptimal liquidation funds for lenders.

Anurag Jain Follow with chainNue, obront and 3 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/186

Found by

csanuragjain, chainNue, obront, peanuts, hansfriese, 0xRajeev

Summary

Auctions run for less time than intended causing them to be not economically efficient for the lenders, thus causing a suboptimal credit of liquidation funds to them.

Vulnerability Detail

From the documentation/comments, we can infer that firstBidTime is supposed to be // The time of the first bid and duration is supposed to be // The length of time to run the auction for, after the first bid was made.

However, when an auction is created in createAuction(), the auction's firstBidTime is incorrectly initialized as block.timestamp.safeCastTo64() instead of 0. This is premature initialization because the auction was only created here and no bid has been made yet via createBid(). The code in createBid() which check for firstBidTime == 0 is more evidence that the initialization in createAuction() is incorrect.

Impact

This causes auctions to run for less time than intended if the first bid comes at a much later time after the auction was created. A shorter auction time could potentially allow fewer bids and cause it to be not economically efficient for the lenders, thus causing a suboptimal credit of liquidation funds to them.

Code Snippet

  1. https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/interfaces/IAuctionHouse.sol#L12-L13
  2. https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/AuctionHouse.sol#L80
  3. https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/AuctionHouse.sol#L166-L176

Tool used

Manual Review

Recommendation

createAuction() should initialize firstBidTime = 0.

Discussion

androolloyd

will fix but its a convention issue we want auctions to start immediately not on first bid

The original report as published on Sherlock, by csanuragjain. 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 auction creation function initialised the first bid time to the current block timestamp instead of zero, so the auction duration began before any bid was made.

Impact

Auctions could run for less time than intended, potentially allowing fewer bids and causing suboptimal credit of liquidation funds to lenders.

What the attacker needed

Auction created; first bid arrives late

The fix

The report recommends initialising firstBidTime to zero in createAuction(), but the project responded that they will fix it while noting it was a convention issue and they want auctions to start immediately rather than on first bid.

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.

In an auction, the clock should start when the first person bids. Here, the clock started as soon as the auction was created, even if nobody bid for a while. That meant the auction could end sooner than expected, giving people less time to bid and possibly getting a lower price for the lender.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Anurag Jain

View all

63 more disclosed reports, best first.

More from Astaria

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.