RaiseBoxFaucet::burnFaucetTokens Allows Owners to Drain the Entire Contract Balance Instead of Burning the Specified AmountThe burnFaucetTokens function is intended to burn a specific amount (amountToBurn) of faucet tokens held by the contract by first transferring them to the owner.
However, the function transfers the entire contract balance balanceOf(address(this)) to the owner instead of just the amountToBurn parameter.
Likelihood: High
Reason 1: The vulnerability is present in every call to `burnFaucetTokens` and there are no conditional paths that avoid it
Reason 2: The owner has legitimate reasons to call this function regularly for faucet maintenance
Impact: Medium
Impact 1: Users expecting faucet tokens to remain available in the faucet will find them unavailable after owner calls this function
Impact 2: The faucet functionality can be completely drained even when owner only intends to burn a small amount
Below is a test case that demonstrates calling burnFaucetTokens causes tokens drained.
Output:
Replace balanceOf(address(this)) with amountToBurn.
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.