fix: add missing account validation in process_deposit_junior - #101
Conversation
process_deposit_junior was missing validate_account_not_empty, validate_account_owner, and validate_account_writable checks on pool_pda that are present in process_deposit. While indirect validation exists via vault_auth PDA derivation, explicit checks provide defense-in-depth, clearer error messages, and consistency with the Deposit handler. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 29 minutes and 36 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Sentinel security review — SUPERSEDED The three guards added here ( Specifically for The overlap concern: PR #113 targets Recommend: MERGE #101 on its own, or combine with other deposit_junior hardening. It does not conflict with any other open PR. Revised status: MERGE Security APPROVED PR #101 — findings: none | defense-in-depth ownership/writable/not-empty guards on deposit_junior; no conflicts |
Summary
process_deposit_juniorwas missingvalidate_account_not_empty,validate_account_owner, andvalidate_account_writablechecks onpool_pdaprocess_deposit(lines 388-391) but absent from the junior tranche equivalentSeverity
HIGH — defense-in-depth gap; inconsistent validation between two deposit paths that handle user funds
Fix
Added the three validation calls before
try_borrow_mut_data, matchingprocess_deposit:Test plan
cargo build— compiles cleanlycargo clippy— zero warnings🤖 Generated with Claude Code