Auction Funds Never Sent To Token Owner #422
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-971
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L113
Vulnerability details
Impact
The owner of a token that is auctioned off may never receive the ETH they deserve from the auction. There are no requirements for the owner of the
auctionDemo
contract to send the ETH to the owner of the token that was auctioned.Proof of Concept
Within the readme for the competition the NextGen team ask wardens to “Consider ways in which the owner of the token will not receive the funds of the highest bid after an Auction is claimed.” When inspecting the code we see that auctions actually send ETH to the owner of the
auctionDemo
contract. This is the line within theclaimAuction
function that distributes the eth equal to thehighestBid
once the auction is over:(bool success, ) = payable(owner()).call{value: highestBid}("");
The problem is with the
owner()
function. This function is inherited from the OpenZeppelin Ownable contract and returns the owner of the contract not the owner of the token.Tools Used
Manual Review
Recommended Mitigation Steps
The
claimAuction
function correctly grabs the owner of the token and sets it to the variableownerOfToken
. Use this variable to send eth toAssessed type
ETH-Transfer
The text was updated successfully, but these errors were encountered: