Skip to content
Business logic Audit finding Intermediate

Rewards compounded in AaveStrategy are unredeemable

The AaveStrategy contract's compound function claims AAVE rewards but does not redeem them from the staking contract, so the rewards remain staked and cannot be accessed. An attacker cannot directly exploit this, but the protocol loses the compounded rewards.

Ack Follow with kaden and rvierdiiev

Originally disclosed on Code4rena

Submitted by Ack, also found by kaden and rvierdiiev

The AaveStrategy contract is designed to:

  1. Receive depositor’s ERC20 tokens from yieldBox
  2. Deposit those tokens into an AAVE lending pool
  3. Allow anyone to call compound(), which: a. Claims AAVE rewards from the incentivesController b. Claims staking rewards from the stakingRewardToken (stkAAVE) c. Redeeming staking rewards is only possible within a certain cooldown window that is set by AAVE governance. The function resets the cooldown if either 12 days have passed since the cooldown was last initiated, or if the strategy has a stakedRewardToken balance d. Swaps any received rewardToken ($AAVE) for wrappedNative e. Deposits the wrappedNative received in the swap into the lending pool

There are several issues with this flow, but this vulnerability report is specific to redeeming staked rewards. The incentives controller specified in the mainnet.env file is at address 0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5 (proxy). Its claimRewards function stakes tokens directly:

  function _claimRewards(
    ...
  ) internal returns (uint256) {
    ...
    uint256 accruedRewards = _claimRewards(user, userState);
    ...
    STAKE_TOKEN.stake(to, amountToClaim); //@audit claimed rewards are staked immediately
    ...
  }

The only way to retrieve tokens once staked is via a call to stakingRewardToken#redeem(), which is not present in the AaveStrategy contract. As a result, any rewards accumulated via the incentiveController would not be claimable.

Impact

High - Loss of funds

Proof of concept

This is unfortunately difficult to PoC as the AAVE incentive/staking rewards do not accumulate properly in the fork tests, and the mocks do not exhibit the same behavior.

Recommended Mitigation Steps

Include a call to redeem in compound().

0xRektora (Tapioca) confirmed via duplicate issue 243


The original report as published on Code4rena, by Ack. 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

Impact

The rewards accumulated via the incentive controller are not claimable, leading to a loss of funds for the protocol.

What the attacker needed

None

The fix

The compound function should include a call to redeem the staked rewards.

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.

When the strategy earns rewards, those rewards are automatically locked in a staking contract. To get them back, you must call a special function to redeem them. The strategy never calls that function, so the rewards stay stuck forever.

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 Ack

View all

3 more disclosed reports, best first.

More from Tapioca Invitational

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.