Anyone can alter the countMartenitsaTokensOwner mapping.
The MartenitsaToken.sol contract has a function updateCountMartenitsaTokensOwner( ). countMartenitsaTokensOwner is a mapping that maps the address to the amount of Martenitsa tokens that address holds. The updateCountMartenitsaTokensOwner( ) being an external function and not having any access control lets anyone add or subtract to anyone's countMartenitsaTokensOwner affecting the collectReward( ) in the MartenitsaMarketplace.sol contract. There are a few exploitable scenarios they are :
An attacker could subtract another users countMartenitsaTokensOwner and the user wouldn't get any healthTokens when he calls collectReward( )
A user could add to his countMartenitsaTokensOwner and would get an extra healthToken for every 3 MartenitsaToken
add this code to the MartenitsaMarketplace.t.sol testsuite
output :
Impact : High
Likelihood : High
Anyone can call this function and get as many rewards as they can for every 3 MartenitsaToken
Manual Review, foundry
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.