Attackers can force liquidations by borrowing large amounts of an asset.
An attacker can borrow a large amount of an asset to artificially inflate the oracle interest rate, potentially forcing liquidations of other users' collateral. The report argues that arbitrage incentives are insufficient to prevent this manipulation, though the protocol team disputes the severity.
Submitted by tensors
Consider an attacker who borrows enough to greatly increase the oracle rate. It is claimed that arbitrageurs will come in and fix this discrepancy before the attacker has a chance to profit off of his price manipulation:
“Over the next 1 hour, the effect of the new 12% interest rate will be averaged into the previous 6% rate. This forces the borrower to hold their position and gives an opportunity for other traders to lend to the market to bring the interest rate back down to its previous 6% level.”
In my opinion, this incentive is not sufficient to prevent an attack. This assumes that:
- There is sufficient volume to notice a manipulation like this
- The arbitrageurs would be willing to deploy capital for a short amount of for a slightly increased rate
- The arbitrageurs would now know that this is a manipulation, and not a natural market movement (For example, lets say an asset lending rate goes up 10% in value, is it being manipulated or is the rate actually worth 10% more for some reason? An arbitrageur needs to make this before he deploys capital). Since notional is the only market to offer something like this, it is difficult to discern what the response should be.
- The arbitrageurs don’t join in on the attack, and try to liquidate accounts with the attacker
Proof of concept is based off of the formula and text here.
Uncertain what the recommendation should be.
T-Woodward (Notional) acknowledged and disagreed with severity:
This is a fair point. With a timeWindow value that is under an hour, it’s not clear whether capital will flow in to take advantage of artificially inflated yields before the oracleRate catches up to the lastImpliedRate and accounts are potentially eligible for liquidation at this early stage in Notional’s lifespan before there are lots of eyes on the system and its market dynamics are widely understood.
However, it’s worth noting that there are several mitigating circumstances which make such an attack unlikely:
- The necessary conditions for a profitable attack to exist are quite narrow
- The capital required to execute such an attack is substantial
- The sunk cost of executing this attack prior to any payoff is significant
- The payoff of the attack is not guaranteed
First let’s examine what this attack would have to look like.
- With the current fCash market parameters, interest rates top out at about 25%, so the most that an attacker could push interest rates from their natural level is ~20% (assuming a starting interest rate of 5%).
- With the current active maturities (longest dated maturity is one year), a 20% change in interest rates could decrease the collateral value of an account’s fCash by a maximum of ~20%.
- Pushing the interest rate to the top of the range requires the attacker to borrow all of the cash sitting in the liquidity pool. If you assume there is $100M sitting in the pool, then the attacker would have to borrow $100M. At worst, if they execute the borrow all in one shot, their realized borrow rate would be 25%. At best, if they execute the borrow in pieces (increasing the time taken and risk of the attack), their realized borrow rate would be ~15%. This implies that the attacker has placed at least $15M at risk (his total interest owed) as there is no guarantee that he can exit his position in profit or at cost.
- In order for this to be a profitable attack, the attacker needs to offset their borrowing by executing an fCash liquidation that would allow them to lend at the artificially inflated interest rate. This means that there must be an account, or set of accounts, which have borrowed against their fCash, are 20% away from under collateralization, and have enough fCash such that the attacker can offset his borrow by liquidating their fCash. In other words, there would need to be $100M+ of fCash held in the system that is being used as collateral and is close to liquidation.
- These conditions are possible, but improbable. It would imply that the amount of outstanding loans that are being borrowed against (and are close to under collateralization) is greater than the total liquidity in the pool. This strikes me as unlikely for two reasons:
- For there to be more fCash outstanding than liquidity in the pool, there would have to be a lot of two-way trading. We expect this to happen eventually, but in the initial stages we would be very surprised by this because lenders do not earn NOTE incentives, only liquidity providers earn NOTE incentives. It would be very surprising to see more lending than liquidity given this fact. We expect more lending than liquidity once Notional is more mature, but by then there will be more eyes on the system which would make this attack less likely as arbitragers and/or automated yield aggregators really would come in to push rates back down to their natural level.
- Only a percentage of fCash will actually be used as collateral, and probably not a large percentage. So if you specifically need fCash used as collateral (and close to liquidation) to be a multiple of liquidity in the pool, this would imply that the amount of total outstanding fCash would be like an order of magnitude greater than the liquidity in the pool. That strikes me as highly unlikely.
Ultimately we don’t think this is a significant risk because the necessary conditions are unlikely to obtain in the early stages of Notional’s growth, the attack involves substantial sunk costs and capital committed, and the risk of an unsuccessful attack is significant. To further mitigate against this unlikely risk, we will skew the timeWindow to a longer time / larger value.
This attack requires a lot of things aligned and for that single reason I’ll give it medium risk.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the oracle interest rate is calculated from current borrowing activity and can be manipulated by a single large borrow, with insufficient time-averaging or arbitrage to correct it quickly.
Impact
An attacker could force liquidations of other users' accounts and profit, but the protocol team argues the conditions are narrow, the capital required is substantial, and the payoff is not guaranteed.
What the attacker needed
Sufficient liquidity in the pool; accounts close to liquidation; attacker has large capital
The fix
The protocol team said they would skew the timeWindow to a longer time or larger value to further mitigate the risk.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In some lending systems, the interest rate is set by an oracle that watches how much people borrow. If someone borrows a huge amount all at once, the oracle might think demand is high and raise the rate. That higher rate can make other people's collateral look less valuable, so they might get liquidated (forced to repay early). This report says an attacker could do that on purpose to profit from the liquidations.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.