Skip to content
Business logic Audit finding Intermediate

Removed reward tokens will no longer be claimable and will cause loss of funds to users who haven't claimed

When a reward token is removed from the vault, its entire reward struct is deleted from the array, so the claim loop no longer includes it. Users who had not yet claimed that token permanently lose their unclaimed rewards.

Cryptor Follow with CRYP70, kiki_dev and 8 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-02-olympus-judging/issues/127

Found by

Cryptor, CRYP70, kiki_dev, Bauer, hansfriese, HonorLt, gerdusx, KingNFT, 0x52, Ruhum, rvierdiiev

Summary

When a reward token is removed, it's entire reward structs is deleted from the reward token array. The results is that after it has been removed it is impossible to claim. User's who haven't claimed will permanently lose all their unclaimed rewards.

Vulnerability Detail

https://github.com/sherlock-audit/2023-02-olympus/blob/main/src/policies/lending/abstracts/SingleSidedLiquidityVault.sol#L694-L703

When a reward token is removed the entire reward token struct is deleted from the array

https://github.com/sherlock-audit/2023-02-olympus/blob/main/src/policies/lending/abstracts/SingleSidedLiquidityVault.sol#L288-L310

When claiming rewards it cycles through the current reward token array and claims each token. As a result of this, after a reward token has been removed it becomes impossible to claim. Any unclaimed balance that a user had will be permanently lost.

Submitting this as high because the way that internal tokens are accrued (see "Internal reward tokens can and likely will over commit rewards") will force this issue and therefore loss of funds to users to happen.

Impact

Users will lose all unclaimed rewards when a reward token is removed

Code Snippet

https://github.com/sherlock-audit/2023-02-olympus/blob/main/src/policies/lending/abstracts/SingleSidedLiquidityVault.sol#L694-L703

https://github.com/sherlock-audit/2023-02-olympus/blob/main/src/policies/lending/abstracts/SingleSidedLiquidityVault.sol#L723-L732

Tool used

ChatGPT

Recommendation

When a reward token is removed it should be moved into a "claim only" mode. In this state rewards will no longer accrue but all outstanding balances will still be claimable.

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

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 removal function deletes the whole reward token struct instead of keeping it in a claim-only state, and the claim loop only iterates over currently listed tokens.

Impact

Users lose all unclaimed rewards for a token once it is removed, and the report argues this will likely happen because of how internal tokens accrue.

What the attacker needed

Admin removes a reward token; user has unclaimed rewards for it

The fix

Removed reward tokens should be moved into a claim-only mode so they stop accruing but outstanding balances remain claimable.

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 vault lets people earn several kinds of reward tokens and claim them later. The code keeps a list of reward tokens and pays out by walking that list. If an admin removes a token from the list, the record of what each user earned for it is deleted too, so those earnings can no longer be paid out.

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 Cryptor

View all

18 more disclosed reports, best first.

More from Olympus RBS 2.0

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.