Likelihood:
The vulnerability is triggered whenever the owner calls the burnFaucetTokens() function, regardless of the amountToBurn specified.
Impact:
Complete Drain of Faucet Supply: An owner can call this function with amountToBurn = 1 to steal the entire token supply intended for the community, rendering the faucet inoperable.
Centralization Risk and Trust Violation: The function serves as a hidden "rug pull" mechanism, giving the owner complete control to drain the contract at any time and violating the trust of the users.
The exploit can be demonstrated with a simple scenario:
The faucet contract holds 10,000,000 tokens. The owner's wallet holds 0 tokens.
The owner calls burnFaucetTokens(1).
Inside the function, the _transfer call sends all 10,000,000 tokens to the owner. The faucet's balance is now 0.
Next, the _burn call destroys 1 token from the owner's balance.
Final State: The faucet contract is empty and useless. The owner's wallet now holds 9,999,999 tokens.
Explanation
To fix this vulnerability, the function should burn tokens directly from the contract's own balance (address(this)) instead of performing a transfer to the owner first. The internal _burn(account, amount) function allows specifying the account from which to burn tokens.
This change correctly implements the intended burn functionality without creating a withdrawal backdoor.
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.
The contest is complete and the rewards are being distributed.