Skip to content
Business logic Audit finding Intermediate

Issue 290 from previous contest has not been fully addressed by fixes

The report points out that a previous fix to prevent liquidations during a repay pause is incomplete: users who become liquidatable while repay is paused can still be liquidated immediately after repay is re-enabled, because MEV bots can frontrun any repayment attempt. This leaves users unable to save their positions.

0x52 Follow with HonorLt and cducrest-brainbot

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-04-blueberry-judging/issues/117

Found by

0x52, HonorLt, cducrest-brainbot

Summary

Issue 290 from the previous contest points out that users may be liquidated without the chance to repay their debt. Liquidate was changed to only be allowed when repayment was allowed. While this does address some of the problem this will still fail to protect users who become liquidatable during the period of time that repay has been disabled.

MEV bots are typically used to liquidate positions since it is always more profitable to liquidate the vault even if a user tries to pay off their debt on the same black that repay is enabled, they will still be liquidated because of frontrunning.

Vulnerability Detail

See summary.

Impact

Users who become liquidatable during a repay pause will still be unable to save their position

Code Snippet

BlueBerryBank.sol#L487-L548

Tool used

Manual Review

Recommendation

When repay is paused and then resumed, put a timer that prevents liquidations for some amount of time after (i.e. 4 hours) so that users can fairly repay their position after repayment has been resumed.

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 fix only disabled liquidations while repay was paused, but did not add a grace period after repay resumed, allowing frontrunning of repayments.

Impact

Users who become liquidatable during a repay pause may still be liquidated immediately after repay resumes, as MEV bots can frontrun repayment attempts.

What the attacker needed

Repay is paused; user becomes liquidatable during pause; MEV bots frontrun repay

The fix

A timer should be added after repay is resumed to prevent liquidations for a period (e.g., 4 hours) so users can repay.

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 some lending systems, users can be liquidated (have their collateral taken) if their debt becomes unsafe. The system can pause repayments, but if someone becomes unsafe during that pause, they cannot repay. When repayments resume, automated bots can quickly liquidate them before they can repay. This report says the previous fix did not fully solve that problem.

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