Submitted by nnez, also found by adeolu
The bug allows buyers to purchase tokens that have been delisted by the seller, bypassing the sellers intent to halt the sale. This can result in tokens being sold against the sellers wishes.
The setbidtobuy function is responsible for allowing buyers to submit bids to purchase a token listed for sale. A seller can invoke setlistforsell to list a token, specifying the price, payment token (denom), and whether the sale is auto-approved. If auto-approve is set to true, any buyer who calls setbidtobuy can acquire the token without further input from the seller, while a manual approval is required when auto-approve is set to false.
However, there is a flaw in the logic of setbidtobuyit does not check the sell.islisted flag, which is supposed to indicate whether a token is still available for sale. Even if the seller later decides to delist the token by setting sell.islisted to false, buyers can still invoke setbidtobuy and proceed with the purchase if auto-approve is enabled. This creates a scenario where sellers lose control over the sale, allowing unintended buyers to purchase delisted tokens.
An action of delisting the token on sale in this manner is justified because there is no other functions serving this purpose as in short-term rental and long-term rental where there is a specific function to unlist the token from rental service.
The following snippet shows that the islisted flag is not verified in setbidtobuy, which allows unintended purchases:
This lack of validation enables buyers to acquire delisted tokens without the sellers consent.
The following test demonstrates that a buyer can still buy delisted token (token with islisted set to false).
Boilerplate for PoC here.
Disallow buying token with sell.islisted flag set to false/none.
Context
blockchainstar12 (Coded Estate) acknowledged
Lambda (judge) increased severity to High
