Skip to content
DoS Audit finding Intermediate

`LienToken.buyoutLien` will always revert

The buyout fee denominator is set to zero and cannot be changed, causing the buyoutLien function to always revert. This prevents borrowers from refinancing their loans, potentially locking them into worse terms.

8olidity Follow with rvierdiiev, supernova and 6 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/196

Found by

8olidity, rvierdiiev, supernova, neila, yixxas, ctf_sec, 0xRajeev, cccz, zzykxx

Summary

buyoutLien() will always revert, preventing the borrower from refinancing.

Vulnerability Detail

buyoutFeeDenominator is 0 without a setter which will cause getBuyoutFee() to revert in the buyoutLien() flow.

Impact

Refinancing is a crucial feature of the protocol to allow a borrower to refinance their loan if a certain minimum improvement of interest rate or duration is offered. The reverting buyoutLien() flow will prevent the borrower from refinancing and effectively lead to loss of their funds due to lock-in into currently held loans when better terms are available.

Code Snippet

  1. https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/AstariaRouter.sol#L71
  2. https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/AstariaRouter.sol#L456
  3. https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/LienToken.sol#L377
  4. https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/LienToken.sol#L132

Tool used

Manual Review

Recommendation

Initialize the buyout fee numerator and denominator in AstariaRouter and add their setters to file().

Discussion

secureum

Escalate for 2 USDC.

Given the potential impact to different flows/contexts, we still think this is a high-severity impact (not Medium as judged). A majority of the dups (while some are dups of a different but related issue) also reported this as a High.

cc @berndartmueller @lucyoa

sherlock-admin

Escalate for 2 USDC.

Given the potential impact to different flows/contexts, we still think this is a high-severity impact (not Medium as judged). A majority of the dups (while some are dups of a different but related issue) also reported this as a High.

cc @berndartmueller @lucyoa

You've created a valid escalation for 2 USDC!

To remove the escalation from consideration: Delete your comment. To change the amount you've staked on this escalation: Edit your comment (do not create a new comment).

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

Evert0x

Escalation accepted

sherlock-admin

Escalation accepted

This issue's escalations have been accepted!

Contestants' payouts and scores will be updated according to the changes made on this issue.

The original report as published on Sherlock, by 8olidity. 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

The buyout fee denominator is initialised to zero and lacks a setter, so division by zero occurs when calculating the fee.

Impact

Borrowers cannot refinance their loans, which could lead to financial loss if better terms are available.

What the attacker needed

None

The fix

Initialise the buyout fee numerator and denominator in AstariaRouter and add setters to the file() function.

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 smart contract, a key number used to calculate a fee is permanently zero, so any attempt to refinance a loan fails. Borrowers cannot switch to better loan terms, which could cost them money.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by 8olidity

View all

9 more disclosed reports, best first.

More from Astaria

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.