# Missing PDA check The piggy program is designed so that only the PDA derived from the caller can withdraw SOL after some time. But there is a bug in this program. Find the bug and drain SOL from the PDA. # Task 1 - Write your exploit Write your exploit inside [`test`](https://github.com/Cyfrin/solana-course/blob/main/apps/ctf/pda/exercise/tests/test.rs). # Build ```shell cargo build-sbf ``` # Test Your exploit is successful if the test passes. ```shell cargo test -- --nocapture ```
The piggy program is designed so that only the PDA derived from the caller can withdraw SOL after some time.
But there is a bug in this program. Find the bug and drain SOL from the PDA.
Write your exploit inside test.
Your exploit is successful if the test passes.
A tactical challenge to Missing PDA Check - Audit a vulnerable piggy bank smart contract to uncover a critical flaw in address verification. Develop a Rust-based exploit to bypass the intended logic and successfully drain SOL from an insecure Program Derived Address.
Previous lesson
Previous
Next lesson
Next
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026
Rust Developer
SolanaDuration: 8min
Duration: 23min
Duration: 4min
Duration: 2min
Duration: 4min
Duration: 11min
Duration: 4min
Duration: 0min
Duration: 0min
Course Overview
About the course
Native Rust & Anchor framework
PDAs, CPIs, and SPL Tokens
DeFi builds: oracles, auctions, AMMs
Last updated on January 12, 2026