SPB Git

Repository Public

QYV-AUD-007.json 3.0 KB 28 lines json

1{2 "id": "QYV-AUD-007",3 "title": "Tests that read the process-wide mainnet policy failed at random while a test that switches it was running",4 "severity": "info",5 "cvss_vector": "",6 "cvss_score": null,7 "cwe": "CWE-362",8 "masvs": "",9 "area": "tests",10 "location": "Tests/QyvoraWalletTests/TestSupport.swift:548",11 "tool": "engine-tests",12 "rule": "",13 "status": "fixed",14 "fix_commit": "7b1e37e",15 "regression_test": "The whole QyvoraWalletTests target run repeatedly (see verification); MainnetPolicyTests.aMainNetworkIsRefusedByNameWhileMainnetIsOff and bothConditionsAreRequired, moved into the suite.",16 "description": "Root cause: `MainnetPolicy` is one value per process, configured by every wallet service of an internal build, and Swift Testing runs suites in parallel in one process. `MainnetPolicyTests` is serialized, but only with respect to itself: `MultiChainModelTests.chainsAreEnabledAndDisabled` and `BitcoinWalletTests.coldSigningRoundTripWithPSBT` each failed once (an unexpected or a missing `mainnetDisabled`) while a test of that suite had mainnet on; a test of QyvoraCoreTests switched the policy too. Observed about one run in five after this work added mainnet tests. No impact on the product: the application has one service. Impact on the audit: a failed engine test blocks the release gate, so a random failure would block a run for no defect.",17 "recommendation": "Give the tests that change the policy the process to themselves.",18 "evidence": "",19 "fingerprint": "f6b3f7b293fe",20 "reported": "2026-12-05",21 "owner": "integrator",22 "fixed": "2026-12-05",23 "verification": "Package tests of the whole root package on M5M36 (Swift 6.4, release, 895 tests in 23 runs, no failure) at commit f0ddca7; QyvoraWalletTests (212 tests) run five consecutive times on the laptop without failure after the last source change; application target compiled for iphoneos on M3U96a and for the simulator on the laptop; changed screens read on the simulator \"Qyvora iPhone B\" where the review record security/audit/review/multichain-app-screens.json says so; static checks and framework steps of the audit re-run. The final laptop run of the whole package and the quick audit were made after this register was written: their results are in the report of the work, not here.",24 "found_by": "review of App/Sources for the new chains (2026-12-05)",25 "resolution_note": "A scoping trait (`MainnetPolicyScope`, an asynchronous readers–writer lock with writer preference) is applied to every suite of QyvoraWalletTests: `.changesMainnetPolicy` on MainnetPolicyTests (one test at a time, nothing else of the target meanwhile), `.readsMainnetPolicy` on the 23 others. The assertion of MultiChainModelTests that depended on the policy and the policy test of QyvoraCoreTests moved into MainnetPolicyTests.",26 "residual_risk": "The lock covers the wallet test target. A suite of another target that came to depend on the policy would need the same trait. The audit package (security/tests) is a separate process."27}28
Files main
Menu

Theme