Status DataClose notification

Overlayer Disclosed Report

Audit Report

Critical Vulnerability Found: Credit Arithmetic Underflow Causes Permanent Loss of Bridged Funds

Target

Target is hidden

This information is not publicly available.

Vulnerability details

Summary The _credit override in OverlayerWrapCore performs totalBridgedOut -= amountReceivedLD after calling super._credit(). On any non-hub chain deployment, totalBridgedOut is initialized to 0 and can never be incremented (because _debit requires tokens to exist first, and tokens can never arrive). This causes an arithmetic underflow revert in Solidity 0.8+, permanently bricking all inbound cross-chain transfers and permanently locking the user's tokens.

The totalBridgedOut state variable tracks tokens leaving the hub chain via _debit (which does totalBridgedOut += amountSentLD). This accounting is correct only on the hub chain, where tokens are first minted and then bridged out (incrementing totalBridgedOut), and later bridged back (decrementing it).

On a non-hub chain:

  1. totalBridgedOut starts at 0
  2. No tokens can be minted locally (_managerMint has onlyHubChain modifier)
  3. The only way to get tokens is via _credit (inbound bridge) — but _credit always reverts because 0 - amountReceivedLD underflows
  4. Since no tokens can ever exist on the non-hub chain, _debit can never be called either (nothing to burn)
  5. Deadlock: totalBridgedOut can never become > 0, so _credit can never succeed

Attack Flow / Exploitation Scenario

  1. OverlayerWrap is deployed on Hub Chain (e.g., Ethereum mainnet, chainId == hubChainId) and Non-Hub Chain (e.g., Arbitrum)
  2. User mints 10,000 OverlayerWrap on the hub chain by depositing 10,000 USDC
  3. User calls send() (LayerZero OFT) to bridge 10,000 OverlayerWrap to the non-hub chain
  4. Hub chain: _debit succeeds — burns 10,000 tokens, totalBridgedOut += 10,000
  5. Non-hub chain: LayerZero endpoint calls _lzReceive → _credit → super._credit mints OK → totalBridgedOut -= 10000 REVERTS (0 - 10000 underflows)
  6. The entire _lzReceive reverts. LayerZero stores the message as a failed payload
  7. Result: 10,000 tokens burned on hub chain, never minted on non-hub chain. The message can be retried but will always fail with the same underflow. Funds are permanently lost.

Why This Is High Likelihood

  1. Requires no special permissions, no large capital, no computational resources
  2. Any user who attempts a standard cross-chain OFT transfer to a non-hub chain triggers this
  3. The entire purpose of inheriting OFT and having hubChainId is multi-chain deployment
  4. The _debit override with totalBridgedOut accounting confirms multi-chain intent

Why This Is High Impact

  1. 100% of any bridged amount is permanently lost — burned on source, never minted on destination
  2. No admin function exists to recover bridged tokens (no re-mint, no rollback)
  3. Affects the entire protocol TVL that flows through cross-chain bridges
  4. LayerZero message retries will perpetually fail — the contract code cannot succeed

Validation steps

Only track totalBridgedOut on the hub chain:

function _credit(
    address to_,
    uint256 amountLD_,
    uint32 srcEid_
) internal virtual override returns (uint256 amountReceivedLD) {
    amountReceivedLD = super._credit(to_, amountLD_, srcEid_);
    if (block.chainid == hubChainId) {
        totalBridgedOut -= amountReceivedLD;
    }
}

function _debit(
    address from_,
    uint256 amountLD_,
    uint256 minAmountLD_,
    uint32 dstEid_
) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {
    (amountSentLD, amountReceivedLD) = super._debit(from_, amountLD_, minAmountLD_, dstEid_);
    if (block.chainid == hubChainId) {
        totalBridgedOut += amountSentLD;
    }
}

This ensures the collateral-backing accounting (totalSupply() + totalBridgedOut) only applies on the hub chain where it's meaningful, while allowing cross-chain transfers to work correctly on all chains.

Attachments

Attachments are hidden

This information is not publicly available.

Comments are hidden

This information is not publicly available.