Status DataClose notification

Overlayer Disclosed Report

Audit Report

Destination Credit Underflow: destination-local totalBridgedOut blocks inbound bridges

Target

Target is hidden

This information is not publicly available.

Vulnerability details

Current Deployment Applicability (Candid)

This report demonstrates a concrete lock mechanism in in-scope code with runnable PoC tests. The bug itself is not hypothetical.

The selected severity remains Critical because HackenProof rewards only critical findings, but official payout-critical applicability under this program still depends on whether the affected inbound bridge path is part of the protocol as currently deployed. If the affected inbound path is not currently live and in-scope, this remains architecture-critical rather than a clean payout-critical submission under the "currently deployed" rule.

Current Deployment Evidence

Verified now (PoC-backed):

  • source-side burn executes before destination credit completion,
  • destination _credit(...) can reach a destination-local totalBridgedOut decrement that underflows,
  • because that underflow occurs in the same receive transaction, no destination mint persists,
  • failed inbound packet remains staged and retry without destination-state change does not self-heal,
  • affected user has no direct self-help completion path on that failed destination leg.

Verified now (public deployment status):

  • as of 2026-04-02, the official deployment page still says No mainnet deployments yet. Coming soon...
  • the same page lists only Ethereum Sepolia, Optimism Sepolia, and Arbitrum Sepolia addresses
  • the page also warns These are testnet deployments. Do not use real funds.

What remains deployment-gated under program rules:

  • whether HackenProof treats the documented testnet bridge rollout as the currently deployed in-scope protocol for critical review, and
  • whether the affected inbound path is considered live with real user funds in scope.

Criticality Mapping (Program Criteria)

  • High likelihood:
    • unprivileged user-triggered bridge flow (_debit then destination _credit),
    • no privileged action required to trigger failure on fresh/net-inflow destination state,
    • low condition count: destination local totalBridgedOut < inbound amount.
  • High impact:
    • source-side user balance is already burned,
    • destination receive reverts, so no destination mint persists,
    • retrying without destination-state change does not self-heal,
    • user has no direct self-help completion path on affected destination leg.
    • if the affected path is currently live and in-scope, this is a user-fund lock condition on that leg.

Program Rule Alignment

  • Unprivileged trigger path (_debit then destination _credit); no rogue privileged-user assumption.
  • Runnable PoC demonstrates mechanism and retry persistence.
  • Suggested fix is included.
  • Current-deployment applicability is treated separately and candidly rather than assumed.
  • Lock characterization is user-perspective on the affected destination leg, gated by deployment applicability evidence.

Finding Description and Impact

OverlayerWrapCore tracks bridged-out supply in a single local storage variable, totalBridgedOut. During _debit(...), the source chain increments that local counter when tokens are burned for an outbound bridge transfer. During _credit(...), the destination chain decrements its own local counter.

This is unsafe because each deployment has independent storage. A fresh destination starts with totalBridgedOut == 0, even though the source chain may have already incremented its own counter during the outbound burn. When the first inbound transfer arrives, _credit(...) reaches:

totalBridgedOut -= amountReceivedLD;

and underflows on the destination deployment.

The important detail is that the underflow happens after super._credit(...). Because it occurs in the same transaction, the entire receive reverts and the destination mint is rolled back too.

The effect is concrete: a user can burn on source, the LayerZero packet stays valid/staged, and destination receive still reverts before minting. The same failure can recur on destinations with net inbound volume over local bridged-out history.

Duplicate Differentiation

This issue is distinct from the prior Hacken fix for outbound-supply accounting. That earlier issue addressed hub-side backing math after OFT burns. The current bug survives after the totalBridgedOut fix because it appears on the receive side: _credit(...) subtracts from a destination-local counter that was never incremented by the originating burn.

Impact is direct cross-chain availability failure. Inbound bridging can fail on fresh or net-inflow destinations, leaving source-side funds burned and destination credit unavailable until destination-local accounting state changes.

Under HackenProof's critical bar, the core security property is a protocol-managed lock state after source-side burn, with no user-controlled completion path on the affected destination leg. Official payout-critical classification still depends on current-deployment applicability for that path.


FIELD: Steps to Reproduce

  1. Deploy two OverlayerWrapMock instances representing source and destination chains, each with its own endpoint harness and independent storage.
  2. Configure each instance to trust the other as its peer.
  3. Mint 4 OVA+ to alice on the source chain.
  4. Call testDebit(alice, 4 ether, 4 ether, DST_EID) on the source instance. This burns Alice's source-side balance and increments srcWrap.totalBridgedOut().
  5. Stage a valid OFT receive payload for the destination using the same amount encoded in shared decimals.
  6. Call dstEndpoint.lzReceive(...).
  7. Observe that:
    • the call reverts before minting to Alice,
    • Alice's source-side balance is already zero,
    • Alice's destination-side balance remains zero,
    • the inbound payload remains staged for retry,
    • dstWrap.totalBridgedOut() is still zero because the destination never had matching local outbound volume.

FIELD: Suggested Fix

Do not decrement a destination-local totalBridgedOut inside _credit(...). If this counter is needed for hub-side backing calculations, keep it scoped to the chain that actually burned supply, or track bridge accounting per remote path so a credit can only offset the same accounting bucket that the original debit incremented.

Regression Invariant

For any successful source burn of x intended for a destination peer, destination credit processing for that payload must be independent of unrelated destination-local bridge history. In particular, destination _credit must not require prior destination-local outbound volume to succeed.


Validation steps

  1. Clone the PoC repository and enter the Foundry project:

cd workspace/poc/foundry

  1. Run the two F-10 tests:

forge test --match-path test/POC_F10_DestinationCreditUnderflow.t.sol -vv

  1. Expected output — both tests PASS:
  • test_F10_FreshDestinationInboundCreditRevertsBeforeRecipientChecks — proves that a valid inbound bridge to a fresh destination reverts due to totalBridgedOut underflow. Alice's source
    balance is 0 (burned), destination balance is 0 (never minted), and the payload remains staged.
  • test_F10_RetryWithoutStateChangeDoesNotSelfHeal — proves that retrying the same staged payload reverts again, confirming the lock is persistent without external state change.
  1. Key assertions to verify in the output:
  • Source-side burn already happened (balanceOf(alice) == 0 on source)
  • Destination mint never completed (balanceOf(alice) == 0 on destination)
  • Destination totalBridgedOut is still 0 (the root cause)
  • Inbound payload hash remains non-zero (packet still staged, not cleared)
  1. Root cause location:

OverlayerWrapCore.sol line 543: totalBridgedOut -= amountReceivedLD underflows when destination has no prior local outbound volume.


Attachments

Attachments are hidden

This information is not publicly available.

Comments are hidden

This information is not publicly available.