Skip to content
Business logic Audit finding Intermediate

rescueToken doesn't update rewardToken.lastBalance for external reward tokens

The rescueToken function allows the admin to withdraw tokens from the vault, but it does not update the rewardToken.lastBalance for external reward tokens. If the vault is later reactivated, the token accounting will be permanently broken, causing incorrect reward distribution.

0x52 Follow

Originally disclosed on Sherlock

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

Found by

0x52

Summary

SingleSidedLiquidityVault allows the admin tokens from the vault contract. This can only be done once the vault has been deactivated but there is nothing stopping the contract from being reactivated after a token has been rescued. If an external reward token is rescued then the token accounting will be permanently broken after when/if the vault is re-enabled.

Vulnerability Detail

See summary.

Impact

External reward tokens are broken after being rescued

Code Snippet

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

Tool used

ChatGPT

Recommendation

If the token being rescued is an external reward token then rescueToken should update rewardToken.lastBalance

The original report as published on Sherlock, by 0x52. 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 rescueToken function does not update rewardToken.lastBalance when rescuing an external reward token.

Impact

External reward tokens are broken after being rescued, leading to permanently broken token accounting if the vault is re-enabled.

What the attacker needed

Vault must be deactivated; admin rescues external reward token; vault is reactivated

The fix

The rescueToken function should update rewardToken.lastBalance when the rescued token is an external reward token.

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 contract lets an admin rescue tokens, but when it rescues a reward token, it forgets to update a record of how many tokens the vault holds. If the vault is turned back on, the record is wrong, so rewards are calculated incorrectly.

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 0x52

View all

211 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.