MartenitsaMarketplace::collectReward
calculates the already paid healthTokens
incorrectlyDescription: The MartenitsaMarketplace::collectRewards function is designed to calculate the amount of healthTokens that have already been paid by a user. However, it appears to be calculating this amount incorrectly, leading to discrepancies in the rewards distribution and potentially allowing users to collect more rewards than they are entitled to.
Impact: This issue can lead to significant financial losses for the marketplace and its users, as users may collect more rewards than they have earned. It can also undermine trust in the marketplace's reward system, affecting user engagement and the overall health of the ecosystem.
Proof of Concept: Exploit Steps:
User buys 3 nfts and calls the collectReward
=> gets 1 healthToken
, has 3 nfts and 1 tokens now ✅
User buys another 3 nfts and calls the collectReward
again => gets 1 healthToken
, has 6 nfts and 2 tokens now ✅
User buys another 3 nfts and calls the collectReward
again => gets 2 healthToken
, has 9 nfts and 4 tokens now ❌
Here is the proof of concept just add this to the test suit:
Recommended Mitigation: Review and Correct the Calculation Logic: Thoroughly review the logic used in MartenitsaMarketplace::collectReward
to calculate the amount of healthTokens paid by a user. Ensure that the calculation accurately reflects the user's contributions and does not overestimate the amount.
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.