Web3 Tech Brief: Anatomy of a Bridge That Paid 6x for One Transfer
Summary
The speaker details a critical vulnerability in a counter stake-style bridge that allowed an attacker to drain user-locked tokens by exploiting a replay protection flaw. The bug stemmed from including mutable, attacker-controlled fields in the hash used to ensure idempotency, enabling multiple claims for a single transfer. The exploit resulted in 2.4 billion base units being paid out, extracting 2 billion from other users. The analysis demonstrates how to verify the bug using the project's own formula evaluator library and verified deployed artifact hashes. The speaker concludes with generalizable audit lessons on identifying immutable identity bytes and hardening replay guards.
Key takeaways
- 1 Immutable, immutable, the claimed timestamp of the foreign transaction, chosen by the claimant, the recipient on this chain, chosen by the claimant, the assistance reward, chosen by the claimant, arbitrary payload, chosen by the claimant, four of the seven inputs are attacker controlled.
Speaker 1 · 2:40
- 2 hash of the audited source file with the platform's own and compared it to the constant in the factory. Byte for byte match. That single line converts your repo has a bug into the thing running on mainnet has a bug, which is the difference between a rejected report and a paid one.
Speaker 1 · 5:22
Episode sections
- 0:00 – 1:13
Introduction and Vulnerability Overview
The speaker introduces a case study of a counter stake-style bridge that paid out 6x for a single transfer due to a replay vulnerability. The bug involved mutable claim fields being used in the replay protection hash, allowing an attacker to drain user-locked tokens without stealing private keys or breaking cryptography.
- 1:13 – 2:00
Bridge Mechanics and Security Model
The bridge operates by locking tokens on Chain A and paying out on Chain B against foreign transaction IDs. The security model relies on idempotency: a specific foreign transfer must be claimable exactly once, regardless of how many times it is submitted or what optional fields are changed.
- 2:00 – 3:12
The Flawed Replay Guard Implementation
The bridge used a declarative formula language where replay protection was a storage convention based on a hash of claim inputs. The hash included four attacker-controlled fields (timestamp, recipient, reward, data) alongside two immutable fields, meaning the uniqueness key could be regenerated by changing optional fields.
- 3:12 – 4:15
Exploit Mechanics and Economic Impact
Changing one byte of an optional field produced a different hash and a fresh claim record. The marginal cost was low (gas and stake), while the revenue was the full transfer amount. This allowed draining the pool by repeating claims, leading to insolvency for honest users.
- 4:15 – 5:39
Deterministic Proof via Formula Evaluator
The vulnerability was proven using the project's own formula evaluator library, avoiding mainnet interaction. The harness asserted state changes and printed markers, showing three distinct markers for one transaction ID. The deployed artifact hash was verified against the factory contract to confirm the bug existed on-chain.
- 5:39 – 6:39
Correct Fix and Hardening Measures
The correct fix is to key uniqueness on the minimum immutable identity of the transfer, excluding mutable fields from the hash. Additional hardening includes validating optional fields against attested values, capping transfer claims, and enforcing a global accounting invariant that total payouts do not exceed the attested amount.
- 6:39 – 7:19
Generalizable Key Design Lessons
The issue is a key design bug applicable to any system indexing state by a hash including user input (e.g., ERC20 permits, signature replay guards). The core audit question is identifying the smallest set of bytes that uniquely identifies an event and ensuring no attacker-controlled bytes are in the key.
- 7:19 – 8:29
Audit Methodology and Conclusion
The speaker advises auditing the replay guard first, classifying fields as immutable, attested, or chosen, and building a harness before writing prose. The report includes a reproduction anyone can run and a verified deployed artifact hash. Full identifiers will be published after the fix ships.
Claims worth verifying
One foreign transfer of 400,000,000 base units was claimed three times, resulting in a total payout of 2,400,000,000 base units.
Unknown speaker ·0:33
How to verify: Check the original HackerNoon article at https://hackernoon.com/anatomy-of-a-bridge-that-paid-6x-for-one-transfer for the specific numbers and transaction logs if published later. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The extra payout came from tokens other users had locked in the agent, with no private keys stolen or cryptography broken.
Unknown speaker ·0:33
How to verify: Review the post-mortem or bounty report from Shroud Audit once identifiers are released, or check on-chain transaction history for the specific bridge contract if identified. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The bridge is a 'counter stake style bridge' that moves value by locking on one chain and paying out against a foreign transaction on another.
Speaker 1 ·1:13
How to verify: Compare the described mechanism with known counter-stake bridge architectures (e.g., Thorchain, THORChain) or the specific project's documentation once identified. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The replay protection hash included four attacker-controlled fields: timestamp, recipient, reward, and arbitrary payload.
Speaker 1 ·2:40
How to verify: Review the source code of the bridge's formula language implementation or the specific contract's hash function logic in the verified source code. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
Changing one byte of one optional field produces a different hash, a different marker, and a fresh claim record.
Unknown speaker ·3:12
How to verify: Reproduce the bug using the project's formula evaluator library as described in the harness, or analyze the hash function's sensitivity to input changes. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The marginal cost of an extra claim is the stake and gas, while the marginal revenue is the full transfer amount.
Unknown speaker ·3:37
How to verify: Calculate the gas cost and stake requirement for the specific bridge contract and compare it to the transfer amount to verify the economic incentive. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The platform ships its formula evaluator as a library in the core package, allowing deterministic proof without mainnet interaction.
Speaker 1 ·4:39
How to verify: Check the project's GitHub repository or documentation for the core package and its formula evaluator library. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The bridge instantiates agents from a factory that hard codes a base agent hash, which was verified byte-for-byte against the audited source file.
Speaker 1 ·5:22
How to verify: Compare the hash of the audited source code with the constant stored in the factory contract on-chain using a block explorer. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The correct fix is to key uniqueness on the minimum immutable identity of the transfer and keep mutable fields out of the uniqueness key.
Unknown speaker ·5:50
How to verify: Review the proposed fix in the bounty report or the final patch once published, comparing the new hash inputs to the old ones. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
The bug pattern shows up in ERC20 permits if the nonce is dropped, allowing replay with a new deadline.
Speaker 1 ·6:59
How to verify: Analyze ERC20 permit implementations to see if they include the nonce in the signature hash, or check for known vulnerabilities in permit-based systems. For recent events, verify 2026-08-25 through 2026-11-25. Use another period only when the speaker explicitly names it.
Do your own research
- Verify the deployed artifact hash against the factory contract's hardcoded base agent hash to confirm the bug exists in the live deployment.
- Review the project's formula evaluator library to understand how deterministic proofs are constructed and executed.
- Check if the bridge's replay protection hash excludes all attacker-controlled mutable fields (timestamp, recipient, reward, data).
- Confirm that total payouts do not exceed the attested amount via global accounting invariants.
- Look for counter-arguments regarding the necessity of mutable fields in the uniqueness key for user flexibility.
- Verify the gas costs and stake return mechanisms to assess the marginal cost of exploitation.
- Check for any post-exploit governance actions or recovery mechanisms implemented by the protocol.
- Review the specific ERC20 permits or signature replay guards used by similar bridges for comparable vulnerabilities.
Full transcriptexpand
Voices are numbered in the order we told them apart; a name appears only when the episode itself identifies the speaker.
0:00Speaker 1: This audio is presented by Hacker Noon, where anyone can learn anything about any technology. Anatomy of a bridge that paid 6x for one transfer by Shroud Audit. Note A private disclosure is in flight, so the protocol and chain are withheld here. The bug pattern, the harness, and the fix are not. Bridges are accounting machines with a public attack surface. Every message that arrives from the other chain is, from the contract's point of view, just a bag of fields that somebody typed. The only thing standing between that bag of fields and the treasury is a replay guard.
0:33Unknown speaker: If
0:33Speaker 1: the guard is built out of the wrong bytes, it is not a guard at all, it is a suggestion. I found one of those in a counter stake style bridge, the short version. One foreign transfer of base units was claimed three times, and the bridge paid. The extra came out of tokens other users had locked in the agent. No private key was stolen, no cryptography was broken, no oracle was manipulated. The uniqueness key simply included fields the claimant controls. This is the anatomy of that bug, the harness that proved it against the project's own execution engine, and the checklist I now run on every bridge IRV. 1. How the bridge is supposed to work. A counter stake bridge moves value in one direction by locking it, and in the other direction by paying out against a foreign transaction.
1:19Unknown speaker: The
1:19Speaker 1: payout path is the interesting one. 1. A user burns or locks tokens on chain A and gets a transaction id. 2. On chain B, they submit a claim, sender address, TXID, timestamp, amount, recipient, optional data, plus a reward for whoever assists. 3. The claim is recorded. with a challenger window. If nobody disputes it, the claimant withdraws. 4. A challenger who disputes and wins takes the stake. Step 3 is where money leaves. Which means step 2 must be idempotent. The same foreign transfer must be claimable exactly once, forever, no matter how many times it is submitted or what the submitter puts in the optional fields.
2:00Unknown speaker: That
2:00Speaker 1: is the entire security model of the payout. path. Everything else, challenge periods, stakes, governance, is decoration on top of, one transfer, one payment. 2. The guard, and why it was keyed wrong. The bridge is written in a declarative formula language, a state machine with, and, where storage is a flat key value map. There is no Solidity style mapping, so replay protection is a storage convention. Write a marker on under a key derived from the claim and bounce if the marker already exists. Here is the check, verbatim, with identifiers removed. Read the inputs to that hash. Immutable, it is part of the foreign transaction. Immutable, immutable, the claimed timestamp of the foreign transaction, chosen by the claimant, the recipient on this chain, chosen by the claimant, the assistance reward, chosen by the claimant, arbitrary payload, chosen by the claimant, four of the seven inputs are attacker controlled. The guard asks, Have I seen this exact combination before? When the only question that matters is, have I seen this transfer before?
3:04Unknown speaker: And
3:04Speaker 1: there is no second index. I grepped every file in the repository for a transfer keyed marker, anything of that shape, and found none.
3:12Unknown speaker: The
3:13Speaker 1: uniqueness marker is the only thing preventing. a replay, and it is keyed on a hash the attacker can recompute at will. 3. The exploit is embarrassingly cheap. Changing one byte of one optional field produces a different hash, a different marker, and a fresh claim record. That is it, that is the whole exploit. The cost of an extra claim is the stake, and the stake comes back with the payout after the challenge window.
3:37Unknown speaker: So
3:37Speaker 1: the marginal cost of claim. NIS opportunity cost and gas, and the marginal revenue is the full transfer amount. The bridge pays for one transfer of, the loss to the pool is. For the transaction I used, stake, payout per claim. Note what the third line does, it changes by 60 seconds.
3:55Unknown speaker: The
3:55Speaker 1: bridge does check that is not in the future and not absurdly old, but it never checks it against the actual foreign transaction, because it cannot. the value I sat tested, not proven. So the claimant picks any timestamp inside the accepted window and gets another claim. Scale is bounded only by the agent's balance, repeat claim n times, drain the pool, and the protocol is insolvent for every honest user still waiting to withdraw. This is why the impact lands as direct theft of user funds, and note is as a nuisance bug. 4. Proving it without touching mainnet. The useful part of this finding is not the bug, it is that I could demonstrate it against the project's own code, deterministically, in a few seconds, with no fork and no RPC.
4:38Unknown speaker: The
4:39Speaker 1: platform ships its formula evaluator as a library in the core package.
4:43Unknown speaker: You
4:43Speaker 1: can require it directly, feed feeded it the agent's definition, send trigger messages, and read back the resulting state and outgoing payments. That turns, I think this is replayable, into a table of payments.
4:55Unknown speaker: The
4:55Speaker 1: harness shape. Two details make this credible to a triager. Assert on the state, not just on the messages.
5:02Unknown speaker: The
5:03Speaker 1: harness prints after each claim, and the markers. Seeing three distinct markers for one TXID as the bug, stated in the project's own data structures. Prove you audited the deployed artifact. A repository is not a deployment. The bridge instantiates agents from a factory that hard codes a base agent hash. So I computed the hash of the audited source file with the platform's own and compared it to the constant in the factory. Byte for byte match. That single line converts your repo has a bug into the thing running on mainnet has a bug, which is the difference between a rejected report and a paid one. 5. The fix is one line, and it is not the line you think.
5:43Unknown speaker: The
5:43Speaker 1: tempting fix is to add and to a second marker. That is better, but it still trusts a value the claimant supplies.
5:50Unknown speaker: The
5:50Speaker 1: right shape is to key on the minimum immutable identity of the transfer and keep every mutable field out of the uniqueness key. Then validate the optional fields against the transfer instead of hashing the Minto its identity. Must match the attested timestamp of the foreign transaction. Or fall inside a narrow tolerance enforced by the Oracle that attests it. Must match the attested amount exactly, this one was already correct. Must be bounded by a governance parameter, not chosen freely, otherwise it becomes a second extraction channel even with a correct uniqueness key. And our routing information, they belong in the claim record, never in the key. Two hardening measures are worth adding while you are in there. Upper transfer claim counter with a hard cap of one. And a global accounting invariant that total payouts for a given foreign TXID never exceed its attested amount.
6:39Unknown speaker: The
6:39Speaker 1: invariant is cheap and catches the next variant of this bug, not just this one. 6. The generalizable lesson: this is not a bridge bug, it is a key design bug, and it shows up anywhere. state is indexed by a hash that includes user input, claim, withdraw systems, the case above. Signature replay guards, hashing but forgetting that is attacker chosen, so the same intent can be re-signed into multiple valid digests. Coupon and voucher contracts: the voucher ID derived from where is free. ERC20 permit, drop the nonce and you get a replay with a new deadline. The audit question that finds all of them is the same. What is the smallest set of bytes that uniquely identifies this event? And is every byte in my key actually in that set? If a byte in the key is attacker controlled, the key is not an identity, it is a namespace the attacker can expand at will. 7. What I would do differently next time: read the replay guard first, before the business logic. It is the highest leverage 20 line. lines in any bridge. Write down for every field in the trigger, whether it is immutable, attested, or chosen. Any field in the third column that appears in a uniqueness key is a finding. Build the harness before writing pros. The payments table is the report, the pros is commentary. Always compute the deployed Floyd artifact hash. Repo
7:59only findings get downgraded, and rightly so. The report is with the maintainer. maintainers now, with a reproduction anyone can run in under a minute. When the fix ships, I will publish the full identifiers, the diff and the postmortem. Until then, the pattern is the useful part, and if you maintain a bridge, the 20 minutes it takes to check your replay key is the cheapest insurance you will buy this year. Thank you for listening to this Hackernoon story, read by Artificial Intelligence. Visit Hackernoon.com to read. write, learn, and publish.