The Fund account schema allows fund names up to 200 bytes with #[max_len(200)]. This suggests that users should be able to create funds with names up to that length.
However, fund_create derives the fund PDA using the full name.as_bytes() as a PDA seed. Solana PDA seeds are limited to 32 bytes per seed. Therefore, any fund name longer than 32 bytes cannot be used to derive the fund PDA, even though the account schema allows up to 200 bytes.
Likelihood:
This occurs for every fund name longer than 32 bytes because the name is used directly as a PDA seed.
The account schema permits names up to 200 bytes, so valid-looking inputs can still fail during PDA derivation.
Impact:
Users cannot create funds with names longer than 32 bytes despite the program allocating account space for names up to 200 bytes.
Frontends or integrations that trust the account schema may accept fund names that the program cannot support.
The test uses a 33-byte name, which is below the declared #[max_len(200)] but above the 32-byte PDA seed limit. PDA derivation fails with Max seed length.
Do not use the full variable-length name as a PDA seed. Either enforce a 32-byte maximum name length or derive the PDA from a fixed-length hash of the name.
Alternatively:
If a hash is used for PDA derivation, store the original full name in the account and consider adding uniqueness/collision handling appropriate for the protocol.
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.