Skip to content
Business logic Audit finding Intermediate

_deposit resetting user rewards can be used to grief them and make them loose rewards via depositForMember

The deposit function sets a member's last deposit time to a future timestamp, which resets their reward accrual. Since depositForMember can be called by anyone, an attacker can repeatedly deposit for a victim to prevent them from earning any rewards.

GalloDaSballo Follow

Originally disclosed on Code4rena

Submitted by GalloDaSballo

The function _deposit sets mapMemberSynth_lastTime to a date in the future in synthVault.sol L107.

mapMemberSynth_lastTime is also used to calculate rewards earned. depositForMember allows anyone, to “make a donation” for the member and cause that member to lose all their accrued rewards. This can’t be used for personal gain, but can be used to bring misery to others.

depositForMember (in synthVault.sol on L95 can be called by anyone.

This will set the member and can be continuously exploited to make members never earn any reward.

 mapMemberSynth_lastTime[_member][_synth] = block.timestamp + minimumDepositTime; // Record deposit time (scope: member -> synth)

This is the second submission under the same exploit.

This can be mitigated by harvesting for the user right before changing mapMemberSynth_lastTime[_member][_synth]

verifyfirst (Spartan) commented:

Suggested mitigation solves the issue.

The original report as published on Code4rena, by GalloDaSballo. 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

The deposit function updates the member's last deposit time to a future timestamp without first harvesting accrued rewards, and this function is callable by anyone for any member.

Impact

An attacker can repeatedly reset a member's reward timer, causing that member to lose all accrued rewards and never earn any, though the attacker gains nothing personally.

What the attacker needed

None

The fix

The issue should be fixed by harvesting rewards for the user immediately before updating mapMemberSynth_lastTime.

How it was found

  1. Call depositForMember for a target member, which triggers _deposit and sets mapMemberSynth_lastTime to a future timestamp.
  2. Repeat the call to continuously reset the member's reward accrual.

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.

In this smart contract, rewards are calculated based on when a user last deposited. The deposit function sets that time to a future date, which effectively resets the reward counter. Because anyone can deposit on behalf of another user, an attacker can keep resetting a victim's reward timer, so the victim never earns anything.

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 by GalloDaSballo

View all

30 more disclosed reports, best first.

More from Spartan 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.