Once a malicious or compromised collateral token has been registered via _registerCollateralToken(), there is no mechanism to remove it from the system. This creates a persistent security risk as malicious tokens remain active indefinitely.
The AaveDIVAWrapper contract allows registration of collateral tokens but lacks a corresponding deregistration function. The token registration is irreversible due to:
The mappings _collateralTokenToWToken and _wTokenToCollateralToken can only be populated, never cleared
Once a token is registered, it remains permanently active for creating new positions
No admin function exists to remove compromised or malicious tokens
https://github.com/Cyfrin/2025-01-diva/blob/main/contracts/src/AaveDIVAWrapperCore.sol#L71
A token gets registered through _registerCollateralToken()
The token contract is later compromised or discovered to be malicious
Contract owner has no way to remove or deactivate the compromised token
New positions can still be created with the compromised token indefinitely
Implement a deregistration function with appropriate safety checks:
This is invalid. If the collateral token is not supported by Aave or invalid, the `registerCollateralToken` will revert. If the collateral token is deprecated by Aave due to a given issue, this is known issue: "Integration risk with both Aave V3 and DIVA Protocol - vulnerabilities in either protocol may affect AaveDIVAWrapper."
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.