Description: MartenitsaToken:updateCountMartenitsaTokensOwner function is called in MartenitsaMarketplace contract in functions buyMartenitsa and makePresent to update value of mapping countMartenitsaTokensOwner , which stores amount of Martenitsa tokens user has .
But its visibility is set to external and anybody can call it and exploit this function.
Proof of Concept:
malicious user can pretend having Martenitsa tokens calling MartenitsaToken:updateCountMartenitsaTokensOwner function unlimited times,
because it updates mapping countMartenitsaTokensOwner and has no access controls.
then mint health tokens using MartenitsaMarketplace:collectReward function because it calculates health tokens checking mapping but not abalance of user.
Proof of Code:
Add the following code to the MartenitsaToken.t.sol file.
A user does not need to buy Martinitsa tokens or be granted with them to mint health tokens because he can
exploit MartenitsaToken:updateCountMartenitsaTokensOwner function in his favor.
Manual review.
Additional access control code must be implemented in MartenitsaToken contract , as it was implemented
in HealthToken contract. Only MartenitsaMarketplace contract can call updateCountMartenitsaTokensOwner function.
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.