Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

TheNaubit - Rebalancer executes swaps without slippage protection #211

Closed
sherlock-admin opened this issue May 23, 2023 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented May 23, 2023

TheNaubit

high

Rebalancer executes swaps without slippage protection

Summary

The rebalancer contract calls USSD#UniV3SwapInput function that executes swaps without slippage protection. That will cause a loss of funds because of sandwich attacks.

Vulnerability Detail

The UniV3SwapInput function calls the Uniswap V3 function ExactInputParams to perform swaps (used to rebalance the protocol) but it is setting the param amountOutMinimum to 0, meaning there is no slippage protection in this swap.

Here is a similar report in the past: sherlock-audit/2023-01-derby-judging#64

Impact

Having set the amountOutMinimum param to 0 means there is no slippage protection in the swap. Therefore swaps will be sandwiched causing a loss of funds every time the protocol rebalances.

Code Snippet

https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/USSD.sol#L237

Tool used

Manual Review

Recommendation

Slippage parameter should be included in the function call and not be 0.

Duplicate of #673

@github-actions github-actions bot closed this as completed Jun 5, 2023
@github-actions github-actions bot added High A valid High severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jun 5, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant