Repository Public
1{2 "id": "QYV-SVC-080",3 "title": "A primary network could be moved to a main network without a fresh authentication (1.0 setters, and setNetworkMode when the stored mode already said \"main\")",4 "severity": "medium",5 "cvss_vector": "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N",6 "cvss_score": 2.4,7 "cwe": "CWE-306",8 "masvs": "MASVS-AUTH-3",9 "area": "wallet",10 "location": "Sources/QyvoraWallet/WalletService.swift:497",11 "tool": "manual-review",12 "rule": "",13 "status": "fixed",14 "fix_commit": "f8ff2b8",15 "regression_test": "QyvoraWalletTests.MainnetPolicyTests (EVMChainsAuditRegressionTests.swift): leavingTheTestNetworksAlwaysNeedsAFreshAuthentication",16 "description": "Root cause: `setNetworkMode(.main)` (multi-chain upgrade) asks for a fresh authentication, but the setters kept for the 1.0 screens — `setBitcoinNetwork`, `setEthereumNetwork`, `setActiveNetworks` — only checked the mainnet gate. They move the primary Bitcoin network and the primary EVM network (any of the seven main networks) to real funds. `setNetworkMode(.main)` itself skipped the authentication when `profile.networkMode` was already `.main`, which is the case after `setBitcoinNetwork(.signet)` in main mode or with a profile file whose mode field says \"main\". Impact: with mainnet enabled (internal build and user switch), whoever holds the unlocked device after the authentication window could put the wallet on main networks without the credential; signing still needs a fresh authentication, so no funds move, but the user is then shown and asked to act on real-fund networks. The gate itself (both conditions) was never bypassed.",17 "recommendation": "Require `requireFreshAuthentication()` in every call that moves a network from test to main, whatever the entry point, and treat any primary network still on a test network as a switch in `setNetworkMode(.main)`.",18 "evidence": "",19 "fingerprint": "641c7269a1f6",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, QyvoraNetworkingTests, QyvoraCoreTests; audit-package suites EVMChains* and Multichain* on M5M36.",24 "resolution_note": "Fixed: `setBitcoinNetwork` and `setEthereumNetwork` require a fresh authentication when the network goes from a test network to a main one (`setActiveNetworks` goes through them); `setNetworkMode(.main)` requires it whenever the stored mode is not main or a primary network is still on a test network. Moving between test networks, between two main networks, or back to test asks nothing. Severity: CVSS 2.4 (low); rated medium by the wallet-impact class \"sensitive action without fresh authentication\". The regression test fails on the code before the fix (14 issues), checked on M5M36.",25 "residual_risk": "A watch-only wallet has no credential: the rule does not apply to it (it cannot sign). The user switch `mainnetOptIn` lives in the profile file, which is not authenticated (QYV-SVC-011, residual): on an internal build, whoever can write the application container can turn it on without the credential."26}27