Repository Public
1{2 "id": "QYV-SVC-105",3 "title": "TRON send-max did not send the most it could at a size boundary of the amount: up to one bandwidth fee stayed in the account",4 "severity": "low",5 "cvss_vector": "",6 "cvss_score": null,7 "cwe": "CWE-682",8 "masvs": "",9 "area": "transactions",10 "location": "Sources/QyvoraTron/TronSendPlanner.swift:312",11 "tool": "property-test",12 "rule": "tron-send-max",13 "status": "fixed",14 "fix_commit": "13fa3c1",15 "regression_test": "QyvoraTronTests (PlannerTests.swift): sendMaxAtAnEncodingBoundarySendsTheLargestAmountThatTravelsFree; security/tests PropertyAuditTests TronProperties.sendMaxNeverExceedsTheBalance (maximality instead of a fixed remainder)",16 "description": "Found by the full audit run on commit 1f3ba96 (property campaign tron-send-max, seed 2046850160945862867, 2 of 100 000 cases; reproduce with QY_AUDIT_REPLAY_SEED). Root cause: the send-max refinement alternates between two candidates when the fee depends on the encoded size of the amount. Example of the run: balance 2 223 499 sun, 267 bytes of free bandwidth left. The whole balance needs a 4-byte amount (268 bytes, above the free allowance, 268 000 sun burned); balance minus that fee is 1 955 499 sun, which fits a 3-byte amount (267 bytes, free). The planner kept 1 955 499 sun with an expected fee of 0, leaving 268 000 sun unsent, although 2 097 151 sun (the largest 3-byte amount) also travels free. Impact: no loss and no overspend — amount plus fee never exceeded the balance, the review showed the planned amount, and the remainder stays in the account; a 'send everything' left up to one bandwidth fee (0.268 TRX in the example) behind, more than the best possible. The audit property was also wrong: it bounded the remainder by ten bytes of bandwidth, which no planner can guarantee at such a boundary. The orchestrator recorded the failed audit test at its default severity (high, blocking); this entry records the analysed defect at the severity of its real impact — the owner may reclassify. Fix: the planner also tries the largest amount of every shorter encoding below the balance and keeps the best feasible one; the property now checks that amount plus fee fits the balance and that one more sun would not (maximality).",17 "recommendation": "None beyond the fix.",18 "evidence": "Full audit run on commit 1f3ba96: property campaign tron-send-max, 2 failed of 100 000 (seed 2046850160945862867); log security/reports/history/2026-12-05-full-run-1f3ba96-gate-failed.log. Counterexamples: balance 2 223 499 and 2 269 264 sun with 267 bytes of free bandwidth left; balance 267 000 sun with burned bandwidth.",19 "fingerprint": "f568bbf89bce",20 "fixed": "2026-12-05",21 "owner": "integrator",22 "reported": "2026-12-05",23 "residual_risk": "None for funds. The fee model is the planner's estimate: the chain may still charge the maximum fee shown in the review when resources are consumed between planning and inclusion.",24 "resolution_note": "The iterative refinement is replaced by an exact search over the nine varint lengths of the amount; the audit property now checks maximality (one more sun does not fit) instead of a fixed remainder.",25 "verification": "QyvoraTronTests on the laptop (Swift 6.4.2, release): 65 tests pass, incl. the regression test. Audit package on M5M36 in full mode: the recorded seed and eight other seeds pass; TronProperties, TronVectors, TronDiff and MultichainWalletProperties pass."26}27