The RustFund contract allows campaign creators to accept contributions indefinitely by not enforcing deadline setting. This creates a scenario where campaigns can run forever, with creators able to withdraw funds at any time, undermining the fundamental trust model of crowdfunding.
The vulnerability stems from three interrelated issues in the codebase:
In the fund_create function, the deadline is initialized to 0 and dealine_set to false:
The contribute function only blocks contributions when both conditions are met:
This means if deadline is 0 (not set), contributions are always allowed.
Malicious actors could create perpetual campaigns to continuously siphon funds
Manual review
Consider implementing a default minimum campaign duration (something bigger than 0 and not very low either) to prevent indefinitely long campaigns.
There is no problem users to contribute to a given campaign before the deadline is initialized. The issue is when the users refund before the deadline is set.
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.