code-423n4 / 2021-07-spartan-findings

0 stars 0 forks source link

`removeLiquiditySingle` loses funds #162

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

cmichel

Vulnerability details

Vulnerability Details

The Pool.removeLiquiditySingle function redeems liquidity tokens for underlying to the router contract. If toBase == true, it then tries to convert these to base tokens. However, only the swapped token -> BASE amount is sent to the user, the redeemed part is still in the router and can be stolen by any other user.

Recommended Mitigation Steps

Send the entire BASE amount of the router to the member instead of only the swapped amount.

SamusElderg commented 3 years ago

Duplicate of #133