Skip to content
Business logic Audit finding Intermediate

Delisted assets can still be deposited and borrowed against by accounts that already have them

Delisting an asset does not prevent accounts that already hold it from depositing more by transferring tokens directly to their account contract, bypassing the deposit function. These accounts can continue to use the delisted asset as collateral, potentially allowing further borrowing or exploitation if delisting was meant to prevent a vulnerability.

0x52 Follow with Kumpa, devtooligan and 1 other

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-08-sentiment-judging/tree/main/154-M

Found by

0x52, Kumpa, devtooligan, WATCHPUG

Summary

Delisting an asset does not prevent accounts, that already contain the asset from depositing more. It blocks the deposit function but users can sidestep but sending tokens directly to their account

Vulnerability Detail

AccountManger.sol#deposit attempts to block deposits from assets that are not on the list of supported collateral. When calculating the health of the account, the total balance of the account address is considered. An account that already has the asset on it's assets list doesn't need to use AccountManger.sol#deposit because they can transfer the tokens directly to the account contract. This means that these account can continue to add to and use delisted assets as collateral.

Impact

One of two scenarios depending on actions taken by the protocol. If the asset is delisted from accountManager.sol and the oracle is removed then all users with loans taken against the asset will likely be immediately liquidated, which is highly unfair to users. If the asset is just delisted from accountManager.sol then existing users that already have the asset would be able to continue using the asset to take loans. If the reason an asset is being delisted is to prevent a vulnerability then the exploit would still be able to happen due to these accounts sidestepping deposit restrictions.

Code Snippet

AccountManager.sol#L162-L172

Tool used

Manual Review

Recommendation

Calculations for account health should be split into two distinct categories. When calculating the health of a position post-action, unsupported assets should not be considered in the total value of the account. When calculating the health of a position for liquidation, all assets on the asset list should be considered. This prevent any new borrowing against a delisted asset but doesn't risk all affected users being liquidated unfairly.

Sentiment Team

Fixed as recommended. PR here.

Lead Senior Watson

Confirmed fix.

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 account health calculation includes the total balance of the account address without checking whether each asset is still supported, so direct token transfers bypass the deposit restriction.

Impact

If the asset is delisted and its oracle removed, users with loans against it could be immediately liquidated; if only delisted, existing holders can keep using it as collateral, and if delisting was to prevent a vulnerability, the exploit could still happen.

What the attacker needed

Account already holds the delisted asset

The fix

The fix was to split health calculations: unsupported assets should not count towards the total value for post-action health checks, but all assets should be considered for liquidation health checks.

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.

In this system, users deposit tokens into a personal account contract and can borrow against them. The protocol can delist an asset to stop it being used as collateral, but the check only happens when you use the official deposit function. If you already have that asset in your account, you can just send more tokens directly to the account contract, and the system will still count them as collateral.

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 Sentiment Update #3

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.