# Two different transactions can result in the same txnHash value, thus breaking the approval process of transaction minting

DestinationBridge hashes only version/srcSender/amt/nonce into txnHash, so identical payloads from different source chains/addresses collide and overwrite each other's approval threshold set.

- Payout: Audit contest
- Severity: medium
- Program: Ondo Finance
- Found by: Udsen
- Disclosed: 2023-10-12
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2023-09-ondo#m-03
- Library page: https://bugbountylibrary.com/r/c4%3A2023-09-ondo%3AM-03
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** DestinationBridge.sol cross-chain mint approval contract
**Root cause:** txnHash = keccak256(payload) where payload only encodes version, srcSender, amt, nonce; srcChain and srcAddr are excluded, so distinct source chains/contracts producing identical values yield the same hash. Nonce-spent tracking is keyed per srcChain/srcAddr, so it does not prevent cross-source collisions.
**Steps:**
1. Observe `_execute` decodes payload as `(bytes32 version, address srcSender, uint256 amt, uint256 nonce)` and computes `bytes32 txnHash = keccak256(payload)`.
2. Note nonce replay guard is `isSpentNonce[chainToApprovedSender[srcChain]][nonce]`, scoped per source chain/sender, not global.
3. Two different srcChains/srcAddrs submit payloads with identical version, srcSender, amt, nonce → identical txnHash.
4. Second `_execute` overwrites `txnHashToTransaction[txnHash]` and `txnToThresholdSet[txnHash]`, resetting approvals of the first transaction.
**How found:** Code review of the payload hashing and nonce-spent keying: noticed the hash omits srcChain/srcAddr while the replay guard includes them, creating a mismatch that allows cross-source hash collisions.
**Exploitation:** A colliding payload from a different source chain/address overwrites the stored Transaction and TxnThreshold (with empty approvers array) for an existing txnHash, invalidating prior approvals and breaking the mint approval flow for the legitimate transaction.
**Insight:** When a replay guard is keyed on more fields than the identifier hash, the hash is under-specified: check that every field used to scope nonce/replay state is also committed into the hash that indexes approval state.

