The burnFaucetTokens() function should allow the owner to reduce the faucet’s total token supply by burning a specified amount (amountToBurn) from the faucet’s balance, while leaving the remaining tokens available for user claims.
Actual behavior:
Instead of only burning the requested amount, the function first transfers the faucet’s entire token balance to the owner, and then burns only amountToBurn from the owner’s wallet.
This results in all faucet tokens being moved to the owner’s wallet, even if only a small portion was meant to be burned.
Likelihood:
1.This will occur whenever the owner calls burnFaucetTokens() with a valid amount smaller than the faucet’s total balance.
2.The function’s _transfer(address(this), msg.sender, balanceOf(address(this))) line ensures the entire faucet balance is moved, regardless of the intended burn size.
Impact:
1.The faucet will lose all available tokens, rendering it unable to serve claimers.
2.The owner could unintentionally or maliciously drain the faucet’s token pool, disrupting the entire faucet’s functionality.
3.Users will no longer be able to claim tokens or test the RaiseBox protocol.
In this proof of concept, the faucet is funded with tokens (e.g., 1,000,000 RBT), and the owner calls burnFaucetTokens(100 * 1e18) intending to burn only 100 tokens. After execution, the faucet’s balance becomes 0 while the owner’s balance increases by nearly the full faucet amount, minus the 100 burned. This occurs because the function transfers the entire faucet balance to the owner before burning only the requested portion, effectively draining all faucet tokens to the owner and leaving the faucet empty
To fix this issue, the burnFaucetTokens function should directly burn tokens from the faucet’s own balance instead of transferring all tokens to the owner first. This can be done by replacing the transfer-and-burn sequence with a single _burn(address(this), amountToBurn) call, ensuring only the intended amount is burned and the faucet retains the remaining tokens for user claims.
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.