You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
BugBusters - _calc_min_amount_out is ieffective in execute_dca_order function and exposes user to unlimited slippage and user funds can be drained,
#206
Closed
sherlock-admin opened this issue
Jul 5, 2023
· 0 comments
sherlock-admin opened this issue
Jul 5, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
_calc_min_amount_out is ieffective in execute_dca_order function and exposes user to unlimited slippage and user funds can be drained,
Summary
_calc_min_amount_out is ieffective in execute_dca_order function and exposes user to unlimited slippage, as execute_dca function is callable by anyone.
Vulnerability Detail
Anyone can call the execute_dca function in the Dca.vy passing its own arguments but the problem is that :
In uniswap v3 an attacker can create a pool with ultra low liquidity and maintain the TWAP price of his own for certain length of time, that should not be hard and even easier on arbitrum.
Attacker will call the execute_dca_order function with his own pool path.
_calc_min_amount_out will be called with the passed arguments and price will be calculated wrong and will expose the user to unnecessary unlimited slippage and snadwich attacks.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
BugBusters
high
_calc_min_amount_out is ieffective in execute_dca_order function and exposes user to unlimited slippage and user funds can be drained,
Summary
_calc_min_amount_out is ieffective in execute_dca_order function and exposes user to unlimited slippage, as execute_dca function is callable by anyone.
Vulnerability Detail
Anyone can call the
execute_dca
function in the Dca.vy passing its own arguments but the problem is that :_calc_min_amount_out
will be called with the passed arguments and price will be calculated wrong and will expose the user to unnecessary unlimited slippage and snadwich attacks.Also another case could be
https://github.com/sherlock-audit/2023-06-unstoppable/blob/94a68e49971bc6942c75da76720f7170d46c0150/unstoppable-dex-audit/contracts/spot-dex/Dca.vy#L215-L222
For more reference check the following issue in splits Sherlock competition:
(https://github.com/sherlock-audit/2023-04-splits-judging#issue-m-3-tokens-without-univ3-pairs-with-tokentobeneficiary-can-be-stolen-by-an-attacker) [Splits Uniswap vulnerability]
Impact
Exposed to unlimited slippage or user funds can be drained.
Code Snippet
Tool used
Manual Review
Recommendation
This function should not be public or there should be liquidity checks when performing swaps on uniswap.
Duplicate of #182
The text was updated successfully, but these errors were encountered: