This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
GimelSec - swap()
will be reverted if path
has more tokens.
#160
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
GimelSec
high
swap()
will be reverted ifpath
has more tokens.Summary
swap()
will be reverted ifpath
has more tokens, the keepers will not be able to successfully callswapForTau()
.Vulnerability Detail
In
test/SwapAdapters/00_UniswapSwapAdapter.ts
:We will get:
Then the
swapOutputToken
is_swapData[length - 41:length - 21]
.But if we have more tokens in path:
swapOutputToken
is_swapData[length - 50:length - 30]
, theswap()
function will be reverted.Impact
The keepers will not be able to successfully call
SwapHandler.swapForTau()
. Someone will get a reverted transaction if they misuseUniswapSwapAdapter
.Code Snippet
https://github.com/sherlock-audit/2023-03-taurus/blob/main/taurus-contracts/contracts/SwapAdapters/UniswapSwapAdapter.sol#L30
Tool used
Manual Review
Recommendation
Limit the swap pools, or check if the balance of
_outputToken
should exceed_amountOutMinimum
.The text was updated successfully, but these errors were encountered: