Closed sherlock-admin closed 11 months ago
This would fail on multiple levels, depositTrades are input by the vault user and therefore this would mean that they somehow constructed a malicious trade that would only hurt themselves. Furthermore, there would also have to be a trading venue open for BPT tokens. Given that ZERO_EX is excluded from the list explicitly because it may contain some sort of malicious RFQ order I'm not sure how a user would actually end up in this scenario.
Finally, this would fail because in a dynamic slippage trade there would not be any price oracle listed for the BPT token.
xiaoming90
medium
BPT could be brought during deposit trade
Summary
BPT could be brought during deposit trade. Since the join operation of the Balancer pool does not accept BPT, the excess BPT swapped will be useless. This resulted in fewer LP tokens being minted.
Vulnerability Detail
https://github.com/sherlock-audit/2023-10-notional/blob/main/leveraged-vaults/contracts/vaults/common/StrategyUtils.sol#L36
For the composable pool, the
TOKENS()
returned will consist of the Balancer LP Token (BPT)The validation at Line 36 ensures that the primary token cannot be sold in exchange for the primary token. However, it does not ensure that the primary token cannot be sold in exchange for the Balancer LP Token (BPT).
Impact
BPT could be brought during deposit trade. Since the join operation of the Balancer pool does not accept BPT, the excess BPT swapped will be useless. This resulted in fewer LP tokens being minted.
Code Snippet
https://github.com/sherlock-audit/2023-10-notional/blob/main/leveraged-vaults/contracts/vaults/common/StrategyUtils.sol#L36
Tool used
Manual Review
Recommendation
Consider adding an additional validation to ensure that the buy token cannot be BPT.