Skip to content
DoS Audit finding Advanced

Bridge requests to remote chains where interchain tokens are not deployed can result in DoS attacks

The interchain token service (ITS) allows token transfers to a destination chain where the interchain token has not yet been deployed, leaving the hub's balance for that chain uninitialised. An attacker can front-run a token deployment to create a balance mismatch, causing other users' bridged tokens to become locked and preventing further bridging (denial of service).

klau5 Follow with gjaldon and 0x007

Originally disclosed on Code4rena

Submitted by klau5, also found by gjaldon and 0x007

https://github.com/code-423n4/2024-08-axelar-network/blob/4572617124bed39add9025317d2c326acfef29f1/axelar-amplifier/interchain-token-service/src/contract/execute.rs#L112-L135

https://github.com/code-423n4/2024-08-axelar-network/blob/4572617124bed39add9025317d2c326acfef29f1/axelar-amplifier/interchain-token-service/src/state.rs#L192

Impact

Insufficient balance in the ITSHub prevents bridging, leading to a DoS attack on the bridge.

Proof of Concept

ITSHub tracks token balances per chain when moving tokens. If the interchain token is not deployed on the destination chain, the balance is uninitialized, and this transaction is not reverted but passed. In other words, token transfer requests are processed normally even if the interchain token is not deployed on the destination chain.

pub fn update_token_balance(
    storage: &mut dyn Storage,
    token_id: TokenId,
    chain: ChainName,
    amount: Uint256,
    is_deposit: bool,
) -> Result<(), Error> {
    let key = TokenChainPair { token_id, chain };

    let token_balance = TOKEN_BALANCES.may_load(storage, key.clone())?;

    match token_balance {
        Some(TokenBalance::Tracked(balance)) => {
            let token_balance = if is_deposit {
                balance
                    .checked_add(amount)
                    .map_err(|_| Error::MissingConfig)?
            } else {
                balance
                    .checked_sub(amount)
                    .map_err(|_| Error::MissingConfig)?
            }
            .then(TokenBalance::Tracked);

            TOKEN_BALANCES.save(storage, key.clone(), &token_balance)?;
        }
@>      Some(_) | None => (),
    }

    Ok(())
}

If the interchain token is not deployed on the destination chain, even if the message is approved, tokens cannot be bridged because the token is not deployed. However, we can consider scenarios where the remote interchain token deployment request is frontrunned. For canonical tokens, anyone can deploy remote interchain tokens, so it’s easy to create a scenario where token transfer is requested first, followed by a request to deploy the remote interchain token.

Consider the following example:

  1. The token deployer requests remote interchain token deployment to chain B. This will be frontrunned.
  2. Front-running (1), a request is made to transfer 100 ether of tokens.
  3. ITSHub first executes ItsMessage::InterchainTransfer. As the interchain token is not yet deployed on chain B, the balance for chain B remains None.
  4. ITSHub then processes ItsMessage::DeployInterchainToken, initializing the balance of chain B to 0.
  5. After the remote interchain token deployment is completed on chain B, the attacker executes execute to receive the bridged tokens.

The balance in ITSHub is 0, but there are 100 ether of bridged tokens on chain B. This balance mismatch can cause problems such as DoS. For example, if another user bridges tokens from chain A to B, increasing the ITSHub balance, the attacker can bridge back from B to A, reducing the ITSHub balance. If a user then tries to bridge from B to A again, they won’t be able to due to insufficient balance in ITSHub.

Recommended Mitigation Steps

The problem is allowing bridging to chains where the remote interchain token is not deployed. The implementation of update_token_balance should be changed to allow bridging only to chains where the balance has been initialized.

If you don’t want to track the balance of the source chain, instead of judging by balance initialization, you should accurately identify the source chain and handle it.

Assessed type

DoS

milapsheth (Axelar) confirmed and commented:

The report is valid. We agree with the Medium severity since assets can’t be stolen, and ITS hub can be upgraded easily to fix the balance invariant. We do plan to restrict transfers if the token isn’t initialized yet to handle this scenario. As mentioned, it requires more careful tracking of the source chain of the token.

0xsomeone (judge) increased severity to High and commented:

The Warden outlines a discrepancy in the token accounting system of the ITS service that would permit a chain that does not yet have an interchain token deployment in it to process messages for it incorrectly.

The vulnerability stems from the same root cause as submission #77, and I believe both descriptions merit a high severity rating. This particular submission directly outlines how funds could be stolen by front-running the deployment of an interchain token and bridging back, thereby causing funds bridged by other users to become “locked” in the attacked chain.


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

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

Impact

The balance mismatch can cause a denial of service: other users' bridged tokens become locked on the destination chain and further bridging from that chain fails due to insufficient balance in ITSHub.

What the attacker needed

Attacker can front-run a deployment transaction; interchain token not yet deployed on destination chain; attacker can execute a receive call on destination chain

The fix

The implementation should be changed to allow bridging only to chains where the token balance has been initialised, or to accurately track the source chain.

How it was found

  1. The token deployer requests remote interchain token deployment to chain B; this request is front-run.
  2. The attacker front-runs with a request to transfer 100 ether of tokens to chain B.
  3. ITSHub processes the transfer first while the token is not yet deployed on chain B, so the balance for chain B remains uninitialised.
  4. ITSHub then processes the deployment message, initialising the balance of chain B to zero.
  5. After deployment completes on chain B, the attacker executes a call to receive the bridged tokens on chain B.
  6. The attacker bridges the tokens back from chain B to chain A, reducing the ITSHub balance and causing later transfers to fail due to insufficient balance.

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.

A bridge moves tokens between blockchains. This bridge keeps a record of how many tokens it holds for each chain. If someone sends tokens to a chain where the token hasn't been set up yet, the bridge doesn't update its record correctly. An attacker can exploit this to make the bridge's record wrong, so later users cannot move their tokens back.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by klau5

View all

21 more disclosed reports, best first.

More from Axelar Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.