Attacker can cancel claimed staking incentives on Arbitrum
The ArbitrumDepositProcessorL1 contract set the callValueRefundAddress to the user-supplied refundAccount when creating a retriable ticket, giving that address the ability to cancel the ticket on L2. An attacker could claim staking incentives with insufficient gas and then cancel the ticket, making the incentives irredeemable and requiring governance intervention to recover.
EV_om Follow with ArsenLupin
Originally disclosed on Code4rena
Submitted by EV_om, also found by ArsenLupin
The ArbitrumDepositProcessorL1 contract is responsible for bridging OLAS tokens and messages from L1 to the ArbitrumTargetDispenserL2 contract on Arbitrum. When calling claimStakingIncentives() or claimStakingIncentivesBatch() on the Dispenser contract for a nominee on Arbitrum, it creates a retriable ticket via the Inbox.createRetryableTicket() function to send a message to Arbitrum to process the claimed incentives.
However, when creating this retriable ticket, the refundAccount is passed as both the excessFeeRefundAddress and callValueRefundAddress parameters. As per the Arbitrum documentation and code, specifying the callValueRefundAddress gives that address a critical permission to cancel the retriable ticket on L2.
This means an attacker can perform the following steps:
- Call
claimStakingIncentives()on theDispensercontract for a nominee on Arbitrum. - Provide an insufficient gas limit in the
bridgePayloadto ensure the ticket fails and is not auto-redeemed. - As soon as the ticket becomes available to redeem on Arbitrum, call the
ArbRetryableTx’scancel()precompile method. - This will cancel the message and render all the claimed incentives irredeemable.
While the protocol could call processDataMaintenance() on L2 with the data from the cancelled message to recover, this would require passing a governance proposal. Given that this attack can be carried out any number of times (e.g. as often as possible and with a different target each time), this can considerably impact the functioning of the protocol hence I believe Medium severity is justified.
Impact
Attacker can grief the protocol by making legitimately claimed staking incentives irredeemable on L2. This would require governance intervention each time to recover the lost incentives.
Proof of Concept
- Attacker calls
claimStakingIncentives()on theDispensercontract for all nominees on Arbitrum, providing an insufficient gas limit and passing an EOA under their control asrefundAccountin thebridgePayload. - Retryable ticket is created but fails to auto-redeem due to out of gas.
- Once ticket is available to redeem on L2, attacker calls
ArbRetryableTx.cancel()precompile method. - Message is cancelled and staking incentives are not redeemable on L2.
Recommended Mitigation Steps
Since no call value is ever sent with the ticket, the callValueRefundAddress can be left empty when creating the retryable ticket or an admin address passed instead, if the protocol wants to reserve the right to cancel tickets.
Assessed type
Access Control
kupermind (Olas) confirmed and commented:
Very interesting.
Fixed.
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
The contract passed the user-controlled refundAccount as the callValueRefundAddress, which grants the ability to cancel the retriable ticket on L2.
Impact
An attacker could repeatedly make legitimately claimed staking incentives irredeemable on L2, requiring governance intervention each time to recover them.
What the attacker needed
Attacker can call claimStakingIncentives(); attacker controls the refundAccount address; attacker can set a low gas limit
The fix
The callValueRefundAddress should be left empty or set to an admin address when creating the retryable ticket, since no call value is sent.
How it was found
- Call claimStakingIncentives() on the Dispenser contract for a nominee on Arbitrum.
- Provide an insufficient gas limit in the bridgePayload so the ticket fails and is not auto-redeemed.
- Once the ticket is available to redeem on Arbitrum, call the ArbRetryableTx cancel() precompile method.
- The message is cancelled and the claimed incentives become irredeemable.
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.
When tokens are sent from one blockchain to another, a temporary 'ticket' holds the message until it is processed. The contract mistakenly gave the person who requested the transfer the power to cancel that ticket. So an attacker could start a transfer, make it fail, and then cancel it, destroying the incentives that were meant to be delivered.
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.