Flashloan cannot be obtained to delever during high utilization times #119
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-b
primary issue
Highest quality submission among a set of duplicates
Q-20
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_20_group
AI based duplicate group recommendation
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-07-loopfi/blob/57871f64bdea450c1f04c9a53dc1a78223719164/src/proxy/PositionAction.sol#L345-L369
Vulnerability details
Impact
User's won't be able to delever their positions during high pool utilization times
Proof of Concept
Loopfi offers leverage functionalities with
increaseLever
anddecreaseLever
. Both of these make use of the native flash loan to help an user increase/decrease their leveragelink
But the flashloan internally calls the
lendCreditAccount
method of the pool inorder to borrow assets and this function has a check that the utilization must be below a certain level in order to borrow more assetslink
lendCreditAccount -> _updateBaseInterest -> calcBorrowRate
link
Hence although user's are actually attempting to repay their debt when decreasing their leverage, they will not be able to do so because of the kept condition. This will cause user's who have leveraged relying on the flashloan unable to decrease their leverage during times of high utilization accruing greater borrow interest
Tools Used
Manual review
Recommended Mitigation Steps
Since flash loans will improve the balance of the pool, allow flashloan contracts to borrow even during times of high utilization rate
Assessed type
DoS
The text was updated successfully, but these errors were encountered: