Status DataClose notification

Overlayer Disclosed Report

Audit Report

_credit() Integer Underflow Permanently Locks All Bridge-in Transactions

Target

Target is hidden

This information is not publicly available.

Vulnerability details

In OverlayerWrapCore.sol line 543, the _credit() function performs a checked subtraction on totalBridgedOut:

totalBridgedOut -= amountReceivedLD;

In Solidity 0.8, checked arithmetic reverts with Panic(0x11) when underflow occurs. Once this triggers, ALL future _credit() calls permanently revert because totalBridgedOut cannot be reset — there is no admin recovery function and no upgrade mechanism in scope.

Trigger condition: When totalBridgedOut < amountReceivedLD. This happens when:

  • A second independent user bridges in after totalBridgedOut reaches zero (PATH C)
  • Hub chain totalBridgedOut is zero but a spoke chain user bridges in (PATH B)

Both are realistic scenarios in normal multi-chain deployment.

Impact: 100% of user funds bridged to spoke chains are permanently locked. Even 1 wei credit reverts forever after the underflow is triggered.

Validation steps

  1. Clone repo: git clone https://github.com/Overlayerfi/contracts.git
  2. Checkout commit: git checkout 519c9e92fd9d80d11e35e9868130f6334b88d676
  3. Extract PoC package and copy files: cp overlayer-report/MockAavePool.sol contracts/test/ cp -r overlayer-report/poc/ test/poc/ cp overlayer-report/hardhat.noFork.config.ts .
  4. Setup: mkdir -p contracts-poc cp -r contracts/overlayer contracts-poc/ cp -r contracts/overlayerbacking contracts-poc/ cp -r contracts/shared contracts-poc/ cp -r contracts/mock_ERC20 contracts-poc/ cp -r contracts/test contracts-poc/ cp -r contracts/liquidity contracts-poc/ npm install --force npx hardhat compile --config hardhat.noFork.config.ts
  5. Run PoC: npx hardhat test test/poc/poc_vuln02_credit_underflow.ts --config hardhat.noFork.config.ts
  6. Expected result: 4 passing, 1 pending PATH B: Panic(0x11) confirmed — totalBridgedOut(0) - 100 = UNDERFLOW PATH C: Bob's bridge permanently blocked, even 1 wei reverts forever

Suggested fix: totalBridgedOut = totalBridgedOut > amountReceivedLD ? totalBridgedOut - amountReceivedLD : 0;

Attachments

Attachments are hidden

This information is not publicly available.

Comments are hidden

This information is not publicly available.