Reproduced Exploit
Chakra: a callback digest without from_chain marks the escrow Failed and locks 10 CKR
verifySignature hashes txid, from_handler, to_handler, and status. It does not hash from_chain. One commitment therefore verifies for every chain string. A callback with from_chain set to evil passes verification, the handler returns false, and the tx is stored as Failed. The retry with ethereum re…
Loss
10 CKR stuck in the settlement
Chain
Ethereum
Category
bridge
Date
Aug 2024
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 49147-h-14-malicious-actors-can-manipulate-the-cross-chain-callbac. Standalone Foundry PoC and full write-up: 49147-h-14-malicious-actors-can-manipulate-the-cross-chain-callbac_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/bridge/missing-validation·vuln/auth/signature-validation
Key info#
| Field | Value |
|---|---|
| Loss | 10 CKR stuck in the settlement |
| Vulnerable contract | Settlement.receive_cross_chain_callback |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2024-08 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Validator digest omits from_chain, so a bad chain stores Failed |
TL;DR#
verifySignature hashes txid, from_handler, to_handler, and status. It does not hash from_chain. One commitment therefore verifies for every chain string. A callback with from_chain set to evil passes verification, the handler returns false, and the tx is stored as Failed. The retry with ethereum reverts. The 10 CKR escrow is not paid to the user. The control puts from_chain in the digest and a signature over ethereum releases the 10 CKR.
Background#
Code4rena's August 2024 Chakra contest, finding H-14 by MrPotatoMagic. receive_cross_chain_callback is permissionless. The handler's is_valid_handler accepts only the chain string ethereum with handler id 42. A false return from the handler writes CrossChainMsgStatus.Failed. The judge kept the issue at high because the final callback leg of every tx can be forced into that state. This model runs on one chain: the bug is the local callback, not a second execution environment.
The vulnerable code#
bytes32 message_hash = keccak256(abi.encodePacked(txid, from_handler, to_handler, status));
require(signatureVerifier.verify(message_hash, signatures, sign_type), "Invalid signature");
if (is_valid_handler(from_chain, from_handler) == false) {
return false;
}
if (Handler(to_handler).receive_cross_chain_callback(...)) {
create_cross_txs[txid].status = status;
} else {
// @> VULN: from_chain was not signed, so a forged chain stores Failed and the escrow cannot be retried
create_cross_txs[txid].status = CrossChainMsgStatus.Failed;
}
viaIR folds the Failed store into the if at the handler call. The playground anchors that branch.
Root cause#
The commitment is identical for evil and ethereum. The handler still rejects the unknown chain, and the settlement treats that rejection as a permanent failure instead of leaving the tx Pending.
Preconditions#
- Tx 7 is Pending with 10 CKR escrowed for the user.
- The caller can submit the digest of
(txid, from_handler, to_handler, Success). Becausefrom_chainis not in that digest, the evil chain verifies. is_valid_handleris true only forethereum.
Attack walkthrough#
- 10 CKR is escrowed for tx 7. Status is Pending.
- The attacker builds the digest without a chain string.
receive_cross_chain_callbackis called withfrom_chain = "evil"and that commitment.- Verification passes. The handler returns false.
- The branch stores Failed.
- The same commitment with
ethereumreverts onAlreadySettled. - The settlement still holds 10 CKR. The user holds 0.
Diagrams#
Impact#
The user's 10 CKR is locked in the settlement. A correct chain string cannot complete the callback after the status is Failed. The control releases the 10 CKR to the user and leaves the settlement empty.
Remediation#
Include from_chain in the signed digest, and do not overwrite a Pending tx with Failed when the only failure is an unexpected chain string.
How to reproduce#
cd 49147-h-14-malicious-actors-can-manipulate-the-cross-chain-callbac_exp
forge test -vv
test_exploit_forged_chain_locks_10_tokens asserts Failed, a reverted retry, and 10 CKR still escrowed. test_control_signing_from_chain_releases_the_escrow signs the digest that includes ethereum and asserts the user receives 10 CKR. Captured output is output.txt.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/49147-h-14-malicious-actors-can-manipulate-the-cross-chain-callbac.md
- Code4rena report: https://code4rena.com/reports/2024-08-chakra
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 49147-h-14-malicious-actors-can-manipulate-the-cross-chain-callbac_exp (evm-hack-registry mirror).
- AuditVault finding: 49147-h-14-malicious-actors-can-manipulate-the-cross-chain-callbac.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.