Root Cause
The Sandbox deployed an OFT (Omnichain Fungible Token) contract for SAND on Base that included an approveAndCall function. This function allowed an external caller to set LayerZero delegate permissions on behalf of the contract. The attacker exploited this to designate themselves as the bridge delegate, granting unauthorized control over cross-chain message verification and token minting.
This was an application-level misconfiguration in The Sandbox's OFT contract; it is not a flaw in the LayerZero protocol itself.
// Simplified vulnerable pattern (illustrative)
function approveAndCall(
address spender,
uint256 amount,
bytes calldata data
) external returns (bool) {
_approve(msg.sender, spender, amount);
// VULNERABILITY: no restriction on what 'data' can do
// Attacker encodes a setDelegate() call to LayerZero endpoint
ILayerZeroEndpoint(lzEndpoint).setDelegate(attackerAddress);
return true;
}
Once the attacker held delegate authority over the LayerZero endpoint for the Base SAND OFT, they could forge cross-chain messages and instruct the contract to mint arbitrary amounts of SAND on Base and BNB Smart Chain without any corresponding lock on Ethereum.
Attack Steps
| Step | Action | Detail |
|---|---|---|
| 1 | Identify approveAndCall vector | SAND OFT on Base exposes unguarded LayerZero delegate setter |
| 2 | Call approveAndCall with crafted payload | Encodes setDelegate(attackerAddress) to LayerZero endpoint |
| 3 | Attacker becomes bridge delegate | Can forge cross-chain mint messages |
| 4 | Mint unbacked SAND on Base and BSC | 703 events over 5 hours; 329.24T SAND minted (face value ~$49B) |
| 5 | Drain Ethereum OFT Adapter | 14.75M real SAND drained in under 60 seconds → |
| 6 | Containment | The Sandbox disabled Base and BSC bridging; removed LayerZero peer config via multisig |
Impact
- Actual loss: ~14.75M SAND ≈ $675K (80 ETH)
- Unbacked supply minted: ~329.24T SAND (nominal ~$49B; not sellable at scale)
- Chains affected: Base (primary exploit), BNB Smart Chain (secondary)
- Unaffected: SAND on Ethereum and Polygon
- Date: 21–22 August 2026
- Containment: The Sandbox disabled bridging within hours; confirmed < 0.01% of SAND supply was redeemable
Lessons for Auditors
- No privileged calls through approveAndCall: The
approveAndCallpattern should never be able to execute calls that modify bridge authority, ownership, or delegate settings. Treat it as equivalent to an arbitrary external call and restrict what thedatapayload can target. - LayerZero delegate separation: OFT contracts that use LayerZero should never allow the delegate address to be set by an unpermissioned external call. The delegate setter should be
onlyOwneroronlyMultisigat minimum. - Bridge invariant checks: Minting on a destination chain should be provably one-to-one with a lock on the source chain. Consider using a monotonic counter or a merkle proof of source-chain lock.
- Mint rate-limiting: Large cross-chain mints (e.g., > 1% of circulating supply in a single transaction) should trigger a pause or a multi-sig confirmation requirement.