When an auction ends without any bids, all ERC20 auction tokens are returned to the owner. However, since an auction
is created through the AuctionFactory
contract, it will be the owner. Consequently, all tokens are transferred to the AuctionFactory
, which lacks a withdrawal mechanism. This results in the tokens becoming permanently locked within the AuctionFactory
contract.
FjordAuction::auctionEnd
can be called once an auction ends. In the case no bids were placed, all auction tokens are transferred to the owner (FjordAuction
line 192-195):
In the constructor of the FjordAuction
contract the owner
is set to the msg.sender
(line 134). The issue here is that the auction is created through the AuctionFactory
contract (AuctionFactory
line 52-66):
As a result, the AuctionFactory
contract becomes the owner of each FjordAuction
contract, not the caller of AuctionFactory::createAuction
. Consequently, all auction tokens from unsuccessful auctions are sent to the AuctionFactory
contract, where they become stuck due to the lack of a withdrawal mechanism.
Run the test with -vvvv
Retreive the auctionAddress from this log: emit AuctionCreated(auctionAddress: FjordAuction: [AUCTION_ADDRESS])
Insert the auctionAddress in [INSERT_AUCTION_ADDRESS]
A forge test demonstrating this vulnerability has been provided. The test creates an auction, allows it to end without bids, and verifies that the tokens are indeed transferred to the AuctionFactory
contract. Copy the code below into a solidity file in the test
directory, follow the steps above and run the test.
Deployer: Deployer of the FjordAuctionFactory
contract who should receive the auction tokens.
User: The user who ends the auction without any bids.
All auction tokens without any bids will be stuck in the AuctionFactory
contract.
Impact: High
Likelihood: Medium (depends on the number of auctions without bids)
-> Severity: High
Manual code review
Forge unit test
There are two options to fix this issue:
Implement a withdrawal mechanism in the AuctionFactory
contract to allow the owner to withdraw the auction tokens.
Change the owner of the FjordAuction
contract to the same owner of the AuctionFactory
.
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.