SPB Git

Repository Public

QYV-SVC-101.json 2.8 KB 27 lines json

1{2 "id": "QYV-SVC-101",3 "title": "A plan presented as a sweep of exposed coins was signed without checking that it pays the wallet",4 "severity": "low",5 "cvss_vector": "",6 "cvss_score": null,7 "cwe": "CWE-345",8 "masvs": "MASVS-CRYPTO-1",9 "area": "transactions",10 "location": "Sources/QyvoraWallet/WalletService+UTXOCoins.swift:912",11 "tool": "manual-review",12 "rule": "",13 "status": "fixed",14 "fix_commit": "08cfe31",15 "regression_test": "QyvoraWalletTests (NewEntryPointsAuditRegressionTests.swift): MainnetPolicyTests.aSweepObeysTheCeilingsAndPaysOnlyTheWalletOnEveryCoin",16 "description": "Root cause: `prepareSweepOfExposed(chain:)` (Litecoin, Dogecoin, Bitcoin Cash; added by the merge of main) builds a send-max plan to a never-used address of the wallet's internal chain and marks it `purpose == .sweepExposed`; the review of a sweep carries none of the destination warnings of a payment and counts its amount as staying in the wallet (`totalSpent` = fee). Before signing, `validateCoinPlan` did not look at the purpose: nothing checked that the outputs of a plan presented as a sweep return to the wallet. Reachability: `BitcoinSendPlan` has no public initializer and no mutable property and the service computes the destination itself, so no public interface can produce such a plan; verified with a plan built inside the test module, which was signed before the fix. The ceilings of an unaudited build applied to it as to a payment (the output of a send-max plan is not change), so the amount was bounded on mainnet. Defence in depth, same class as QYV-SVC-063.",17 "recommendation": "Before signing a plan whose purpose is a sweep, require every output to pay a script of the account's change chain.",18 "evidence": "",19 "fingerprint": "6921a981f334",20 "reported": "2026-12-05",21 "owner": "integrator",22 "fixed": "2026-12-05",23 "verification": "Root-package tests on M5M36 (Swift 6.4, release): QyvoraWalletTests, QyvoraTronTests, QyvoraCryptoTests, QyvoraMigrationTests, QyvoraQuantumShieldTests; audit-package suite NewEntryPointsProperties and the fuzz targets utxo-coin-snapshot and hidden-tokens on M5M36.",24 "resolution_note": "Fixed as recommended in `validateCoinPlan`: a sweep whose output is not a script of this account's change chain is refused as a stale plan, nothing is signed. The regression test builds, for each of the three coins on mainnet, a sweep redirected to a foreign script (refused), a sweep above the value ceiling with a small declared amount (refused at sign), a sweep with a fee above the ceiling (refused), and signs the honest one. It fails on the code before the fix, checked on M5M36.",25 "residual_risk": "Bitcoin's own sweep (`prepareSweepOfExposedBitcoin`, QYVORA 1.0 path) relies on the same construction argument and on the change check of QYV-SVC-066; it was outside this review's scope."26}27
Files main
Menu

Theme