Skip to content
Business logic Audit finding Intermediate

Withdraw from AaveVault will receive less than actual share

The AaveVault caches its total value locked (tvl) and only updates it at the end of each push and pull. When a user withdraws from LpIssuer, the token amounts are calculated using this stale cached tvl, so the user receives less than their actual share of accrued interest or donations.

gzeon Follow

Originally disclosed on Code4rena

Submitted by gzeon

Impact

AaveVault cache tvl and update it at the end of each _push and _pull. When withdrawing from LpIssuer, tokenAmounts is calculated using the cached tvl to be pulled from AaveVault. This will lead to user missing out their share of the accrued interest / donations to Aave since the last updateTvls.

Proof of Concept

Recommended Mitigation Steps

Call updateTvls at the beginning of withdraw function if the _subvault will cache tvl

MihanixA (Mellow Protocol) confirmed

The original report as published on Code4rena, by gzeon. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the vault's cached total value is not updated before withdrawal calculations, so stale data is used.

Impact

A user withdrawing could receive less than their fair share of interest or donations accrued since the last tvl update.

What the attacker needed

User has funds in AaveVault; interest or donations accrued since last update

The fix

The withdraw function should call updateTvls at the beginning if the subvault caches tvl.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract keeps a saved number for how much money is in a vault. That number is only refreshed at certain times. If you take your money out before it is refreshed, the contract uses the old, lower number to decide how much you get, so you lose some of the interest you earned.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by gzeon

View all

46 more disclosed reports, best first.

More from Mellow Protocol contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.