A previously timelocked NFT token becomes permanently stuck in vault if it’s ever moved back into the vault
The vault contract fails to delete timelock data when an NFT is transferred out via transferERC721(), leaving stale recipient information. If the same NFT is later re-deposited without a timelock, the stale recipient check prevents the owner from withdrawing it, potentially locking the NFT permanently.
Submitted by 0xRajeev, also found by pauliax
Let’s consider a scenario where a particular NFT token was timelocked for a certain duration by the owner using timeLockERC721() with a delegate as the recipient and then transferred out of the vault by the delegate via transferERC721() but without unlocking it explicitly using timeUnlockERC721().
This is possible because transferERC721() does all the timelock checks on expires/block.timestamp and recipient/msg.sender as is done in timeUnlockERC721(). But it misses deleting timelockERC721s[key] for that NFT tokenID (as done in L572 of timeUnlockERC721()).
Because of this missing deletion, if that same NFT is ever put back into the vault later but this time without a timelock, the vault logic still thinks it is a timelocked NFT with the older/stale recipient from earlier because of the missing deletion. So now the owner who makes the transferERC721() call will not match the older/stale recipient address and will fail the check on L510 (unless they control that stale recipient address from the earlier timelock).
The impact is that, without access/control to the earlier timelock recipient, this NFT token is now locked in the vault forever.
- Alice time locks a particular NFT token with delegate Eve as recipient using
timeLockERC721() - Eve transfers NFT to Bob using
transferERC721()but without callingtimeUnlockERC721()first - Alice buys the same NFT back from Bob (e.g. because it is now considered rare and more valuable) and again puts it back in her vault but this time without locking/delegating it to any recipient i.e. intending to control it herself.
- Because this NFT’s timelock data and delegate approval for Eve is never removed after Step 2, the NFT is still treated as timelocked in the vault with previous delegate Eve as the recipient (because of stale data in
timelockERC721sandnftApprovals) - Alice now cannot withdraw her own NFT without Eve’s help because the check on L510 will only allow Eve to transfer this NFT out of the vault.
- If Eve is no longer trusted/accessible then the NFT is locked in the vault forever.
Recommend adding delete timelockERC721s [timelockERC721Keys[nftContract][i]]; after L510.
patch link
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the transferERC721() function does not delete the timelock entry for the NFT, unlike timeUnlockERC721(), leaving stale recipient data that persists after the NFT leaves the vault.
Impact
Without access to the earlier timelock recipient, the NFT becomes permanently stuck in the vault.
What the attacker needed
NFT previously timelocked with a delegate; Delegate transfers NFT out without unlocking; Same NFT re-deposited without timelock; Original delegate unavailable or untrusted
The fix
The missing deletion of the timelock entry should be added after the recipient check in transferERC721().
How it was found
- Alice time locks an NFT with Eve as recipient using timeLockERC721().
- Eve transfers the NFT to Bob using transferERC721() without calling timeUnlockERC721() first.
- Alice buys the same NFT back and deposits it into her vault without a timelock.
- The stale timelock data still lists Eve as recipient, so Alice cannot withdraw the NFT without Eve's help.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A vault contract lets owners lock NFTs for a set time and name someone who can withdraw them. When that person transfers the NFT out, the contract forgets to clear the old lock record. If the NFT is later put back without a lock, the contract still thinks the old person is in charge, so the real owner cannot take it out.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.