Closed sherlock-admin closed 1 year ago
This is intentional: There is no point for the borrower to buy out their own lien since they have to pay all of their accrued debt + the additional 10% of remaining interest (no longer capped at 60 days in our latest cut). The borrower could just pay their accrued debt if they wanted to get rid of the lien. The purpose of the buyout is for other vaults (or potentially the same vault) to buy out a lien and provide better terms if they think their new terms will provide more capital in the end once the new loan is repaid.
Jeiwan
high
A buyout is paid by liquidity providers, not by a borrower
Summary
A buyout is paid by liquidity providers, not by a borrower
Vulnerability Detail
A borrower is allowed to buy out their lien to apply new loan terms to it (VaultImplementation.sol#L280). To buy out a lien, the full lien's debt must be paid (LienToken.sol#L143-L148). However, when buying out via the vault contract, it's the vault that pays the buyout:
buyoutLien
on the LienToken contract (VaultImplementation.sol#L301-L303):msg.sender
, i.e. the vault (LienToken.sol#L143-L148):The vault also approves spending to LienToken (VaultImplementation.sol#L297-L300):
Impact
Borrower buys out a lien for free, liquidity providers lose money since buyouts are paid from their deposits.
Code Snippet
VaultImplementation.sol#L280:
LienToken.sol#L121:
Tool used
Manual Review
Recommendation
When a borrower buys out a lien, ensure it's the borrower who repays the lien's debt and the buyout fee.