Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Invalid

Unrestricted Minting and Burning of SantaToken

Summary

An attacker who gains control of the i_santasList address can mint an unlimited amount of SANTA tokens, leading to inflation and potentially a loss of value for existing token holders. Additionally, the ability to burn tokens arbitrarily could be used to manipulate the token supply and price for personal gain.

Vulnerability Details

  1. The mint function is only accessible by the i_santasList address:

function mint(address to) external {
if (msg.sender != i_santasList) {
revert SantaToken__NotSantasList();
}
_mint(to, 1e18);
}
  1. The burn function is only accessible by the i_santasList address:

function burn(address from) external {
if (msg.sender != i_santasList) {
revert SantaToken__NotSantasList();
}
_burn(from, 1e18);
}

Impact

  • Inflation: The attacker can mint an unlimited amount of SANTA tokens, which will increase the total supply and dilute the value of existing tokens.

  • Price manipulation: The attacker can burn SANTA tokens held by other users, which can drive up the price of the remaining tokens. The attacker can then sell their own tokens at a higher price, making a profit.

  • Loss of trust: If the SantaToken system is compromised, it could lead to a loss of trust among users and investors.

Tools Used

Manual

Recommendations

  • Implement access control: Modify the mint and burn functions to only allow authorized entities to call them. This can be achieved using roles or a multi-signature wallet.

  • Limit minting and burning amounts: Add checks to ensure that the amount of tokens being minted or burned does not exceed a predefined limit.

  • Regularly audit the SantasList contract: Engage independent security auditors to assess the SantasList contract for vulnerabilities and make recommendations for improvement.

A mapping is used to store the addresses of authorized minters. The onlyMinter modifier ensures that only addresses with the minter role can call the mint function.

By implementing these mitigation strategies, the SantaToken team can significantly reduce the risk of an attacker exploiting the unrestricted minting and burning functionality.

Updates

Lead Judging Commences

inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.