Platform: Code4rena
Start Date: 15/06/2022
Pot Size: $30,000 USDC
Total HM: 5
Participants: 55
Period: 3 days
Judge: Jack the Pug
Id: 138
League: ETH
Rank: 14/55
Findings: 2
Award: $286.30
π Selected for report: 1
π Solo Findings: 0
π Selected for report: Picodes
Also found by: 0x1f8b, 0x52, Chom, GimelSec, IllIllI, berndartmueller, cccz, defsec, georgypetrov, hyh, kenzo, minhquanym, oyc_109, scaraven, unforgiven
50.7077 USDC - $50.71
When exiting the BAL/ETH
pool, due to not specifying anything for minAmountsOut
an attacker can frontrun the transaction and cause a large change in price in the pool. This in turn leads to a large impermanent loss which is realised when the strategy burns its liquidity tokens.
I believe this a high severity issue because this can cause a large substantial loss of yield thereby rendering the whole purpose of the entire strategy meaningless.
BAL/ETH
pool which goes into the mempoolETH
or BAL
VS Code
Use queryExit()
from BalancerHelpers
to specify a value for minAmountsIn
as shown here
Make sure to do this before the transaction containing _harvest()
is run
#0 - KenzoAgada
2022-06-22T10:23:13Z
Duplicate of #155
π Selected for report: scaraven
Also found by: GimelSec, berndartmueller, cccz, dipp, kenzo, kirk-baird, unforgiven
235.5937 USDC - $235.59
https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L428-L430 https://github.com/Badger-Finance/badger-vaults-1.5/blob/3c96bd83e9400671256b235422f63644f1ae3d2a/contracts/BaseStrategy.sol#L351 https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L407-L408
If the contract receives rewards from the hidden hand marketplace in BADGER then the contract tries to transfer the same amount of tokens twice to two different accounts, once with _sendBadgerToTree()
in MyStrategy
and again with _processExtraToken()
in the BasicStrategy
contract. As it is very likely that the strategy will not start with any BADGER tokens, the second transfer will revert (as we are using safeTransfer). This means that claimBribesFromHiddenHand()
will always revert preventing any other bribes from being received.
claimBribesFromHiddenHand()
is called by strategist_handleRewardTransfer()
which calls _sendBadgerToTree()
. 50 BADGER is sent to the Badger Tree so balance has dropped to 0.VS Code
_processExtraToken()
eventually sends the badger to the badger tree through the Vault
contract. Change
function _sendBadgerToTree(uint256 amount) internal { IERC20Upgradeable(BADGER).safeTransfer(BADGER_TREE, amount); _processExtraToken(address(BADGER), amount); }
to
function _sendBadgerToTree(uint256 amount) internal { _processExtraToken(address(BADGER), amount); }
#0 - GalloDaSballo
2022-06-19T01:02:41Z
Developer oversight yeah
#1 - shuklaayush
2022-06-20T20:12:10Z
Yeah, badger bribes can't be claimed. Not sure if I'll call it high risk but definitely an oversight
#2 - KenzoAgada
2022-06-21T12:57:36Z
Duplicate of #2
#3 - GalloDaSballo
2022-07-13T22:31:22Z
We mitigated by fixing the mistake