The burn function being externally visible poses a few potential threats:
Since the function is external, any address can call it. This opens up the possibility for malicious actors to call the function repeatedly and burn tokens, potentially depleting the token supply and causing economic instability. This kind of attack is sometimes referred to as a "drain" attack
The function assumes that the burn
and safeTransferFrom
functions will always succeed. However, these functions can fail and return false.
Here is a MaliciousContract
that interacts with the burn
function of the token contract. The attack
function approves the MaliciousContract
to spend the maximum possible amount of tokens on behalf of the attacker
(msg.sender), then calls the burn
function to burn those tokens.
VS Code
Manual review
It's recommended to check the return values of these functions and handle failure cases appropriately.
To mitigate these threats, it's important to implement access controls, rate limiting
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.