The Treasury::deposit
function uses IERC20::transferFrom
without checking the return value. This allows tokens that return false
instead of reverting on failed transfers to corrupt the treasury's balance tracking. Attackers can exploit this to artificially inflate both token-specific _balances
and the _totalValue
without actually transferring tokens.
Deploy an ERC20 token that returns false
on failed transfers instead of reverting
Attacker calls Treasury::deposit
with this token and any amount
The transferFrom
call fails silently (returns false
) but execution continues
Treasury records the full deposit amount in _balances
and _totalValue
Add this test to Treasury.test.js
:
High Severity - Allows complete corruption of treasury accounting system. Protocol financial reporting becomes unreliable, allocations and withdrawals based on false balances could lead to unexpected outcomes.
Use OpenZeppelin's SafeERC20:
Manual return value check:
LightChaser Low-60
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.