Summary
The _getAccruedYieldPrivate function incorrectly calculates yield by relying on aTokenBalance, which does not automatically reflect accrued interest unless an interaction occurs (e.g., supply, withdraw). Since Aave accrues interest continuously, but aTokenBalance updates only when a state-changing transaction occurs, yield may be underestimated, leading to users losing earned yield over time.
Aave’s aToken Balance Does Not Automatically Reflect Accrued Interest
Aave accrues interest continuously based on lending pool activity.
However, aTokenBalance only updates when a state-changing function is called (e.g., supply, withdraw).
If no interactions occur for an extended period, the function underestimates the actual accrued yield.
Users Will Lose Earned Yield Until a State-Changing Interaction Occurs
If no supply() or withdraw() calls are made, the yield remains unaccounted for.
This means users claiming yield may receive less than what they should.
A user deposits collateral into Aave via the protocol.
The protocol earns yield over several months due to Aave’s interest accrual.
The user attempts to claim yield using _getAccruedYieldPrivate().
Issue: Since no supply() or withdraw() occurred recently, aTokenBalance does not reflect the latest interest accrued.
Result: The user receives less yield than they should have earned.
Users are financially impacted, losing legitimate earnings.
The protocol appears unreliable, as users will notice discrepancies in expected yield.
An attacker observes that yield is being underreported.
They wait until substantial yield has accumulated unclaimed.
The attacker triggers a small supply() or withdraw() transaction, forcing Aave to update aTokenBalance.
The attacker immediately claims the updated yield, getting more than expected before legitimate users claim.
Malicious users claim more yield at the expense of others.
Legitimate users unknowingly lose their rightful yield due to stale balance tracking.
The following PoC demonstrates how an attacker could refresh aTokenBalance and claim extra yield before regular users.
Expected output:
supply()✅ This forces Aave to update aTokenBalance with accrued interest.
Expected output:
✅ Attacker claims extra yield before regular users update their calculations.
Likelihood: ✅ High (Occurs naturally in the protocol)
Impact: ✅ High (Users lose legitimate yield)
❌ Users lose out on accrued yield due to delayed balance updates.
❌ Attacker can claim extra yield at the expense of regular users.
❌ Protocol appears unreliable, affecting user trust.
scaledBalanceOf and Liquidity IndexInstead of using aTokenBalance, use Aave’s liquidity index to factor in accrued interest dynamically.
✅ Accounts for accrued interest in real-time.
✅ Ensures yield is always accurate.
Periodically refresh the Aave aToken balance by triggering supply() or withdraw().
✅ Ensures balance remains up-to-date.
✅ Prevents yield underreporting.
Allow users to force a balance update before claiming yield.
✅ Ensures users always claim accurate yield.
✅ Prevents front-running yield refresh exploits.
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.