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

missing input validation _poolParams

Summary

_poolParams struct input are not all validated.

Vulnerability Details

The createContingentPool function is directly passing the _poolParams struct to _createContingentPool without performing any input validation at the external function level. This can be risky because _poolParams is being supplied by external users.

_poolParams.collateralToken is the only one validated

Impact:

it could lead to unwanted behavior, such as:

  • Tokens being sent to address(0) (effectively burning them).

  • Failed transactions when interacting with the DIVA Protocol or Aave due to invalid inputs.

Tools Used

Manual review

Recommendations

  • Validation of the params in the createContingentPool :

    if (_poolParams.longRecipient == address(0) || _poolParams.shortRecipient == address(0)) {
    revert ZeroAddress(); } idity
    if (_poolParams.dataProvider == address(0)) {
    revert ZeroAddress();
    if (_poolParams.collateralAmount == 0) {
    revert ZeroAmount(); }
    etc....
Updates

Lead Judging Commences

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

Support

FAQs

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