Severity: Medium
Category: Economic Security / Input Validation
The RustFund protocol lacks minimum threshold validations for campaign goals and contributions, permitting the creation of economically trivial campaigns with values as low as 1 lamport. This can result in numerous economically irrelevant campaigns, blockchain bloat, and unnecessary complexity.
The functions fundCreate
and contribute
in lib.rs
lack validation to enforce minimum acceptable thresholds. As a result:
Campaigns can be created with negligible economic value (1 lamport).
Contributions as small as 1 lamport are accepted without restrictions.
No checks exist to prevent economically meaningless transactions.
Enables proliferation of micro-campaigns with insignificant economic impact.
Potential for increased blockchain bloat and unnecessary computational overhead.
Disproportionate transaction fees relative to actual campaign economic value.
Increased complexity in accounting and user interface representations.
Manual code review
Anchor test framework
Implement explicit minimum thresholds for campaign goals and contributions within the fundCreate
and contribute
functions.
If user contributes 0 SOL, the `contribution.amount` will be updated with 0 value. There is no impact on the protocol. Also, the new contributers should pay for account creation, therefore there is no incentive someone to create a very huge number of accounts to contribute zero amount.
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.
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.