SPB Git

Repository Public

QYV-SVC-087.json 7.7 KB 30 lines json

1{2  "id": "QYV-SVC-087",3  "title": "The 150 USD ceiling of a token transfer (ERC-20, SPL, TRC-20) is converted with the price of one source, without floor or cross-check",4  "severity": "high",5  "cvss_vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N",6  "cvss_score": 5.3,7  "cwe": "CWE-345",8  "masvs": "MASVS-NETWORK-1",9  "area": "wallet",10  "location": "Sources/QyvoraWallet/WalletService+Market.swift:152",11  "tool": "manual-review",12  "rule": "",13  "status": "fixed",14  "fix_commit": "4f469e9",15  "regression_test": "QyvoraWalletTests (PriceCeilingAuditRegressionTests.swift): PriceCeilingPolicyTests (3 tests) and MainnetPolicyTests.aLyingPriceDoesNotLiftTheCeilingOfADollarPeggedToken, aTokenThatIsNotPeggedNeedsTwoAgreeingSources, aTokenWithoutSecondSourceOrFromTheProfileIsRefused, nativeCoinCeilingsNeedTwoAgreeingSources, solanaAndTronCeilingsFollowTheSameRules; QyvoraNetworkingTests.PriceCheckParsingTests (3 tests) and the opt-in PriceCheckLiveTests; fuzz target json-indexer (selector 5); static check QYV-STA-025.",16  "description": "Root cause: the same as QYV-SVC-082, for tokens. `tokenUSDPerTransaction` (150 USD) is checked as `units × price ≤ 150` with `freshUSDPrice(token.priceID)`: one price source, no second source, and — unlike the native coins since QYV-SVC-082 — no plausibility floor (`MainnetPolicy.minimumPlausibleUSDPrice` has no entry for token identifiers). The rule exists since QYVORA 1.0 for ERC-20 on Ethereum and now also bounds the built-in tokens of six more EVM networks, SPL tokens and TRC-20 tokens. Impact: a price source answering a price close to zero for a listed token (for example 0.000001 USD for USDC) removes the ceiling of that token on an unaudited mainnet build, at prepare and at sign. The user still chooses and reviews amount and recipient; what is lost is the bound on a mistake or on a defect of the unaudited engine. Tokens without a price identifier are refused, which is unchanged.",17  "recommendation": "Either (a) a floor per price identifier of the built-in lists (stablecoins at 0.5 USD, wrapped bitcoin and ether at a fraction of the coin's floor, the others individually), refusing any token whose identifier has no floor; or (b) a second independent price source that must agree within a tolerance; or (c) for the stablecoins, a ceiling in token units next to the dollar ceiling. The figures are the owner's policy: the audit did not choose them.",18  "evidence": "Sources/QyvoraCore/Networks.swift:969; Sources/QyvoraCore/Networks.swift:989; Sources/QyvoraWallet/WalletService+Market.swift:152; Sources/QyvoraNetworking/Indexers.swift:320; Sources/QyvoraEthereum/ERC20.swift:327; App/Sources/EndpointsEditorView.swift:89",19  "fingerprint": "dadd7e0c9097",20  "reported": "2026-12-05",21  "owner": "integrator",22  "updated": "2026-12-05",23  "resolution_note": "Fixed with the conservative combination, which only tightens what an unaudited build sends on mainnet. A dollar ceiling is `units × price ≤ dollars`, so a price that is too LOW allows MORE units: every rule errs towards the higher price or refuses. (a) Built-in dollar-pegged tokens — an explicit `pegUSD` flag on the built-in tables of the seven EVM networks (30 rows: USDC, USDT, DAI, PYUSD, USDS and the bridged USDC.e, USDT0, Binance-Peg and Standard-Bridge forms), of Solana (USDC, USDT) and of TRON (USDT, USDC) — are valued at max(quote, 0.90) with one fresh quote, and refused when the quote is outside 0.50…2.00 USD (`MainnetPolicy.stablecoinCeilingPrice`): one transfer never exceeds 150 / 0.90 = 166.66 units whatever the source says. EURC is pegged to the euro: its flag is false and it follows rule (b). (b) Every other token needs a fresh price from two independent sources that differ by at most 5 % of the higher; the HIGHER of the two is used (`MainnetPolicy.agreedCeilingPrice`), because the lower one would let the source that errs low decide. The second source is Kraken's public ticker (keyless, configurable: `EndpointConfiguration.priceCheckAPI`, entry \"Second price source\" of the endpoint editor; it must be another host than the price API); `PriceClient.checkPairs` maps 42 price identifiers to pairs that all answered on 2026-12-05; its answer is read with bounds (16 kB, one entry, decimal texts, bid ≤ ask, last trade within 10 % of the middle). A token the second source does not list (MKR, cbBTC, the wstETH representations, UNI on Base which has no identifier) is refused with `unauditedLimitUnverifiable`. (c) The native coins with a dollar ceiling (POL, BNB, AVAX, SOL, TRX, LTC, DOGE, BCH) follow the same two-source rule in addition to their floors, which were revised upwards from Kraken weekly candles read on 2026-12-05 (table and provenance in the comment of `MainnetPolicy.minimumPlausibleUSDPrice`). (d) `limitUSDPrice` is the one converter, called when a payment is prepared and again before it is signed (hot, cold, broadcast of a cold-signed transaction); a stale quote is never used; when the two quotes disagree they are read again once before the refusal. Also closed here: the price identifier used for a ceiling now comes from the built-in tables only — a token entry of a modified profile file that names the identifier of USDC or LINK for another contract has no price. The tests could not be run against the code before the fix (they use the new interface); the behaviours they pin did not exist there (one source, no floor for tokens).",24  "residual_risk": "Both sources lying low together, within 5 % of each other, still lift the ceiling of a token that is not pegged (the test records it); for the native coins the floors bound that case, for dollar-pegged tokens the 0.90 floor does. A wrapped or bridged asset is checked against the second source's pair of its underlying (wrapped ether → ETHUSD, BTCB and BTC.b → XBTUSD, wrapped native coins): a representation that lost its parity is refused, not valued, but one that is quoted at parity by the first source while being worthless would pass — the ceiling then bounds a number of units of a worthless token. A pegged token is valued from one source: a real loss of the peg under 0.90 leaves the ceiling at 166.66 units, worth less than 150 USD. Kraken's ticker carries no timestamp: an old last trade is caught only by the 10 % rule against the order book. The second source learns which asset is about to be paid (not the address nor the amount). The floors are policy figures from one exchange's candles (POL and BNB from a short listing history): a coin under half of its five-year low cannot be sent until the owner revises the floor. A user can empty the second source (then nothing that needs it can be sent) but cannot point both sources at one host.",25  "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.",26  "fixed": "2026-12-05",27  "previous_open_note": "Not fixed: a floor per token is a policy table the owner has to set (about sixty price identifiers across the built-in lists of the EVM networks, Solana and TRON), and a second price source is a product decision. The native coins were fixed (QYV-SVC-082).",28  "previous_proposed_disposition": "Owner decision between the three options of the recommendation. Until then: a high finding, open — the release gate blocks on it."29}30
Files main
Menu

Theme