Beginner FriendlyFoundryDeFi
100 EXP
View results
Submission Details
Severity: high
Valid

The steakPoints saving function does not decrease users points when they unstakes

Summary

The steakPoints saving function does not decrease users points when they unstakes.

Vulnerability Details

Because the backend server only watch for onchain events and increase user points up on their stakes.
If user stake and then unstake repeatly they will get a ton of steak points.

if (!steakPoints) {
steakPoints = new steakPointsModel({
walletAddress: onBehalfOf,
points: +ethers.formatEther(amount) * PRECISION,
});
} else {
steakPoints.points += +ethers.formatEther(amount) * PRECISION;
}

Impact

User can abuse to get ton of points. Making it unfair to other user.

Tools Used

Manual review

Recommendations

  • decrease steakPoints on user unstake()

  • add import past onchain events function ( because incase backend is down, users will lost their steakPoints since it only increase if backend is up )

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Steaking server is not taking unstakes into account

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.