Highest bid is sent to wrong owner in claimAuction #1557
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
duplicate-971
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L113-L114
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L18
Vulnerability details
Impact
In Attack Ideas there is:
"Consider ways in which the owner of the token will not receive the funds of the highest bid after an Auction is claimed."
This makes it clear that expected behavior of the
AuctionDemo.claimAuction
function is to send highest bid to the owner of the auctioned token.However, highest bid is sent to the owner of the
AuctionDemo
contract instead (AuctionDemo
inherits fromOwnable
).So if the owner of the contract is different from the owner of the token, then highest bid is sent to wrong address.
Proof of Concept
Full code to and exact steps to reproduce the issue are in this secret gist.
Here is only test that demonstrates the issue (without setup):
Tools Used
Foundry, manual analysis
Recommended Mitigation Steps
Change
owner()
toownerOfToken
inAuctionDemo.claimAuction
function.Assessed type
Other
The text was updated successfully, but these errors were encountered: