`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
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/AstariaRouter.sol#L71
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/AstariaRouter.sol#L456
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/LienToken.sol#L377
- 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.
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.