Repository Public
1{2 "id": "QYV-SVC-040",3 "title": "A TRON transaction prepared for a test network could be made valid on mainnet by the test node (no network in the signed bytes; reference block taken from the first answer)",4 "severity": "high",5 "cvss_vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N",6 "cvss_score": 5.3,7 "cwe": "CWE-294",8 "masvs": "MASVS-CRYPTO-1",9 "area": "service",10 "location": "Sources/QyvoraWallet/WalletService+Tron.swift:111",11 "tool": "manual-review",12 "rule": "",13 "status": "fixed",14 "fix_commit": "03a3554",15 "regression_test": "QyvoraWalletTests.TronAuditRegressionTests/aTestNetworkTransactionTheMainNetworkWouldAcceptIsNeverSigned; QyvoraWalletTests.TronAuditRegressionTests/aNodeThatGivesAnotherReferenceBlockStopsThePayment; QyvoraTronTests.TronAuditRegressionTests/aNodeWithAnotherBlockAtTheSameHeightIsADisagreement; QyvoraTronTests.TronAuditRegressionTests/whetherAChainAcceptsAReference",16 "description": "Root cause: `Transaction.raw` carries no chain identifier. The only thing that ties a TRON transaction to a network is its reference block (TaPoS: `ref_block_bytes` = the two low-order bytes of a block number, `ref_block_hash` = bytes 8 to 15 of that block's id), and the wallet took it from `latestSolidBlock()`, that is from the first node that answered. The wallet account is the same secp256k1 key and the same address on mainnet, Nile and Shasta (m/44'/195'/0'/0/0). A Nile or Shasta node — one is enough; Shasta has a single default endpoint — that answers the genesis check correctly (the genesis id is a public constant, `verifyChain` cannot tell a liar from an honest node) and then hands out a recent MAIN-NETWORK block as its 'latest irreversible block' obtains, when the user sends test TRX or a test token, a signed transaction that the main network accepts for as long as it is not expired: the wallet broadcasts it to that very node. Impact: real TRX (or a real TRC-20 with the same contract address) leaves the account on mainnet for the recipient and amount of the 'test' payment, although the mainnet switch may be off and although the per-transaction limits of an unaudited build (150 USD of TRX, known tokens only) were never applied: both only look at the network the wallet believes it is on. Precondition: a lying or compromised test-network endpoint (default or user-configured), funds on the same address on mainnet, and a test payment by the user. The reverse direction (a mainnet transaction replayed on a test network) moves nothing of value.",17 "recommendation": "Fixed in three layers. (1) `TronClient.referenceBlock()`: the reference is the oldest of the latest irreversible blocks of every configured node that answers, and each other node must give the same block id for that number (`/walletsolidity/getblockbynum`); a different id is `NetworkError.disagreement` → `WalletError.wrongChain`, nothing is built. The review says how many nodes vouched for the block. (2) `requireNotValidOnTronMainnet`: for a test network, before the review is returned and again before signing, the wallet asks the main-network nodes (genesis-verified) whether they would accept the reference (`TronClient.acceptsReference`: the latest block at or under the head whose number ends with `ref_block_bytes` must not have `ref_block_hash`); accepted → `wrongChain`; no answer → `network`, nothing is signed. Only a block number goes out. (3) The cold review of a test-network transaction carries the warning `tron.network-not-bound`. Residual: an offline cold device cannot make check (2) — recorded as QYV-APP-040; with a single reachable node there is nothing to cross-check in (1), which the review states; a main-network endpoint that lies in concert with the test endpoint defeats (2).",18 "evidence": "Before the fix the Nile payment of `aTestNetworkTransactionTheMainNetworkWouldAcceptIsNeverSigned` was reviewed, signed and broadcast although the model's main network held the block the Nile node gave; `prepareTronSend` called `client.latestSolidBlock()` (first answer). Severity: CVSS 5.3 (medium); wallet impact 'a signature that does not correspond to what was shown [the network], with a malicious endpoint' is the high class of the policy; the higher applies. Same class and rating as QYV-SVC-022 (Solana).",19 "fingerprint": "f207ea8628f4",20 "reported": "2026-12-05",21 "owner": "multichain-tron"22}23