-
Notifications
You must be signed in to change notification settings - Fork 2
ast3ros - [M-2] Credit account can exceed credit limit without penalty #192
Comments
From the operation side, we will go through a rigorous review to check the contract before giving the credit limit. For example, the contract must have the ability to profit and ironBank must be the senior debt, etc. Normally, for the safety, we will leave some buffer for the credit limit, but not much. When the credit limit usage is almost full, we will have a discussion to decide if we need to increase the limit. It makes no sense to have a penalty for credit accounts since we expect the credit limit to be just slightly larger than the borrow amount. Not to mention, in the worst scenario, if the credit account won't repay (e.g exploit), adding a penalty won't help at all. |
According to sponsors explanation, issue is invalid. They will prevent exceeding the credit limit by doing rigorous checks and the proposed fix it does not help in certain scenarios. |
I agree with the miss-communication in the docs. This cases are very complex to judge because given the docs context it is an issue, but in reality, it is not. @hrishibhat what do you think in this case? |
Result: |
Escalations have been resolved successfully! Escalation status:
|
ast3ros
medium
[M-2] Credit account can exceed credit limit without penalty
Summary
A credit account allows a user, typically a contract, to borrow up to a credit limit without providing collateral. However, there is no mechanism to enforce the credit limit or to liquidate the credit account if it accrues interest beyond the limit.
Vulnerability Detail
A credit account enables a user, typically a contract, to borrow up to the credit limit without providing collateral.
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/pool/IronBank.sol#L389-L391
However, when the credit account borrows the maximum limit, and time passes, the interest will accrue and make the user’s borrow balance increase over the credit limit. And there is no mechanism to force the credit account to repay. The credit account cannot be liquidated.
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/pool/IronBank.sol#L492
Impact
The credit account can borrow more than its credit limit, which violates the rule of Iron Bank. And there is no mechanism to bring the account back to the credit limit.
Code Snippet
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/pool/IronBank.sol#L389-L391
Tool used
Manual Review
Recommendation
Add a penalty when the credit account has a borrow balance over the credit limit. For example, increase the borrow rate or reduce the credit limit for the account. Alternatively, allow liquidation of the credit account if it exceeds the credit limit by a certain threshold.
The text was updated successfully, but these errors were encountered: