The distribute function has no permission control, and an attacker can construct appropriate parameters to call Pool#loanLiquidation and pass in arbitrary parameters.
In this way, the interest/fee in the Pool can be arbitrarily set.
Tools Used
vscode, manual
Recommended Mitigation Steps
AuctionLoanLiquidator#settleAuction calls the distribute function:
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/LiquidationDistributor.sol#L32
Vulnerability details
Impact
An attacker can use the
distribute
function to callPool#loanLiquidation
to add any number of interest/fee to the Pool.Proof of Concept
The
loanLiquidation
function in Pool requires permission to access:modifier
onlyAcceptedCallers
indicates thatmsg.sender
needs to be added to the trust list before it can be called.The
distribute
function in theLiquidationDistributor
contract is a public function and callsPool#loanLiquidation
:distribute->_handleTrancheExcess->_handleLoanManagerCall:
The
distribute
function has no permission control, and an attacker can construct appropriate parameters to callPool#loanLiquidation
and pass in arbitrary parameters. In this way, the interest/fee in the Pool can be arbitrarily set.Tools Used
vscode, manual
Recommended Mitigation Steps
AuctionLoanLiquidator#settleAuction calls the
distribute
function:We should restrict the
distribute
function to only being called byLiquidator
:Assessed type
Access Control