agents/skills/evm/cross-chain-message-integrity/SKILL.md
Type Thought-template (instantiate before use) - Trigger Pattern CROSS_CHAIN_MSG flag detected (protocol RECEIVES cross-chain messages)
npx skillsauth add plamentsv/plamen cross-chain-message-integrityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Type: Thought-template (instantiate before use) Trigger Pattern: CROSS_CHAIN_MSG flag detected (protocol RECEIVES cross-chain messages) Inject Into: Breadth agents, depth-external Finding prefix:
[CMI-N]Rules referenced: R1, R2, R4, R8, R10
Covers: message endpoint authentication, peer/remote verification, replay protection, payload validation, and message ordering for bridge-receiving protocols.
This skill is SEPARATE from CROSS_CHAIN_TIMING (which covers stale state and latency arbitrage for L2 interactions). Use this skill when the protocol RECEIVES and PROCESSES inbound cross-chain messages. Use CROSS_CHAIN_TIMING when the protocol READS state synced across chains.
lzReceive|_ccipReceive|receiveWormholeMessages|onOFTReceived|
setPeer|setTrustedRemote|_nonblockingLzReceive|executeMessage|
_processMessageFrom|ILayerZeroReceiver|IAny2EVMMessageReceiver|
endpoint.*receive|bridge.*receive|relayer.*deliver|_lzReceive
For each function that processes inbound cross-chain messages:
| # | Function | Bridge Protocol | Source Auth? | Payload Validated? | State Modified | Access Control | |---|----------|----------------|-------------|-------------------|----------------|---------------|
For each entry:
For EACH message-receiving function:
| # | Check | Status | Location |
|---|-------|--------|----------|
| 1 | msg.sender == endpoint/router verified | YES/NO | {line} |
| 2 | Endpoint address immutable or admin-protected | YES/NO | {line} |
| 3 | Modifier checks the CORRECT address variable | YES/NO | {line} |
Missing caller check → CRITICAL: Anyone can fabricate message data and trigger mints/unlocks.
| # | Check | Status | Location | |---|-------|--------|----------| | 1 | Source chain ID validated against allowed set | YES/NO | {line} | | 2 | Source sender validated against registered peer | YES/NO | {line} | | 3 | BOTH checks present (chain AND sender) | YES/NO | {line} |
Pattern: Checks _origin.srcEid (chain) but not _origin.sender (peer) → accepts messages from ANY contract on allowed chains.
For each function that configures trusted peers/remotes:
| # | Check | Status | Location | |---|-------|--------|----------| | 1 | Access-controlled (onlyOwner/multisig/timelock) | YES/NO | {line} | | 2 | Validates new peer is non-zero | YES/NO | {line} | | 3 | Emits event for off-chain monitoring | YES/NO | {line} | | 4 | Timelock/delay on peer changes | YES/NO | {line} |
_origin.sender == peers[chainId] pass when BOTH are zero?address(X) on Chain A == address(X) on Chain B means same owner?Tag: [TRACE:setPeer(chain={X}) → access={check} → zero_check={YES/NO} → default_peer={value}]
| # | Check | Status | Location | |---|-------|--------|----------| | 1 | Each message processed exactly once | YES/NO | {line} | | 2 | Replay check BEFORE state changes | YES/NO | {line} | | 3 | Out-of-order messages handled | YES/NO | {line} | | 4 | Sequence gaps handled gracefully | YES/NO | {line} |
Tag: [TRACE:message_nonce={N} → replay_check={method} → before_state_change={YES/NO}]
abi.decode with expected types)For each decoded value:
If message triggers execution of decoded calldata:
transferFrom/approve on tokens the contract holds or has approvals for?Tag: [BOUNDARY:payload_amount={MAX} → decoded → processed_as={result}]
Tag: [TRACE:message_N_fails → message_N+1={blocked/processed} → recovery={mechanism}]
setPeer behind multisig + timelock → low unauthorized change risk{CONTRACTS} -- Contracts with message receiving functions
{BRIDGE_PROTOCOL} -- Bridge/messaging protocol (LayerZero, CCIP, Wormhole, Axelar, Hyperlane)
{RECEIVE_FUNCTIONS} -- Functions that process inbound messages
{PEER_SETTERS} -- Functions that configure trusted peers/remotes
{STATE_MODIFIED} -- State modified by message processing
| Step | Required | Completed? | Notes | |------|----------|------------|-------| | 1. Message Receiving Surface Inventory | YES | | All receiving functions | | 2. Endpoint Authentication Audit | YES | | Caller + source origin | | 3. Peer Registry Security | IF configurable peers | | Setter access, binding, defaults | | 4. Replay Protection | YES | | Uniqueness, cross-chain, re-org | | 5. Payload Validation | YES | | Format, bounds, arbitrary execution | | 6. Message Ordering and Delivery | IF ordered messages | | Dependencies, blocked recovery |
development
Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project documentation checks. Generates a scored Audit Readiness Report and optionally runs static analysis. Trigger on: "prepare for audit", "audit readiness", "pre-audit check", "audit prep", "NatSpec check", or any request to review a Solidity codebase before a security review.
development
Launch the Plamen deterministic Web3 security audit pipeline
development
Run the Plamen smart-contract audit wizard in Codex
testing
Launch the Plamen deterministic L1 infrastructure audit pipeline