Skip to content
Access control Audit finding Intermediate

Operator is blocked when sequencer is down on Arbitrum

When the Arbitrum sequencer is down, transactions from L1 are aliased, so the operator's calls to onlyOperator() functions are blocked. This prevents the operator from performing safety functions like disengage() and rebalancing, potentially leading to liquidation.

hildingr Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-05-Index-judging/issues/321

Found by

hildingr

Summary

When the sequencer is down on Arbitrum state changes can still happen on L2 by passing them from L1 through the Delayed Inbox.

Users can still interact with the Index protocol but due to how Arbitrum address aliasing functions the operator will be blocked from calling onlyOperator().

Vulnerability Detail

The msg.sender of a transaction from the Delayed Inbox is aliased:

Solidity
L2_Alias = L1_Contract_Address + 0x1111000000000000000000000000000000001111

All functions with the onlyOperator() modifier are therefore blocked when the sequencer is down.

The issue exists for all modifiers that are only callable by specific EOAs. But the operator of the Aave3LeverageStrategyExtension is the main security risk.

Impact

The operator has roles that are vital for the safety of the protocol. Re-balancing and issuing/redeeming can still be done when the sequencer is down it is therefore important that the operator call the necessary functions to operate the protocol when the sequencer is down.

disengage() is an important safety function that the operator should always have access especially when the protocol is still in accessible to other users. Changing methodology and adding/removing exchanges are also important for the safety of the protocol.

Code Snippet

https://github.com/sherlock-audit/2023-05-Index/blob/3190057afd3085143a31746d65045a0d1bacc78c/index-coop-smart-contracts/contracts/manager/BaseManagerV2.sol#L113-L116

Tool used

Manual Review

Recommendation

Change the onlyOperator() to check if the address is the aliased address of the operator.

Discussion

hildingr

Escalate for 10 USDC

This is not a duplicate off #262 and should be a separate issue.

This is not about a check if a sequencer is down but rather a peculiarity on how Arbitrum aliases addresses. On the other L2s the manager is still able to reach all functions when the sequencer is down since the aliasing is not done on EOA's initiating a L1->L2 call.

On Arbitrum this is not the case and the manager/operators are completely blocked from controlling the protocol when the sequencer is down.

As it stands on the other L2's the manager/operators can still govern over the protocol and use all the available safety features if the sequencer is down. As it stands this is not possible on Arbitrum.

Low probability event where it would be crucial for operator/manager to have access:

Sequencer is down for a prolonged time this could be some kind of attack or a technical issue, couple this with volatility in the market either due to the issues with the sequencer or unrelated. The governance should be able to change the safe parameters of position during such an event.

The recommended changes in the duplicates actually makes this worse in some cases since repaying debt is completely blocked when the sequencer is down. This is not the case for normal AAVE users which always have the ability to repay loans, this is an important safety feature guaranteed by AAVE.

This can be taken further if the Index Team wishes to have the same safety level as a native AAVE user.

New functionality can be added to allow the operator to repay debt and de-leverage when the sequencer is down. This is a safety feature available to all AAVE users, AAVE users are never blocked from repaying debt but only from taking out additional loans when the sequencer is down.

This can be done by allowing a new operator L1Operator to access a new rebalancing feature, this L1Operator is a L1 smart-contract that uses L1 oracle data to initiate a L2 repayment of debt and rebalance when the sequencer is down.

sherlock-admin

Escalate for 10 USDC

This is not a duplicate off #262 and should be a separate issue.

This is not about a check if a sequencer is down but rather a peculiarity on how Arbitrum aliases addresses. On the other L2s the manager is still able to reach all functions when the sequencer is down since the aliasing is not done on EOA's initiating a L1->L2 call.

On Arbitrum this is not the case and the manager/operators are completely blocked from controlling the protocol when the sequencer is down.

As it stands on the other L2's the manager/operators can still govern over the protocol and use all the available safety features if the sequencer is down. As it stands this is not possible on Arbitrum.

Low probability event where it would be crucial for operator/manager to have access:

Sequencer is down for a prolonged time this could be some kind of attack or a technical issue, couple this with volatility in the market either due to the issues with the sequencer or unrelated. The governance should be able to change the safe parameters of position during such an event.

The recommended changes in the duplicates actually makes this worse in some cases since repaying debt is completely blocked when the sequencer is down. This is not the case for normal AAVE users which always have the ability to repay loans, this is an important safety feature guaranteed by AAVE.

This can be taken further if the Index Team wishes to have the same safety level as a native AAVE user.

New functionality can be added to allow the operator to repay debt and de-leverage when the sequencer is down. This is a safety feature available to all AAVE users, AAVE users are never blocked from repaying debt but only from taking out additional loans when the sequencer is down.

This can be done by allowing a new operator L1Operator to access a new rebalancing feature, this L1Operator is a L1 smart-contract that uses L1 oracle data to initiate a L2 repayment of debt and rebalance when the sequencer is down.

You've created a valid escalation for 10 USDC!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

0xffff11

Thanks. I think the changes of this happening are slim to non. Sequencer has to be down and at the same time the operator rebalance. Also, I the operator is a multisig, not an EOA, unsure if that makes any difference, but still, I do not see the medium here. @IAm0x52 thoughts?

IAm0x52

Due to the ripcord function always being available to prevent set token liquidation, low seems more appropriate to me.

0xffff11

Thanks for the second opinion. As said above, I agree with low

hrishibhat

Agree with the Lead Judge and Watson on this being low @hildingr

hildingr

I will have to disagree here. The ripcord can not be trusted when the sequencer is down. The price could move in either direction while the Oracle price is stale.

Imagine if the price is moving in a direction that would allow a ripcord pull, the ripcord can not be pulled since the oracle has the stale price.

On optimism and polygon the operator can call disengage() and stop the protocol from going above the max liquidation ratio. On Arbitrum this is not possible and the position can go way beyond the max LTV without being able to delever. The position could even get liquidated before ripcord or disengage can be called. If 0.95 < HF < 1 the position can be instantly liquidated when the sequencer comes back up since no grace period is given to heavily undercollateralized positions.

ckoopmann

I don't have a strong opinion on wether this is low or medium so will leave it up to the lead watson / judge to decide.

Since we are not planning to deploy on arbitrum for now we will not act on this issue for now, but will review should we deploy this there in the future.

hrishibhat

@hildingr Additional comment from the Lead watson.

The key consideration here is that the main intention here is to keep the set token from becoming liquidated. So it doesn't really matter what the oracle is at whether it's stale or completely wrong. As long as the oracle being used by the set token matches AAVE then that's all that matters. So as I've stated, ripcord will always protect the set token so this is low

hildingr

@hildingr Additional comment from the Lead watson.

The key consideration here is that the main intention here is to keep the set token from becoming liquidated. So it doesn't really matter what the oracle is at whether it's stale or completely wrong. As long as the oracle being used by the set token matches AAVE then that's all that matters. So as I've stated, ripcord will always protect the set token so this is low

I disagree, the ripcord will not always protect the position. I will give a concrete example:

Stage 1, the sequencer is up: HF = 1.5

Stage 2, the sequencer is down: HF is -> 1. ripcord can not be pulled due to incorrect internal LTV.

Stage 3, sequencer still down: HF < 0.95.

Stage 4, the moment the sequencer comes up: Race condition between instant liquidation and pulling the ripcord. This is because HF < 0.95 and no grace period is given by the AAVE sentinel.

The true LTV always matters even if AAVE and Index use the same stale oracle. We can look at it as a discontinuity in the LTV, when the seq is down it is "unknown" to both protocols but in the instant the sequencer comes back the LTV jumps to the true value. The true LTV can be in very dangerous territory, possibly high enough for instant liquidation.

IAm0x52

Stage 4, the moment the sequencer comes up: Race condition between instant liquidation and pulling the ripcord. This is because HF < 0.95 and no grace period is given by the AAVE sentinel.

This is correct. it would create race conditions under these circumstances

hrishibhat

Result: Medium Unique Considering this a valid medium based on the above comments

sherlock-admin2

Escalations have been resolved successfully!

Escalation status:

The original report as published on Sherlock, by hildingr. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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 onlyOperator() modifier checks for the exact operator address, but when the sequencer is down, L1-to-L2 transactions have an aliased msg.sender, so the check fails.

Impact

The operator cannot call safety functions like disengage() when the sequencer is down, which could lead to liquidation if the market moves adversely.

What the attacker needed

Arbitrum sequencer is down

The fix

The onlyOperator() modifier should be changed to also accept the aliased address of the operator.

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.

On Arbitrum, if the main sequencer (which orders transactions) goes down, users can still send transactions from Ethereum. However, the sender address gets changed by adding a fixed value, so the contract sees a different address. This means the operator's special permissions are not recognised, and they cannot call critical safety functions.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Index Update

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.