The contract does not validate the length of the fund name or description, nor does it ensure that the fundraising goal is a non-zero value. This lack of validation can lead to unintended behavior.
The function accepts arbitrary-length names and descriptions, which could exceed storage constraints or lead to unexpected UI behavior.
There is no check to ensure that the goal amount is greater than zero.
Empty names and descriptions could make funds indistinguishable, causing confusion.
Overly long names or descriptions might lead to storage overflow or inefficient space utilization.
A goal of 0
would allow fundraising with no purpose.
Buffer overflow risks
Enforce a maximum length for names and descriptions.
Ensure that the goal amount is greater than zero before fund creation.
Static code analysis
Manual code review
Fuzz testing
If the `goal` is 0, the campaign goal is achieved immediately and the creator can withdraw the contributors funds. The contributors select themself which campaign to support, therefore I think Low severity is appropriate here.
There is a validation for the lengths of `name` and `description` in `fund_create` function: ``` pub struct Fund { #[max_len(200)] pub name: String, #[max_len(5000)] ..... } ``` Anchor will check for the lengths of these parameters and the function will fail if they have more characters than the constraints.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.