The function MartenitsaToken::updateCountMartenitsaTokensOwner
allows an external caller to arbitrarily increase or decrease the MartenitsaToken::countMartenitsaTokensOwner
mapping for a given owner
address. This can lead to unintended and potentially malicious modifications of the token ownership count data.
The arbitrary external call to MartenitsaToken::updateCountMartenitsaTokensOwner
function could allow an attacker to manipulate the MartenitsaToken::countMartenitsaTokensOwner
mapping, leading to inaccurate tracking of token ownership. The ability to decrease the mapping could also lead to denial of service attacks by reducing the recorded token balances for certain users.
Manual Review
First initialize the Attack
contract
Call the Attack::attackIncrease
function to increase the MartenitsaToken::countMartenitsaTokensOwner
mapping for any address.
Call the Attack::attackDecrease
function to decrease the MartenitsaToken::countMartenitsaTokensOwner
mapping for any address, mainly manipualting the token ownership data of certain users.
Proof Of Code:
Here is the contract as well
Implement access control to restrict the ability to call the MartenitsaToken::updateCountMartenitsaTokensOwner
function to only authorized entities, such as the contract owner or a designated role.
Consider removing the external ability to modify the MartenitsaToken::countMartenitsaTokensOwner
mapping directly and instead update the mapping through other functions that perform appropriate validation and authorization checks.
Implement a system of checks and balances, such as requiring two-factor authentication or multi-signature approvals for any changes to the MartenitsaToken::countMartenitsaTokensOwner
mapping.
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.