SPB Git

Repository Public

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

1{2 "id": "QYV-SVC-104",3 "title": "Address indices read from the profile file were used unchecked: 4 294 967 295 in a used-index list trapped or made a PSBT review search billions of keys",4 "severity": "low",5 "cvss_vector": "",6 "cvss_score": null,7 "cwe": "CWE-190",8 "masvs": "MASVS-STORAGE-1",9 "area": "storage",10 "location": "Sources/QyvoraBitcoin/Account.swift:244",11 "tool": "manual-review",12 "rule": "",13 "status": "fixed",14 "fix_commit": "34d4c91",15 "regression_test": "QyvoraWalletTests (NewEntryPointsAuditRegressionTests.swift): NewEntryPointsAuditRegressionTests.hostileAddressIndicesOfAProfileNeitherTrapNorGrowTheSearch",16 "description": "Root cause: `usedReceiveIndices` / `usedChangeIndices` of the profile (a file that is not authenticated: QYV-SVC-011) were decoded without bound. `UTXOAccount.nextUnusedIndex` computed `max + 1`, `nextUnusedAddress` added `skipping`, `scanRange` added the gap limit, and the PSBT review and signing computed a search window `max + 40`: all unchecked UInt32 additions. Found while reviewing the destination of `prepareSweepOfExposed`, which takes its fresh address from that list. Impact: whoever can write into the application container makes the application stop (arithmetic trap) whenever a payment or a sweep is prepared, a receive address is asked for, or a PSBT is reviewed, on every UTXO chain; with a large index below the overflow, a PSBT review derives up to billions of keys (a hang). No key, coin or amount is affected: an index beyond the non-hardened range cannot be derived. Local write access needed; denial of service only.",17 "recommendation": "Bound the indices where the profile is read, and make the index arithmetic of the account saturating or checked.",18 "evidence": "",19 "fingerprint": "b61b582ccc7a",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 in two places: the profile decoder drops used indices above 4 000 (twice what a scan covers), so every search window is bounded; `nextUnusedIndex` saturates, `nextUnusedAddress` and `scanRange` check their additions (an out-of-range index throws `indexOutOfRange`). The regression test covers both. It was not run against the code before the fix: the earlier behaviour is an arithmetic trap, established by reading (`used.max().map { $0 + 1 }`).",25 "residual_risk": "The profile stays unauthenticated (QYV-SVC-011): plausible but wrong indices (up to 4 000) can still make the wallet hand out a later address than needed; such an address is still the account's own and is found again by a scan up to the same bound."26}27
Files main
Menu

Theme