SPB Git

Repository Public

QYV-APP-003.json 3.6 KB 32 lines json

1{2  "id": "QYV-APP-003",3  "title": "Auto-lock is not wired in the application",4  "severity": "medium",5  "cvss_vector": "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",6  "cvss_score": 6.1,7  "cwe": "CWE-613",8  "masvs": "MASVS-AUTH-2",9  "area": "app",10  "location": "App/Sources/WalletStore.swift:120",11  "tool": "manual-review",12  "rule": "",13  "status": "fixed",14  "fix_commit": "371006e",15  "regression_test": "QyvoraWalletTests.AutoLockTests (theRuleNeverTouchesALockedVaultAndNeverLocksOnInactivity, everyOtherEventLocksOrAppliesThePolicy, theLifeCycleLocksTheVaultImmediatelyAfterTheDelayAndInTheBackground); wallet-audit check `auto-lock-wired`",16  "description": "Root cause: `WalletStore.autoLockIfNeeded()` and `WalletService.autoLockIfNeeded()` exist, but nothing calls them: no timer, and `RootView` reacts to the scene phase only to show the privacy cover. Impact: once unlocked, the vault stays unlocked until the process ends, whatever the policy says; the master key remains in memory while the application is in the background. (The application is still being built at the audited commit; this finding is the reminder for the final run and is covered by an automated check.)",17  "recommendation": "Call `wallet.autoLockIfNeeded()` when the scene leaves `.active` and when it returns, and on a repeating timer while active; route to the lock screen when it returns true. Verified automatically by the check `auto-lock-wired` (coinspect-wsf / wallet-audit).",18  "evidence": "func autoLockIfNeeded() async -> Bool",19  "fingerprint": "19f8627adcc7",20  "frameworks": [21    "WSC-3.4",22    "WSB-PHYS-006~Mobile",23    "MASVS-AUTH-2"24  ],25  "reported": "2026-12-04",26  "owner": "integrator",27  "fixed": "2026-12-04",28  "resolution_note": "Fixed: Re-assessed on the current application: `RootView` already applied the policy on a 15 s timer and at the scene-phase changes (the audit read an older commit). The decisions were moved from the view to `AutoLockRule` (Sources/QyvoraWallet/AutoLockRule.swift) so that they are tested with the package: leaving for the background locks at once under 'immediately' and applies the policy otherwise; coming back applies the policy (the time spent away counts) and the privacy cover now stays on until that check has finished; the timer runs while the vault is unlocked and the scene active; becoming merely inactive does nothing (the Face ID sheet). The life cycle is played against the real service in the tests. Verification: package tests on M4M64c (Swift 6.3.3, release) and on the laptop (Swift 6.4, release); application target compiled for iphoneos on M3U96a. Not exercised on a device or in the simulator by interaction. Residual risk: iOS suspends the application in the background: under a delay the vault is locked when the application comes back, not at the moment the delay expires, and the master key stays in the memory of the suspended process until then. 'Activity' is a call to the wallet service (every action of the user that reads or changes the wallet), not a touch: reading one screen for longer than the delay locks.",29  "verification": "package tests on M4M64c (Swift 6.3.3, release) and on the laptop (Swift 6.4, release); application target compiled for iphoneos on M3U96a. Not exercised on a device or in the simulator by interaction.",30  "residual_risk": "iOS suspends the application in the background: under a delay the vault is locked when the application comes back, not at the moment the delay expires, and the master key stays in the memory of the suspended process until then. 'Activity' is a call to the wallet service (every action of the user that reads or changes the wallet), not a touch: reading one screen for longer than the delay locks."31}32
Files main
Menu

Theme