User can add liquidity with tokens' amount less than DUST
Proof of Concept
Follow author's expectation, when users try to add liquidity, we need to make sure that tokens' amount should be not less than DUST. We add some input check by
require( maxAmountA > PoolUtils.DUST, "The amount of tokenA to add is too small" );
require( maxAmountB > PoolUtils.DUST, "The amount of tokenB to add is too small" );
However, the actual amounts transferred in pool is addedAmountA/addedAmountB.
We should add another check to make sure both addedAmountA/addedAmountB are not less than DUST.
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/pools/Pools.sol#L140-L165
Vulnerability details
Impact
User can add liquidity with tokens' amount less than DUST
Proof of Concept
Follow author's expectation, when users try to add liquidity, we need to make sure that tokens' amount should be not less than DUST. We add some input check by
However, the actual amounts transferred in pool is addedAmountA/addedAmountB. We should add another check to make sure both addedAmountA/addedAmountB are not less than DUST.
Tools Used
Manual
Recommended Mitigation Steps
N/A
Assessed type
Invalid Validation