sherlock-audit / 2024-02-jala-swap-judging

6 stars 4 forks source link

smbv-1919 - A malicious user can grief and DOS a user while he is trying to remove Liquidity #239

Closed sherlock-admin2 closed 6 months ago

sherlock-admin2 commented 6 months ago

smbv-1919

medium

A malicious user can grief and DOS a user while he is trying to remove Liquidity

Summary

A malicious user can grief and DOS a user while he is trying to remove Liquidity using removeLiquidityWithPermit() and removeLiquidityETHWithPermit()

Vulnerability Detail

-The removeLiquidityWithPermit() and removeLiquidityETHWithPermit() uses permit function to give approve to router contract for the LP tokens and removal of liquidity in the same transaction rather than approving the LP token manually from contract address.

Impact

Malicious user can grief and DOS user when he calls removeLiquidityWithPermit() and removeLiquidityETHWithPermit() so whenever the user does the transaction it would get fail and can't remove the liquidity at that particular transaction.

Code Snippet

https://github.com/sherlock-audit/2024-02-jala-swap/blob/main/jalaswap-dex-contract/contracts/JalaRouter02.sol#L169 https://github.com/sherlock-audit/2024-02-jala-swap/blob/main/jalaswap-dex-contract/contracts/JalaRouter02.sol#L150

Tool used

Manual review

Recommendation

Duplicate of #177