Lack of access control in MartenitsaToken::updateCountMartenitsaTokensOwner
enables unauthorized reward claims
The MartenitsaToken::updateCountMartenitsaTokensOwner
function is responsible for updating the count of martenitsaTokens associated
with a specific address. This update occurs in two key locations: MartenitsaMarketplace::buyMartenitsa
and MartenitsaMarketplace::makePresent
.
However, a critical issue arises due to the lack of access control in MartenitsaToken::updateCountMartenitsaTokensOwner
.
As a result, any external address can invoke this function, bypassing the intended constraints of the two designated locations.
This flaw compromises the integrity of the reward distribution mechanism utilized by MartenitsaMarketplace::collectReward
,
which relies on the accurate accounting of martenitsaTokens for issuing health token rewards.
The function MartenitsaToken::updateCountMartenitsaTokensOwner
lacks access control and is externally accessible
A test is included to demonstrate the ability of an address without tokens to repeatedly invoke the function, followed by calling
the MartenitsaMarketplace::collectReward
function to earn healthTokens
.
Output
Anyone can claim rewards without owning a Martenitsa token.
Foundry and manual review
Add an access control check to ensure the caller is only the MartenitsaMarketplace contract.
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.