the deposit()
function in Treasury
contract can be called by anyone and its first parameter is token address, means anyone can deposit any token, this can lead to DOS of this function.
if we check deposit()
function:
we can see the _totalValue
variable updates each time user deposits regardless of which token being deposited. this is issue because attacker can create malicious token and deposit it to the Treasury with max uint256
amount. this makes _totalValue
full and unable to increase because its overflow if increases. by doing that attacker DOS the deposit()
function of Treasury. also owner cannot just call withdraw()
to fix that issue because attacker can make transfer()
function of malicious token to always revert so this makes owner couldnt be able to withdraw()
these malicious token.
DOS of deposit()
function in Treasury
contract.
Manual Review
Consider adding access control to deposit()
function or remove the _totalValue
or consider _totalValue
specific for each tokens.
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.