Principal payout #146
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
invalid
This doesn't seem right
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L284-L348
https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L370-L375
https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L390-L394
Vulnerability details
Impact
It's possible to treat unvested aura as bribes and an attacker may cause a withdraw of AURA from the strategy to the popint where the debt in AURA to users cannot be covered by the strategy.
Proof of Concept
Anyone can create a valuable token in which it is possible to gain execution during a transfer. Upon
claimBribesFromHiddenHand
invocation, one can use the execution on token transfer inhiddenHandDistributor.claim(_claims);
to callmanualProcessExpiredLocks
orperformUpkeep
to claim rewards. Then, if AURA token was among the token claims in the primary call, the tokens received will be treated as a bribe instead of principal and they will be removed from the strategy, breaking the invariant that the strategy always has AURA in some form to cover debt to users.Tools Used
Manual analysis
Recommended Mitigation Steps
Apply a nonReentrant modifier to all functions that modify AURA balance.
The text was updated successfully, but these errors were encountered: