In MartenitsaToken::updateCountMartenitsaTokensOwner
there is no check on who can execute that function.
A malicious user can arbitrarly increase his count of Marenitsa and then call the MartenitsaMarketplace::collectReward
function to mint an arbitrary amount of HealthToken.
Proof of Concept:
Add this test in MartenitsaMarketplace.t.sol
:
Foundry
One of those two:
Make the function updateCountMartenitsaTokensOwner
callable only by MartenitsaMarketplace
.
Remove the custom counter and use balanceOf
from the ERC721
contract of openzeppelin
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.