Compressed NFT Validation Remediation
Overview
Related Detector: Compressed NFT Validation
Missing Merkle proof verification allows forged compressed NFT operations. The fix is to always verify Merkle proofs and tree authority before modifying compressed NFT state.
Impact. A compressed NFT stores only a Merkle root on-chain, so a leaf the program accepts without proof is indistinguishable from a real one. An attacker who can present unverified leaf data forges ownership — transferring, burning, or reassigning NFTs they don’t hold — and a single forged proof can drain assets across an entire collection tree. This is a high-severity ownership bypass.
Recommended Fix
Use Bubblegum CPI which handles all verification:
invoke(
&mpl_bubblegum::instruction::transfer(
tree_authority, leaf_owner, new_owner,
merkle_tree, proof, root, nonce, data_hash, creator_hash,
),
accounts,
)?;
Common Mistakes
Mistake: Trusting Leaf Data Without Proof
// WRONG: reads leaf data without Merkle verification
let leaf = read_leaf(merkle_tree, index)?;
process_leaf(leaf)?;
Always verify the Merkle proof before trusting any leaf data.