# Nobody can buy the `TaxTokenReceipt` NFT from auction

Overridden transferFrom on TaxTokenReceipt NFT only allows Debita contracts as sender/receiver, so auctioned collateral can never be bought, freezing lender funds.

- Payout: Audit contest
- Severity: high
- Program: Debita
- Found by: 0x37
- Disclosed: 2024-10-31
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-10-debita-judging/issues/388
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-10-debita%3AH-2
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:access-control vuln:business-logic vuln:dos

**Target:** TaxTokenReceipt ERC721 collateral / Auction.buyNFT
**Root cause:** TaxTokenReceipt overrides ERC721 transferFrom to require from or to be a BorrowOrder, LendOrder, or Loan, but the Auction contract and external buyers are not in that allowlist.
**Steps:**
1. Create BorrowOrder with TaxTokenReceipt NFT as collateral and match it into a Loan.
2. Borrower defaults; loan is auctioned and NFT is transferred into Auction (allowed since Loan is sender).
3. Call `Auction::buyNFT` as any buyer; transferFrom(Auction, buyer) reverts because neither address is a Debita BorrowOrder/LendOrder/Loan.
4. NFT remains stuck in Auction; collateral cannot be liquidated.
**How found:** Code review of the overridden transferFrom allowlist logic, then tracing the auction flow to see that the Auction contract is never an eligible from/to address.
**Exploitation:** No attacker profit; the flaw is a liveness/DoS failure. On borrower default the auction cannot settle because the receipt NFT cannot leave the Auction contract, so lenders cannot recover collateral value.
**Insight:** When a token overrides transfer hooks with an allowlist of protocol contracts, enumerate every contract that must custody or receive the token (auctions, escrows, liquidators) and check each against the allowlist.

