Skip to content
Business logic Audit finding Beginner

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

The publishProject function in Community.sol did not enforce the documented rule that a project must have at least one task with a budget above zero. An attacker could publish a project with no tasks or a zero total budget, contrary to the stated requirement.

cryptonue Follow

Originally disclosed on Code4rena

Submitted by cryptonue, also found by aez121, hansfriese, obront, rbserver, and saneryee

Community.sol#L206-L282

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 information that 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");

parv3213 (Rigor) acknowledged and commented:

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

Jack the Pug (judge) commented:

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


The original report as published on Code4rena, by cryptonue. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a missing validation check in publishProject that should confirm at least one task has a cost above zero.

Impact

A project could be published with no tasks or a zero total budget, breaking the documented rule; the project team later said the documentation was deprecated.

What the attacker needed

Ability to call publishProject

The fix

A require statement should be added to publishProject to check that the first task's cost is greater than zero.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract is a program that runs on a blockchain. This one lets people publish projects, and the rules said a project must have at least one paid task. The code never checked that rule, so someone could publish an empty or unpaid project anyway.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from Rigor Protocol contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.