code-423n4 / 2024-03-saltyio-mitigation-findings

0 stars 0 forks source link

M-28 MitigationConfirmed #56

Open c4-bot-9 opened 7 months ago

c4-bot-9 commented 7 months ago

Lines of code

Vulnerability details

Summary

M-28 highlighted how the slippage protection for the initial deposit which was based only on the minimum shares being issued, was ineffective. A front-run attack made it possible for the attacker to profit. This was because incorrect token ratios could be issued even while keeping the minShares same.

Mitigation

The changes in commit have now added minAddedAmountA and minAddedAmountB params while adding liquidity. M-28 only applied to the first deposit and this fix now mitigates the issue since we can now specify the minimum amount of each token, making the mechanics of the shown front-run attack redundant.

Conclusion

LGTM

c4-judge commented 6 months ago

Picodes marked the issue as satisfactory