The FundSetDeadline instruction exhibits a classic Missing PDA Validation vulnerability.
While it checks has_one = creator (ensuring the signer matches the creator field in the account data), it completely fails to check if the fund account passed in the context is the legitimate PDA derived from the canonical seeds ([b"fund", creator.key()]).
The Exploit Path:
Attacker creates a fake, malicious Keypair (not a PDA).
Attacker populates this account with data that mimics the Fund struct, setting creator = Legitimate_Creator_Pubkey.
Attacker (or unsuspecting Creator via phishing) calls set_deadline passing this Fake Fund account.
The program sees account.creator == signer and allows the modification.
Note: While this modifies the Fake Account, successful execution can mislead off-chain indexers or legitimate UIs that do not verify account ownership, causing "Phishing" or "Display" attacks.
Severity: Medium
Likelihood: Low
Impact: Medium
Impact Details:
Phishing/Spoofing: Attackers can create "Shadow" campaigns that look official to the program logic, tricking UIs into displaying them as valid.
State Pollution: The program interacts with garbage accounts.
A solana-program-test demonstrating the acceptance of a non-canonical account.
Anchor provides declarative macros for PDA validation. Use seeds and bump constraints to enforcing that the account passed is exactly the one derived from the program's canonical path.
1. Add Seeds Constraint:
seeds = [b"fund", creator.key().as_ref()]
2. Add Bump Constraint:
bump (or bump = fund.bump if stored)
Code Diff:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.