cross-chain-messaging

Solid

Detect cross-chain messaging bugs — replay protection gaps, untrusted-remote acceptance, default-config inheritance, validator-set misconfig, force-include vulnerabilities, chainId / domain-separator omissions. Activate on `_lzReceive`, `ccipReceive`, `handle` (Hyperlane), `receiveMessage`, `verifyVAA`, IRouterClient, IMailbox, EndpointV2, OApp/OFT, LayerZero / CCIP / Hyperlane / Wormhole / Axelar / Polyhedra integration code.

AI & Automation 38 stars 5 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
53
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Cross-chain messaging detection ## When this applies - Any application built on LayerZero, CCIP, Hyperlane, Wormhole, Axelar, Polyhedra ZKBridge - Native L1↔L2 messengers (Optimism, Arbitrum, Base, zkSync, Linea, Scroll) - Custom bridges / message-passing layers ## Detection patterns ### `_lzReceive` accepts any remote (CRITICAL — LayerZero) ```solidity function _lzReceive(bytes calldata srcAddr, bytes calldata payload) internal { // no allowlist of trusted remote _executeMint(payload); // ← any chain can mint } ``` Required: `require(trustedRemote[srcChainId] == srcAddr)`. ### CCIP `ccipReceive` callable directly (CRITICAL) ```solidity function ccipReceive(Any2EVMMessage calldata m) external { // ← public, no router check _execute(m.data); } ``` Required: `require(msg.sender == address(router))`. ### Hyperlane `handle` without ISM check (CRITICAL) Hyperlane's default ISM is permissive. Apps must set their own. If `handle` is called by mailbox without app-side validation, anyone can spoof messages. ### Wormhole VAA double-spend (CRITICAL) ```solidity function complete(bytes calldata vaa) external { IWormhole.VM memory vm = wormhole.parseAndVerifyVM(vaa); _mint(vm.payload.to, vm.payload.amount); // ← no per-VAA seen check } ``` Required: track `usedVAAs[vm.hash] = true` after first use. ### Replay across chains (CRITICAL) Same payload accepted on multiple destination chains. Include destination `chainId` in the signed/verified payload. ### ...

Details

Author
iktok90-design
Repository
iktok90-design/ai-smart-contract-auditor
Created
1 weeks ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category