HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

Missing validation check for zero collateralAmount when adding liquidity, AaveDIVAWrapper.sol

Summary

Function addLiquidity is external and allows users to add liquidity, but it doesn't check for zero collateralAmount.

Vulnerability Details

There is no restriction on the minimum collateralAmount, allowing users to add liquidity without depositing any collateral.

function addLiquidity(
bytes32 _poolId,
uint256 _collateralAmount,
address _longRecipient,
address _shortRecipient
) external override nonReentrant {
_addLiquidity(_poolId, _collateralAmount, _longRecipient, _shortRecipient);
}

Impact

The vulnerability allows users to add liquidity without depositing any collateral. This could result in liquidity pools being manipulated by malicious actors who exploit the lack of a zero-collateral check. The system might become vulnerable to attacks. Without a proper check, it may also cause unexpected behavior in further functions relying on liquidity amounts.

Tools Used

Manual review

Recommendations

Add a require to check that collateralAmount can't be zero.

require(_collateralAmount > 0, "AaveDIVAWrapper: collateral amount must be greater than zero");
Updates

Lead Judging Commences

bube Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.