Submitted by nnez, also found by adeolu and Ch_301 (1, 2)
This vulnerability allows attacker to manipulate the token denom during an active bid. By exploiting this bug, attackers can cancel their own bids and receive refunds in a more valuable token than originally used, effectively stealing funds from the contracts pool of user deposits.
The bug stems from a lack of validation in the setlistforsell function, which allows sellers to change the payment token (denom) even when there are active bids on a token.
The setbidtobuy function, when used to cancel a bid, refunds the buyer using the current denom specified for the token:
However, the setlistforsell function lacks checks for active bids, allowing a seller to change the denom at any time. This creates an exploit scenario where an attacker can:
This exploit allows the attacker to drain funds from the contract that were deposited by other users. For example, if the attacker initially bid 1,000 TokenX ($10), they could receive 1,000 USDC ($1,000) as a refund, effectively stealing USDC from the contract.
The following test demonstrates the described scenario:
Boilerplate for PoC here.
OR
Invalid Validation
blockchainstar12 (Coded Estate) acknowledged
