It is possible for anyone to call MartenitsaToken::updateCountMartenitsaTokensOwner
, which is used to track the MartenitsaToken balance of any producer. In a situation where sub
is passed in the operation
parameters after a producer listed its created nft, it will result in an underflow of the token been tracked in the MartenitsaToken::updateCountMartenitsaTokensOwner
, making it impossible to buy the MartenitsaToken listed by that producer.
The POC above is proof that it would be impossible to buy a producers NFT whenever the sub
is used in MartenitsaToken::updateCountMartenitsaTokensOwner
to make the countMartenitsaTokensOwner[producer]
to be zero hence leading to an underflow and making it impossible to buy that producers MartenitsaToken. This also affects the MartenitsaMarketplace::makePresent as it also uses MartenitsaToken::updateCountMartenitsaTokensOwner
meaning that it is possible to make it impossible for a producer/owner of a MartenitsaToken to send out his token. It also affects the MartenitsaMarketplace::collectReward and it means that an attacker can be able to manipulate the MartenitsaToken he holds to extrach HealthToken.
Manual Review
Add a check in MartenitsaToken::updateCountMartenitsaTokensOwner
to make it impossible for anyone to call the function except the address of the MartenitsaMarketplace.
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.