Reproduced Exploit
Camp sends a transferred NFT's royalty to the zero address
Royalty vaults are created when an NFT is minted. A later transfer does not create one for the new holder. The quoted payment sends the share to royaltyVaults(recipient). For Bob that address is zero, so 100 PAY is burned. getOrCreateRoyaltyVault before the transfer creates Bob's vault and the same…
Loss
100 PAY royalty burned at address(0) because the new owner has no RoyaltyVault
Chain
Ethereum
Category
logic
Date
Undated
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack replays in your browser. Step through it by Solidity line or by opcode.
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 62793-transferred-nfts-may-be-missing-royalty-vault-quantstamp-cam. Standalone Foundry PoC and full write-up: 62793-transferred-nfts-may-be-missing-royalty-vault-quantstamp-cam_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/missing-check · vuln/dos/frozen-funds
Key info#
| Field | Value |
|---|---|
| Loss | 100 PAY royalty burned at address(0) because the new owner has no RoyaltyVault |
| Vulnerable contract | Marketplace.buyAccess |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 1970-01 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Royalty payment uses a vault mapping that is filled only at mint |
TL;DR#
Royalty vaults are created when an NFT is minted. A later transfer does not create one for the new holder. The quoted payment sends the share to royaltyVaults(recipient). For Bob that address is zero, so 100 PAY is burned. getOrCreateRoyaltyVault before the transfer creates Bob's vault and the same 100 PAY lands there instead.
Background#
Quantstamp, Camp NFT, IpNFT.sol. Owners are paid subscription and dispute royalties through a per-owner RoyaltyVault so a reverting recipient cannot block the payment. Those vaults are created only in mint. Nothing creates one after transfer, and neither the new owner nor the contract owner can register one.
The vulnerable code#
if (token == address(0)) {
SafeTransferLib.safeTransferETH(ipToken.royaltyVaults(recipient), share);
} else {
SafeTransferLib.safeTransferFrom(token, payer, ipToken.royaltyVaults(recipient), share);
}
buyAccess reads that vault and payShare performs the ERC-20 transferFrom.
Root cause#
royaltyVaults is written in mint and not in transfer. The payment trusts the mapping. An unset entry is address(0), and the token allows that credit, so the funds are not returned and the new owner cannot claim them.
Preconditions#
- Alice minted the token, so Alice has a vault.
- Alice transferred the token to Bob, who has never minted.
- A buyer pays an ERC-20 royalty share for that token. The buy is permissionless.
Attack walkthrough#
- Alice mints. Her vault is deployed.
- Alice transfers the token to Bob.
royaltyVaults(Bob)is still zero. - The buyer approves 100 PAY and calls
buyAccesswith Bob as the recipient. - The ERC-20 branch calls
paySharewith the zero vault. transferFromcredits 100 PAY toaddress(0).
Diagrams#
Impact#
The new owner loses the 100 PAY royalty. The payer's tokens are stuck at the zero address. Alice's old vault is not the recipient, so she is not paid either. The control creates Bob's vault on the purchase and his vault balance is 100 while address(0) stays at 0.
Remediation#
Do not read royaltyVaults directly on the payment path. Use getOrCreateRoyaltyVault(recipient), which deploys a vault when the mapping is empty, and pay that address. The report's factory helper is the same idea.
How to reproduce#
cd 62793-transferred-nfts-may-be-missing-royalty-vault-quantstamp-cam_exp
forge test -vv
test_royalty_for_new_owner_is_burned asserts 100 PAY at address(0), a zero paid-to address, and no vault for Bob. test_control_getOrCreate_pays_the_new_owner asserts nothing is burned and Bob's vault holds 100 PAY.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/62793-transferred-nfts-may-be-missing-royalty-vault-quantstamp-cam.md
- Report: https://certificate.quantstamp.com/full/camp-nft/94cdb738-1a01-4f6c-8632-3bdec427161e/index.html
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 62793-transferred-nfts-may-be-missing-royalty-vault-quantstamp-cam_exp (evm-hack-registry mirror).
- AuditVault finding: 62793-transferred-nfts-may-be-missing-royalty-vault-quantstamp-cam.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.