The Treasury.sol contract deposit() function adds token amounts directly to _totalValue
without any price consideration, allowing malicious users to artificially inflate the total value using worthless tokens, potentially leading to DOS conditions through arithmetic overflow.
In the deposit()
function, the contract tracks the total value across all tokens by simply adding raw token amounts:
The issue lies in treating all token amounts as equivalent when updating _totalValue
. A malicious user can:
Deploy a new worthless ERC20 token with a large supply
Deposit this token to the Treasury
Cause _totalValue
to approach or reach uint256.max
DOS on legitimate deposits due to arithmetic overflow when updating _totalValue
Incorrect total value reporting that could mislead protocol decisions
Potential impact on any protocol mechanisms that rely on _totalValue
for calculations
Manual code review
Several approaches could mitigate this issue:
Implement a whitelist of accepted tokens.
Implement price oracle integration to track actual USD value.
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.