-
Notifications
You must be signed in to change notification settings - Fork 15
Bandit - Utilisation Can Be Manipulated Far Above 100% #93
Comments
1 comment(s) were left on this issue during the judging contest. takarez commented:
|
The protocol team fixed this issue in PR/commit arcadia-finance/lending-v2#137. |
You've deleted an escalation for this issue. |
Hi @Banditx0x I believe the following factors mentioned by @zzykxx in his report warrants the decrease in severity:
Sponsors Comments:
|
Hey @Banditx0x, correct me if I'm wrong, but I think the following applies here:
Some damage can be caused by abusing this issue, but I think the damage is not big enough to classify this as high severity. Of course, I would be more than happy to be proven wrong since this would also be in my personal interest. |
@zzykxx thanks for the response. You're right that the Silo finance situation had much higher impact due to manipulation of one asset allowing borrows of another. However I had originally thought that the impact would be High even with this in mind as it had the same impact as the share inflation attack which historically has had high severity. I hadn't realised the maximum interest rate was capped at Given the slower interest rate accrual than I originally thought, I agree with the medium severity. Edit: i deleted past escalation comment due to this discussion. Just so this conversation makes sense for future readers. |
Planning to reject the escalation and leave the issue as is. |
Result: |
Wasn't the escalation deleted before the period end? Banditx0x's comment was last edited on 5:26AM UTC, while the escalation period end was 12:36PM same day. |
@midori-fuse It looks so, we will look into it. Thank you for bringing this up! |
The escalation should have been deleted, there was an issue on Sherlock's part that's now resolved. |
Fix looks good. Utilization is now capped at 100% |
The Lead Senior Watson signed off on the fix. |
Bandit
high
Utilisation Can Be Manipulated Far Above 100%
Summary
The utilisation of the protocol can be manipulated far above 100% via token donation. It is easiest to set this up on an empty pool. This can be used to manipulate the interest to above 10000% per minute to steal from future depositors.
Vulnerability Detail
This attack is inspired by / taken from this bug report for Silo Finance. I recommend reading it as is very well written: https://medium.com/immunefi/silo-finance-logic-error-bugfix-review-35de29bd934a
The utilisation is basically assets_borrowed / assets_loaned. A higher utilisation creates a higher interest rate. This is assumed to be less than 100%. However if it exceeds 100%, there is no cap here:
https://github.com/sherlock-audit/2023-12-arcadia/blob/main/lending-v2/src/LendingPool.sol#L809-L817
Normally, assets borrowed should never exceed assets loaned, however this is possible in Arcadia as the only thing stopping a borrow exceeding loans is that the
transfer
of tokens will revert due to not enough tokens in theLending pool
. However, an attacker can make it not revert by simply sending tokens directly into the lending pool. For example using the following sequence:1e18
assets into theLendingPool
1e18
assetsThese are the first steps of the coded POC at the bottom of this issue. It uses a token donation to make a borrow which is far larger than the loan amount.
In the utilisation calculation, this results in a incredibly high utilisation rate and thus interest rate as it is not capped at 100%. This is why some protocols implement a hardcap of utilisation at 100%.
The interest rate is so high that over 2 minutes, 100 assets grows to over100000 assets, or a 100000% interest over 2 minutes. The linked similar exploit on Silo Finance has an even more drastic interest manipulation which could drain the whole protocol in a block. However I did not optimise the numbers for this POC.
Note that the 1e18 assets "donated" to the protocol are not lost. They can simply be all borrowed into an attackers account.
The attacker can set this up when the initial lending pool is empty. Then, they can steal assets from subsequent depositors due to the huge amount of interest collected from their small initial deposit
Let me sum up the attack in the POC:
1e18
assets into theLendingPool
1e18
assetsHere is the output from the console.logs:
This is the edited version of
setUp()
in_scenario.t.sol
This test was added to
BorrowAndRepay.scenario.t.sol
Impact
An early depositor can steal funds from future depositors through utilisation/interest rate manipulation.
Code Snippet
https://github.com/sherlock-audit/2023-12-arcadia/blob/main/lending-v2/src/LendingPool.sol#L809-L817
Tool used
Manual Review
Recommendation
Add a utilisation cap of 100%. Many other lending protocols implement this mitigation.
The text was updated successfully, but these errors were encountered: