Submitted by nnez, also found by Ch_301
This vulnerability allows malicious actor to steal tokens without payment when auto-approve is enabled.
The bug arises from an oversight in the token transfer mechanisms when auto_approve is set to true. While the transfer_nft function includes logic for settling payments, the send_nft function does not.
When a seller enables auto_approve, a bidder is granted approval of the token upon calling the setbidtobuy function. This approval is intended to allow the buyer to use transfer_nft to complete the trade, as this function handles both the token transfer and payment settlement.
However, the contract fails to account for the send_nft function, which can also be used to transfer tokens. Unlike transfer_nft, send_nft does not include any trade settlement logic:
This oversight allows a malicious buyer to exploit the system through the following steps:
This exploit effectively allows the attacker to steal the token from the seller without providing any payment to the seller.
The following test demonstrates the described scenario where victim set their token on sale with auto_approve set to true:
Boilerplate for PoC here.
Disallow the use of send_nft when token is on sale.
Context
blockchainstar12 (Coded Estate) acknowledged
