The _handleTokenOperations
function in AaveDIVAWrapperCore.sol interacts with Aave V3 through the supply
operation and immediately mints wTokens based on the collateral amount without validating the success of the supply operation. This leads to a potential mismatch between minted wTokens and their expected backing in aTokens.
No Validation of Aave supply()
Success:
The contract assumes the Aave supply()
function always succeeds. However, in certain edge cases (e.g., token incompatibility or precision issues), the operation might fail silently or return unexpected values.
There is no check to verify whether the expected amount of aTokens was received after the supply operation.
Immediate Minting of wTokens:
The contract mints wTokens equivalent to the _collateralAmount
without confirming the receipt of the corresponding aTokens. This creates the risk of minting unbacked wTokens.
Missing aToken Balance Validation:
The contract does not compare the aToken balance before and after the supply()
call to ensure that the supply operation was successful.
Broken 1:1 Backing:
Unbacked wTokens may be minted if the supply()
operation fails or behaves unexpectedly. This could undermine the integrity of the collateralization mechanism.
Financial Exploitation:
Malicious actors could potentially exploit this issue to create unbacked wTokens, causing financial harm to the protocol and its users.
Loss of User Funds:
Users may deposit collateral without receiving the corresponding wTokens or aTokens, leading to potential financial losses and trust issues.
Manual Code Review:
Inspected the _handleTokenOperations
function for missing validation logic and improper handling of Aave operations.
Implement a check for the contract's aToken balance before and after the supply()
operation to ensure the correct amount of aTokens was received. For example:
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.