The Treasury::deposit function allows deposits from any token, enabling an attacker to overflow _totalValue to uint256.max, causing a denial-of-service by preventing further deposits.
likehood: high
severity: medium
The Treasury::deposit function allows deposits from any ERC-20 token and updates the _totalValue state variable using uint256. However, an attacker can exploit this by depositing a large amount of a malicious token, increasing _totalValue to its maximum (uint256.max). Once _totalValue reaches its upper limit, any subsequent deposit attempts will result in an arithmetic overflow, effectively preventing legitimate users from making deposits.
During the attack:
Normal users cannot deposit funds into the treasury, disrupting expected contract operations.
The contract manager (MANAGER_ROLE) can manually remove the malicious token, but an attacker can continuously create and send more malicious tokens, keeping _totalValue maxed out.
This creates a persistent DoS attack vector, making deposits unreliable and impacting protocol functionality.
Add the following test to test/unit/core/collectors/Treasury.test.js
Run it
Add a token whitelist
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.