# Adversary can use send_nft to bypass the payment and steal seller's token in auto-approve scenario

With auto_approve enabled, a bidder gains token approval but can call send_nft instead of transfer_nft to move the NFT to their own contract without paying, then cancel the bid for a refund.

- Payout: Audit contest
- Severity: high
- Program: Coded Estate
- Found by: nnez
- Disclosed: 2024-12-04
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2024-10-coded-estate-findings/issues/3
- Library page: https://bugbountylibrary.com/r/c4%3A2024-10-coded-estate%3AH-08
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:solidity technique:chained technique:source-review vuln:access-control vuln:business-logic

**Target:** CosmWasm NFT marketplace contract (cw721 send_nft/transfer_nft)
**Root cause:** setbidtobuy grants the bidder approval when auto_approve is true, but only transfer_nft settles payment; send_nft calls _transfer_nft directly with no trade settlement logic, so the approval can be spent via send_nft.
**Steps:**
1. Seller calls `SetListForSell{islisted:true, token_id, denom:USDC, price:1000, auto_approve:true}`.
2. Attacker calls `SetBidToBuy{token_id}` with 1000 USDC, gaining approval on the token.
3. Attacker calls `SendNft{contract: attacker_contract, token_id, msg}` — `_transfer_nft` moves ownership to attacker contract, no payment settled.
4. Attacker calls `SetBidToBuy{token_id}` again to cancel the bid and get the 1000 USDC refunded; seller receives nothing.
**How found:** Code-reading comparison of the two transfer paths: noticed transfer_nft contains payment settlement logic while send_nft only calls _transfer_nft, and that the auto_approve approval granted by setbidtobuy is not scoped to transfer_nft.
**Exploitation:** Attacker needs only the bid amount as capital (refunded on cancel). Bid to obtain approval, use send_nft to an attacker-controlled Cw721ReceiveMsg contract to take the NFT without triggering payment settlement, then cancel the bid to reclaim funds. Net: NFT stolen, seller unpaid.
**Insight:** When a marketplace grants approval on bid, enumerate every code path that can spend that approval (transfer_nft, send_nft, burn, etc.) — any path lacking settlement logic is a free-take. Here the cw721 send_nft callback path is the classic overlooked sibling of transfer.

