The misconfiguration of the owner
in the FjordAuction
contract, being set to the AuctionFactory
contract instead of an admin address, will cause a loss of funds. If no bids are placed and the auction ends, all funds are transferred to the AuctionFactory
contract, resulting in tokens being stuck and inaccessible to the intended owner.
When the FjordAuction
contract is deployed using the AuctionFactory::createAuction
function, the owner
of the FjordAuction
contract is incorrectly set to the AuctionFactory
contract. This creates a critical vulnerability where, in the event of no bids being placed, the tokens intended for the auction owner (admin) are transferred back to the auctionFactory
contract. This misconfiguration prevents the retrieval of tokens, leading to a permanent loss of funds.
Vulnerability Scenario:
The AuctionFactory::createAuction
function is called to deploy a new FjordAuction
contract.
The owner
of the deployed FjordAuction
contract is automatically set to the AuctionFactory
contract.
The auction receives no bids, and the auction is ended.
As per the current contract logic, the tokens are transferred to the AuctionFactory
contract instead of the intended admin.
The tokens are now stuck in the AuctionFactory
contract, resulting in a loss of funds, as there is no mechanism to retrieve them.
POC:
Copy this file and run the test using forge test --match-test testAuctionOwner -vv
.
The auction owner suffers loss of all tokens locked in the auction due to the inability to retrieve them from the AuctionFactory
contract.
Manual Review
To mitigate this issue, add an owner
input parameter to the AuctionFactory::createAuction
function and modify the constructor of the FjordAuction
contract to accept this owner
parameter.
Add these lines of code in AuctionFactory::createAuction
function:
Add these lines of code in FjordAuction
's constructor:
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.