Potential manipulation of liquidity pools due to tokens with arbitrary minting capabilities.
Summary
Potential manipulation of liquidity pools due to tokens with arbitrary minting capabilities.
Vulnerability Detail
The _addLiquidityfunction is designed to add liquidity based on current reserves of the token pair. If a token in the pair can be arbitrarily minted, an attacker could inflate the reserves by depositing a large number of minted tokens just before a legitimate liquidity addition transaction is confirmed, thus affecting the price ratio and the amount of liquidity tokens the user receives.
Impact
Users may receive fewer liquidity tokens than expected, leading to a loss of funds
Tokens with arbitrary minting capabilities should not be allowed in liquidity pools, or their minting function should be restricted to a governance process.
Implement additional validation to detect significant changes in reserves that occur between the initiation and execution of liquidity addition transactions.
Nyxaris
high
Potential manipulation of liquidity pools due to tokens with arbitrary minting capabilities.
Summary
Potential manipulation of liquidity pools due to tokens with arbitrary minting capabilities.
Vulnerability Detail
The
_addLiquidity
function is designed to add liquidity based on current reserves of the token pair. If a token in the pair can be arbitrarily minted, an attacker could inflate the reserves by depositing a large number of minted tokens just before a legitimate liquidity addition transaction is confirmed, thus affecting the price ratio and the amount of liquidity tokens the user receives.Impact
Users may receive fewer liquidity tokens than expected, leading to a loss of funds
Code Snippet
code
Tool used
Manual Review
Recommendation
Tokens with arbitrary minting capabilities should not be allowed in liquidity pools, or their minting function should be restricted to a governance process. Implement additional validation to detect significant changes in reserves that occur between the initiation and execution of liquidity addition transactions.
Duplicate of #246