The _claimYield function in the smart contract accepts the returned amount from Aave's withdraw function without validation against the expected withdrawal amount. This could lead to silent failures where less tokens are withdrawn than requested, potentially causing accounting inconsistencies and loss of funds.
Users may receive fewer tokens than they should without any reversion
Incorrect event emissions could mislead monitoring systems and users
Potential accounting discrepancies in the protocol
Risk of financial loss if integrated systems rely on event data
https://github.com/Cyfrin/2025-01-diva/blob/main/contracts/src/AaveDIVAWrapperCore.sol#L470
The function:
Calls Aave's withdraw without storing the expected amount
Emits an event with the returned amount without verification
Returns the amount without ensuring it matches the requested withdrawal
User attempts to withdraw 100 tokens of accrued yield
Due to liquidity constraints, Aave returns only 90 tokens
Function emits event with 90 tokens and returns successfully
User receives fewer tokens than entitled without any indication of partial withdrawal
Implement validation of the returned amount:
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.