Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It should not submit a project with no total budget. Requires at least one task with cost > 0 #348

Open
code423n4 opened this issue Aug 6, 2022 · 2 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working documentation Improvements or additions to documentation sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue valid

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-08-rigor/blob/main/contracts/Community.sol#L206-L282

Vulnerability details

Impact

When publishing a project, there is still possibility the project doesn't have any task or 0 budget.

Proof of Concept

According to contest guideline, there is an information says

"Note that you cannot submit a project with no total budget. Therefore it requires at least one task with a budget > 0."

Meanwhile, on publishProject() in Community.sol, there is no check of this condition.

Recommended Mitigation Steps

Add a new require which will check if the first task (which is at index 1), its cost is > 0.

  // Local instance of variables. For saving gas.
  IProject _projectInstance = IProject(_project);
  ...

  // Revert if project doesn't have one task with budget > 0
  require(_projectInstance.tasks[1].cost > 0, "First task > 0");
@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Aug 6, 2022
code423n4 added a commit that referenced this issue Aug 6, 2022
@parv3213
Copy link
Collaborator

The docs here were deprecated. A project doesn't have to have any task published in a community.

@parv3213 parv3213 added sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue labels Aug 11, 2022
@parv3213 parv3213 added the documentation Improvements or additions to documentation label Aug 17, 2022
@jack-the-pug
Copy link
Collaborator

This is a valid Medium based on the docs (even though it's deprecated now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working documentation Improvements or additions to documentation sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons sponsor disputed Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue valid
Projects
None yet
Development

No branches or pull requests

3 participants