The Pool.removeLiquiditySingle function redeems liquidity tokens for underlying to the router contract in case of the token being the zero address.
This works if the underlying token is actually WBNB but if the pool token is different and the user accidentally inserted 0 as the token address, it tries to swap a zero-balance WBNB to BASE and the redeemed tokens are stuck.
Recommended Mitigation Steps
If token == 0 add a check for pool.token == WBNB such that it is ensured that the pool's token is actually WBNB.
Handle
cmichel
Vulnerability details
Vulnerability Details
The
Pool.removeLiquiditySingle
function redeems liquidity tokens for underlying to the router contract in case of thetoken
being the zero address. This works if the underlying token is actuallyWBNB
but if the pool token is different and the user accidentally inserted0
as thetoken
address, it tries to swap a zero-balance WBNB toBASE
and the redeemed tokens are stuck.Recommended Mitigation Steps
If
token == 0
add a check forpool.token == WBNB
such that it is ensured that the pool's token is actuallyWBNB
.