code-423n4 / 2021-04-maple-findings

0 stars 0 forks source link

Default slippage value too high #106

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

janbro

Vulnerability details

Summary

Default slippage value too high.

Risk Rating

Medium

Vulnerability Details

MapleGlobals.sol Line 87: maxSwapSlippage = 1000; // 10 % The default slippage value of 10% is vulnerable to sandwich attackers which would shift larger costs onto stakers and LPs after a liquidation event. Flash loans can be utilized to manipulate the Uniswap price to an unfavorable rate for liquidation. This is effectively a liquidation penalty that gets distributed to front runners.

Impact

Liquidation event could cause more loss to stakers and liquidity providers than expected.

Proof of Concept

See https://cmichel.io/de-fi-sandwich-attacks/

Tools Used

Manual code review

Recommended Mitigation Steps

Set the default slippage to a lower value.

lucas-manuel commented 3 years ago

This is not a bug, it is intentionally set this way. There is a setMaxSwapSlippage setter in globals where we can update this value.

Arachnid commented 3 years ago

Unsafe defaults warrant a Note.

lucas-manuel commented 3 years ago

Note meaning an informational section issue right?

Arachnid commented 3 years ago

I mean that I'm rating it at 0/Note/Non-Critical. I assume that goes in the informational section, but I don't know how the final report will be constructed.