Repository Public
1{2 "id": "QYV-SVC-003",3 "title": "Unspent-output totals from a hostile Esplora endpoint overflow UInt64 / Int64 and crash the wallet",4 "severity": "medium",5 "cvss_vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H",6 "cvss_score": 5.9,7 "cwe": "CWE-190",8 "masvs": "MASVS-CODE-4",9 "area": "wallet",10 "location": "Sources/QyvoraWallet/WalletService+Bitcoin.swift:218",11 "tool": "manual-review",12 "rule": "",13 "status": "fixed",14 "fix_commit": "f111cfb, 1936fc4",15 "regression_test": "QyvoraWalletTests.AuditRegressionTests/hostileUnspentListsCannotOverflowTheBalance, unspentTotalAboveTheMoneySupplyIsRefused; QyvoraBitcoinTests.BitcoinAuditRegressionTests/builderRefusesCandidatesWhoseTotalExceedsTheMoneySupply",16 "description": "Root cause: every unspent output was bounded individually (value <= 21 million BTC) but their total was not. The balance (`reduce(0) { $0 + $1.value }`), the per-script balances and, later, the input sums of `BitcoinTransactionBuilder` (`total(selected)` in UInt64, effective values in Int64 for Branch and Bound) used the trapping `+`. Outputs of an address whose history is truncated cannot be cross-checked against their funding transactions, so an endpoint could list 4 500 outputs of 2.1e15 satoshis on each of two addresses (9 000 x 2.1e15 > 2^64). Impact: the process trapped during synchronization (or when a payment was prepared): remote, repeatable denial of service. No fund movement is possible this way: SegWit signatures commit to the real amounts. Verified: with the guard removed on the build node the regression test exits with SIGTRAP.",17 "recommendation": "Fixed in two places: the synchronization refuses a list whose running total leaves the monetary range (`untrustedResponse`), and the builder refuses candidates whose total exceeds 21 million BTC (`invalidAmount`) before any selection arithmetic (Sources/QyvoraBitcoin/TransactionBuilder.swift:200).",18 "evidence": "",19 "fingerprint": "3e0c60694125",20 "reported": "2026-12-04",21 "owner": "review-b"22}23