StabilizerNode
Is Vulnerable To Sandwich Attacks
#223
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Handle
leastwood
Vulnerability details
Impact
The permissionless
stabilize
function inStabilizerNode
is called to correct deviations in the Malt token price. When the price of Malt has appreciated above its peg, the function simply distributes rewards to LP token holders, effectively diluting the total Malt token supply. As the_distributeSupply
function interacts with a Uniswap pool without performing slippage checks, an attacker can call this function and launch a sandwich attack in combination with a flash loan to steal funds.A malicious user is potentially able to steal rewards that would otherwise be distributed to the protocol's users. As such, this issue should be considered high risk as this results in loss of funds.
Proof of Concept
Consider the following scenario:
stabilize
function inStabilizerNode
.StabilizerNode
contract buys rewards tokens at an inflated price.As shown above, attackers are able to siphon funds from users overtime.
https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/StabilizerNode.sol#L236
https://github.com/code-423n4/2021-11-malt/blob/main/src/contracts/DexHandlers/UniswapHandler.sol#L160-L183
Tools Used
Manual code review
Referenced Mochi review.
Recommended Mitigation Steps
Consider performing slippage checks within the
_distributeSupply
function. This can be done by simply performing a lower bounds check on the output amount received when exchanging Malt tokens for rewards tokens.The text was updated successfully, but these errors were encountered: