In the AaveDIVAWrapper contract, the _createContingentPool function constructs a new contingent pool on the DIVA protocol using the _collateralTokenToWToken mapping from AaveDIVAWrapperCore to convert the collateral token to its corresponding wToken:
This mapping is managed by _registerCollateralToken
in AaveDIVAWrapperCore, where it checks if a collateral token is already registered before setting the mapping:
However, there's no mechanism to ensure that this mapping is always up-to-date or synchronized between both contracts when _createContingentPool
is invoked. If the mapping is altered or corrupted due to an admin mistake or an exploit, the wrong wToken could be used, potentially leading to the creation of a pool with incorrect token parameters, thereby causing unexpected behavior or security vulnerabilities in the DIVA protocol.
Impact:
The primary impact would be incorrect pool creation, where pools are instantiated with mismatched or incorrect tokens, potentially leading to financial loss or miscalculation of options valuations.
Mitigation:
Implement an additional validation check in _createContingentPool
to confirm that the wToken corresponds to the given collateral token before proceeding with pool creation.
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.