Skip to content

security: add input validation guards across precompile, RPC, and pallets#80

Merged
nol4lej merged 2 commits into
mainfrom
security/input-validation-hardening
May 1, 2026
Merged

security: add input validation guards across precompile, RPC, and pallets#80
nol4lej merged 2 commits into
mainfrom
security/input-validation-hardening

Conversation

@nol4lej
Copy link
Copy Markdown
Member

@nol4lej nol4lej commented Apr 30, 2026

pallet-shielded-pool:

  • shield: reject duplicate commitments before Merkle insertion
  • unshield: reject zero-amount withdrawals before ZK check
  • private_transfer: enforce nullifier/commitment count equality
  • fees: reject zero-amount in claim_shielded and claim_to_evm

pallet-zk-verifier:

  • register_verification_key: reject duplicate (circuit_id, version) pairs
  • batch_register_verification_keys: same guard applied per entry
  • verify_transfer_proof: enforce nullifiers.len() == commitments.len()

client/rpc-v2:

  • get_merkle_proof: cap leaf reads at MAX_RPC_LEAVES (100_000) to prevent DoS
  • distinguish pool_not_initialized vs pool_is_empty errors

nol4lej added 2 commits April 30, 2026 19:37
…lets

pallet-shielded-pool:
- shield: reject duplicate commitments before Merkle insertion
- unshield: reject zero-amount withdrawals before ZK check
- private_transfer: enforce nullifier/commitment count equality
- fees: reject zero-amount in claim_shielded and claim_to_evm

pallet-zk-verifier:
- register_verification_key: reject duplicate (circuit_id, version) pairs
- batch_register_verification_keys: same guard applied per entry
- verify_transfer_proof: enforce nullifiers.len() == commitments.len()

client/rpc-v2:
- get_merkle_proof: cap leaf reads at MAX_RPC_LEAVES (100_000) to prevent DoS
- distinguish pool_not_initialized vs pool_is_empty errors
@nol4lej nol4lej merged commit 8dfa63f into main May 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant