# Token owner can burn their token with active rental leading to renters' funds being stuck

Coded Estate burn() deletes token storage including active rental deposits, so renters can never cancel and their USDC stays stuck in the contract.

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

**Target:** CosmWasm NFT rental contract (burn / short-term rental)
**Root cause:** burn() only checks ownership/approval via check_can_send, then removes the entire TokenInfo including the rentals vector holding renter deposits, with no check for active rentals.
**Steps:**
1. Minter mints TOKEN_ID and calls `SetListForShortTermRental` with auto_approve=true.
2. Traveler calls `SetReservationForShortTerm` sending 10 USDC; deposit stored in `token.rentals`.
3. Owner calls `Burn { token_id }`; `self.tokens.remove` wipes rentals vector.
4. Renter's cancel/refund path reverts since rental record no longer exists; 10 USDC remains in contract balance.
**How found:** Code review of burn() against the rental data model: noticed rentals are stored inside TokenInfo and burn removes the whole TokenInfo without validating active rentals, then confirmed with a multi-test PoC.
**Exploitation:** Malicious or careless owner lists a property, collects advance deposits from renters, then burns the token to erase rental records; deposits are permanently locked in the contract with no refund path.
**Insight:** When state is nested inside a parent object that has a delete/burn path, check every child collection (deposits, bids, approvals) for orphaned value before the parent is removed.

