Problem Statement. claim_with_proof walks the proof vector linearly with no upper
bound. A malicious user could submit a 1-million-element proof as a JSON-encoded
Vec<String> that the contract will iterate.
Why it matters. Resource DoS on Soroban is bound by wasm CPU; not bounding the proof
length is a free lever for an attacker.
Technical Context. verify_merkle_proof_for_claimant runs in loop { current = hash_pair(...) }. The claim_with_proof accepts any Vec<String>. There is no
MAX_PROOF_LENGTH config field today.
Expected Outcome. New Error::ProofTooLarge returned when proof.len() > config.max_proof_length.
Acceptance Criteria.
- Test passes a 256-element proof → returns
ProofTooLarge.
- Test passes a 4-element valid proof → status ==
Claimed.
- Default cap is
32; configurable via set_config to a max of 64.
Implementation Notes. Use the existing claim_with_proof entry point; add a config
load at the top of the function.
Files or modules likely to be affected. src/lib.rs, tests/aid_escrow_tests.rs.
Difficulty. Easy
Estimated effort. S
Backlog item #19 from `docs/maintainer-issue-backlog.md.
Problem Statement.
claim_with_proofwalks the proof vector linearly with no upperbound. A malicious user could submit a 1-million-element proof as a JSON-encoded
Vec<String>that the contract will iterate.Why it matters. Resource DoS on Soroban is bound by wasm CPU; not bounding the proof
length is a free lever for an attacker.
Technical Context.
verify_merkle_proof_for_claimantruns inloop { current = hash_pair(...) }. Theclaim_with_proofaccepts anyVec<String>. There is noMAX_PROOF_LENGTHconfig field today.Expected Outcome. New
Error::ProofTooLargereturned whenproof.len() > config.max_proof_length.Acceptance Criteria.
ProofTooLarge.Claimed.32; configurable viaset_configto a max of64.Implementation Notes. Use the existing
claim_with_proofentry point; add a configload at the top of the function.
Files or modules likely to be affected.
src/lib.rs,tests/aid_escrow_tests.rs.Difficulty. Easy
Estimated effort. S
Backlog item #19 from `docs/maintainer-issue-backlog.md.