Description:
The function _registerCollateralToken
grants infinite approvals (type(uint256).max)
to both the DIVA Protocol (_diva) and Aave V3 (_aaveV3Pool). While this reduces gas costs for users, it exposes the contract to significant risk if either protocol is compromised. Malicious actors could exploit vulnerabilities in DIVA or Aave to drain all approved tokens from the AaveDIVAWrapper contract.
impact:
Funds Theft: If DIVA or Aave is exploited, attackers can transfer all tokens approved to them.
Protocol Dependency: The security of AaveDIVAWrapper is directly tied to the security of external protocols.
No Time for Mitigation: Users cannot react quickly enough to stop interactions during an active exploit
Proof of Concept:
Recomended Mitigation:
Use finite, Incremental Approvals
Implement a time-lock mechanism for approvals
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.