Token-2022 Confidential Remediation
Overview
Related Detector: Token-2022 Confidential
Missing ZK proof verification in confidential transfers allows arbitrary amount manipulation. The fix is to always verify proofs before processing confidential operations, preferably by delegating to the Token-2022 program via CPI.
Impact. Confidential-transfer balances are encrypted, and their integrity rests entirely on the ZK proof attached to each operation. Skipping that verification lets an attacker submit an unbacked proof and move or mint arbitrary hidden amounts, breaking the conservation-of-value guarantee the extension provides — and because the amounts are encrypted, the manipulation is hard to detect after the fact, making it direct fund loss.
Recommended Fix
Delegate confidential transfer operations to the Token-2022 program which handles proof verification:
invoke(
&spl_token_2022::instruction::confidential_transfer::transfer(
&spl_token_2022::id(),
source, destination, mint, authority,
&[], amount, proof_data,
)?,
accounts,
)?;
Common Mistakes
Mistake: Implementing Custom Proof Verification
// RISKY: custom ZK proof verification is error-prone
fn verify_proof(proof: &[u8]) -> bool { /* custom logic */ }
Use the Token-2022 program’s built-in verification whenever possible.