fix: validate stake_vault matches pool.vault in AdminWithdrawInsurance - #58
fix: validate stake_vault matches pool.vault in AdminWithdrawInsurance#580x-SquidSol wants to merge 1 commit into
Conversation
process_admin_withdraw_insurance receives insurance tokens into stake_vault but never validates that stake_vault matches the pool's stored vault address. An attacker with admin access could pass a different token account, diverting returned insurance tokens away from the pool's vault and making them unavailable for LP holder withdrawals. Adds a check that stake_vault.key matches pool.vault before the CPI. Co-Authored-By: Claude Opus 4.6 <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 13 minutes and 48 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 |
|
Superseded by PR#95 (merged) and PR#96 (omnibus test coverage). All changes in this PR are already in master. Closing as part of PERC-8433 cleanup. |
|
Implemented in PR #98 and merged to master. Thank you for identifying this vulnerability — the fix was applied based on your diff after two rounds of security review. |
Summary
process_admin_withdraw_insurancereceives returned insurance tokens intostake_vaultbut never validates it matchespool.vaulttotal_returnedaccountingstake_vault.key == pool.vaultbefore the CPITest plan
🤖 Generated with Claude Code