A critical vulnerability has been identified in the auction system where unsold tokens can become locked in the factory contract due to incorrect ownership assignment in the auction contract. This occurs because the auction contract sets its owner to the factory address instead of the original auction creator, leading to potential permanent loss of tokens in no-bid scenarios.
The vulnerability stems from the following factors:
The AuctionFactory.createAuction
function deploys a new auction contract.
The auction contract's constructor sets owner = msg.sender
.
In this context, msg.sender
is the factory contract address, not the original caller of createAuction
.
When an auction ends with no bids, tokens are returned to the owner
.
As a result, unsold tokens are sent to the factory contract instead of the auction creator.
The impact of this vulnerability is severe:
Financial Loss: Auction creators will permanently lose access to their tokens if no bids are placed.
Trust Issues: This could lead to a loss of trust in the auction system and the broader platform.
Locked Assets: A significant amount of tokens could accumulate in the factory contract, becoming inaccessible, due to the fact there is no way to withdraw tokens from the factory.
System Dysfunction: The auction system fails to function as intended, not returning tokens to their rightful owners.
Manual code review
Modify Factory Contract: Update AuctionFactory.createAuction
to pass the original caller's address
Modify Auction contract to accept owner parameter in the constructor.
forge test --match-test test_owner -vvvv
An auction with 0 bids will get the `totalTokens` stuck inside the contract. Impact: High - Tokens are forever lost Likelihood - Low - Super small chances of happening, but not impossible
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.