Repository Public
1{2 "id": "QYV-SVC-006",3 "title": "Amount formatting and the Shield report trap on out-of-range values of the stored profile (decimals, durations)",4 "severity": "low",5 "cvss_vector": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:L",6 "cvss_score": 1.9,7 "cwe": "CWE-20",8 "masvs": "MASVS-CODE-4",9 "area": "wallet",10 "location": "Sources/QyvoraCore/UInt256.swift:224",11 "tool": "manual-review",12 "rule": "",13 "status": "fixed",14 "fix_commit": "7e854f2",15 "regression_test": "QyvoraCoreTests.CoreAuditRegressionTests/baseUnitsToleratesHostileDecimals; QyvoraQuantumShieldTests.ShieldAuditRegressionTests/extremeDurationsInTheProfileDoNotTrapTheReport",16 "description": "Root cause: `BaseUnits.parse` / `format` passed `decimals` to `String(repeating:count:)` and `dropLast` without a range check (a negative value traps, a huge one allocates as many characters; a negative `maxFractionDigits` trapped in `prefix`), and `QuantumShield.vaultSecurity` converted the auto-lock delay and the backup age with `Int(Double)` (Sources/QyvoraQuantumShield/ShieldReport.swift:511). Values read from the network are bounded before they reach these functions (token decimals <= 36); the unchecked path is the plaintext profile `wallet-profile.json` (`customTokens[].decimals`, `autoLock.after.seconds`, `lastBackupDate`) and `setAutoLockPolicy`, which has no upper bound. Impact: a corrupted or tampered profile made the application trap at every launch or report.",17 "recommendation": "Fixed: `decimals` outside 0...255 is refused by `parse` and clamped by `format`; the durations are bounded before the conversion. See QYV-SVC-011 for the authentication of the profile itself.",18 "evidence": "",19 "fingerprint": "2810ccf0df4c",20 "reported": "2026-12-04",21 "owner": "review-b"22}23