Several critical functions within the AaveDIVAWrapper contract fail to validate that recipient address parameters (e.g., _recipient, _longRecipient, _shortRecipient) are non-zero addresses. This oversight could result in users accidentally losing funds by specifying address(0) as a recipient.
_addLiquidity: Does not validate _longRecipient or _shortRecipient.
addLiquidity: Inherits the lack of validation from the internal _addLiquidity function.
batchAddLiquidity: Passes unvalidated recipient addresses from AddLiquidityArgs structs.
removeLiquidity: Fails to validate the _recipient parameter.
redeemPositionToken: Does not check _recipient for address(0).
Unvalidated Recipient in _addLiquidity:
Unvalidated Recipient in removeLiquidity:
Loss of Funds: If a user mistakenly provides address(0) as a recipient, tokens (e.g., position tokens, collateral) will be permanently locked in the zero address.
Low Probability: Requires user error, but consequences are irreversible.
Manual Code Review
Static Analysis
Add Zero-Address Checks:
Include require(_recipient != address(0), "Invalid recipient") in all functions accepting recipient addresses.
Standardize Validation:
Ensure consistency across all functions (e.g., claimYield already validates _recipient).
_addLiquidity:The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.