Skip to content
Business logic Audit finding Beginner

Collateral can be deposited in a finished pool

The depositCollateral function does not check the pool's status, so collateral can be deposited into a finished loan. This can happen by mistake and all funds will be lost.

pedroais Follow

Originally disclosed on Code4rena

Submitted by pedroais

Proof of Concept

The depositCollateral function doesn’t check the status of the pool so collateral can be deposited in a finished loan. This can happen by mistake and all funds will be lost.

https://github.com/code-423n4/2021-12-sublime/blob/9df1b7c4247f8631647c7627a8da9bdc16db8b11/contracts/Pool/Pool.sol#L207

Recommended Mitigation Steps

Require loan status to be collection or active in the depositCollateral function.

ritik99 (Sublime) disagreed with severity:

We will add a check for this. The issue however stems from user error. Sending assets to an address without proper checks does not constitute an attack path imo. We would suggest a rating of (1) Low or (0) non-critical given the low likelihood and the impact of the attack (only the user making the incorrect transaction is affected)

0xean (judge) commented:

2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.

This definitely qualifies as “external requirements” and a simple check would assist in avoid it.

The original report as published on Code4rena, by pedroais. 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 depositCollateral function lacks a check that the pool status is active or collection.

Impact

A user could lose funds by mistakenly depositing collateral into a finished loan; the program argued this is user error, but the judge rated it medium severity.

What the attacker needed

User mistakenly deposits into finished loan

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 function that lets users add collateral does not verify whether the loan is still active. If someone accidentally sends funds to a loan that has already ended, those funds are stuck and lost.

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 pedroais

View all

6 more disclosed reports, best first.

More from Sublime 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.