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 Nov 5, 2023. It is now read-only.
sherlock-admin opened this issue
Apr 30, 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
AuraSpell executes swaps without slippage protection
Summary
The AuraSpell protocol executes swaps without slippage protection. That will cause a loss of funds because of sandwich attacks.
Vulnerability Detail
In AuraSpell .closePositionFarm() swaps are executed through the swapRouter.The amountOutMin value has been set to 0. Without slippage protection, this is vulnerable to sandwich attacks
for (uint256 i =0; i < rewardTokens.length; i++) {
uint256 rewards =_doCutRewardsFee(rewardTokens[i]);
_ensureApprove(rewardTokens[i], address(swapRouter), rewards);
swapRouter.swapExactTokensForTokens(
rewards,
0,
swapPath[i],
address(this),
type(uint256).max
);
}
Impact
Swaps will be sandwiched causing a loss of funds for users you withdraw their rewards.
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
Bauer
high
AuraSpell executes swaps without slippage protection
Summary
The AuraSpell protocol executes swaps without slippage protection. That will cause a loss of funds because of sandwich attacks.
Vulnerability Detail
In
AuraSpell .closePositionFarm()
swaps are executed through theswapRouter
.TheamountOutMin
value has been set to 0. Without slippage protection, this is vulnerable to sandwich attacksImpact
Swaps will be sandwiched causing a loss of funds for users you withdraw their rewards.
Code Snippet
https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/spell/AuraSpell.sol#L196-L202
Tool used
Manual Review
Recommendation
Calculate the maximum output and set slippage protection
Duplicate of #121
The text was updated successfully, but these errors were encountered: