The _getAccruedYieldPrivate
function in the AaveDIVAWrapperCore
contract calculates the yield by comparing the aTokenBalance
(Aave token balance held by the contract) to the wTokenSupply
(total supply of the wrapped token). If wTokenSupply
exceeds aTokenBalance
, the function incorrectly returns zero, even if there is accrued interest.
Incorrect Assumption:
The function assumes that wTokenSupply
accurately reflects the deposited principal on Aave. This assumption fails if wTokenSupply
is manipulated or desynchronized (e.g., through improper minting or re-entrancy).
Suppression of Yield:
If wTokenSupply
exceeds aTokenBalance
, the calculated yield reverts to zero, potentially locking accrued interest within the contract.
Rounding Issues:
The comments in the code mention rounding concerns, but these do not address cases where wTokenSupply
is inflated beyond aTokenBalance
due to bugs or exploits.
Lack of Emergency Recovery:
There is no fallback mechanism to recover and redistribute yield in case of a desynchronization between aTokenBalance
and wTokenSupply
.
This vulnerability can result in:
Suppression of yield calculations, causing users to be unable to claim accrued interest.
Exploitation by attackers to manipulate the wTokenSupply
and disrupt normal operations.
Permanent locking of accrued interest in the contract, impacting user funds and protocol efficiency.
Manual code review of the _getAccruedYieldPrivate
function implementation.
Analysis of contract assumptions and potential edge cases.
Track Deposited Principal:
Implement a mechanism to track the actual deposited principal for each collateral token, instead of relying on wTokenSupply
.
Use Principal-Based Yield Calculation:
Replace the wTokenSupply
dependency with a calculation based on the principal 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.