SPB Git

Repository Public

QYV-SVC-044.json 3.3 KB 27 lines json

1{2  "id": "QYV-SVC-044",3  "title": "TRC-20 metadata of a custom token (decimals, symbol) and every account figure come from the first TRON node that answers",4  "severity": "low",5  "cvss_vector": "",6  "cvss_score": null,7  "cwe": "CWE-345",8  "masvs": "MASVS-NETWORK-1",9  "area": "service",10  "location": "Sources/QyvoraWallet/WalletService+Tron.swift:176",11  "tool": "manual-review",12  "rule": "",13  "status": "open",14  "fix_commit": "",15  "regression_test": "",16  "description": "Root cause: `TronClient.first` returns the first usable answer; apart from the reference block (QYV-SVC-040) nothing is compared between nodes. For a token the user adds by contract address, `readTronToken` takes `decimals()` and `symbol()` from that one answer and stores them in the profile; the amount the user types is converted with those decimals. A lying node that reports 8 decimals for a 6-decimal token makes '1 TOKEN' on the review 100 times what the user means in base units; the transaction is signed for the base-unit amount, which the lying node's balance and simulation answers let through, and the chain executes it if the real balance allows. The recipient is still the user's. Built-in tokens (USDT, USDC on mainnet) carry their decimals in the code and a contract that reports another value is not read. On an unaudited mainnet a custom token cannot be sent at all (no price, `unauditedLimitUnverifiable`), so this concerns test networks today and mainnet once the limits are lifted. The same single-answer rule lets a node misreport the balance, the resources, the chain parameters (bounded: QYV fee ceilings), the activation state of a recipient (at most the activation fees, about 1.1 TRX, are mis-stated) and the transaction status.",17  "recommendation": "Proposed fix (service): read `decimals()` on every configured node and require agreement when a token is added and again when a token payment is prepared (the pattern of `referenceBlock`), refuse a token whose decimals changed since it was added, and show the base-unit amount with the contract address on the review of a custom token. A common endpoint-agreement helper for the read calls of every chain would be the cleaner form; it touches the other families, hence not done here.",18  "evidence": "",19  "fingerprint": "c43cec57c481",20  "reported": "2026-12-05",21  "owner": "multichain-tron",22  "proposed_disposition": "Low, open. Proposed: implement the agreement of the nodes before the mainnet limits are lifted or custom tokens become payable on mainnet. Owner decision on the timing.",23  "mitigation_note": "Interface part done on 2026-12-05 (commits 8ffcf8a and 7b1e37e): the review of a token added by its address shows the amount in base units, as signed, next to the contract, and says that its decimals come from the endpoint that answered; the endpoint editor says what a single TRON node decides alone.",24  "open_note": "Not done: `decimals()` and `symbol()` of a custom TRC-20 token are still read from the first node that answers; the agreement of every configured node (the pattern of the reference block) is a change of `TronClient` that touches every read call. On an unaudited mainnet a custom token cannot be sent at all (it has no price for the ceiling, and since QYV-SVC-087 a profile entry cannot bring one).",25  "updated": "2026-12-05"26}27
Files main
Menu

Theme