SPB Git

Repository Public

QYV-SVC-009.json 4.0 KB 27 lines json

1{2  "id": "QYV-SVC-009",3  "title": "The per-transaction ceilings of an unaudited mainnet build do not bound the fee, and fee data comes from the first endpoint that answers",4  "severity": "medium",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-20",8  "masvs": "MASVS-NETWORK-1",9  "area": "wallet",10  "location": "Sources/QyvoraNetworking/EthereumRPC.swift:179",11  "tool": "manual-review",12  "rule": "",13  "status": "fixed",14  "fix_commit": "120ca41",15  "regression_test": "QyvoraWalletTests.MainnetPolicyTests (feeCeilingConstantsAreTheDocumentedOnes, bitcoinFeeCeilingsAreEnforcedAtPrepareAndAtSign, ethereumFeeCeilingIsEnforcedAtPrepareAndAtSign)",16  "description": "Root cause: `MainnetPolicy.limits` bounds the value sent (0.002 BTC, 0.05 ETH, 150 USD of tokens); fees are bounded only by the general ceilings. Bitcoin: `bitcoinMaximumFee` = 1 000 000 sat (0.01 BTC, five times the value ceiling) and `bitcoinMaximumFeeRate` = 1 000 sat/vB. Ethereum: `feeData` accepts a base fee and a priority fee below 10 000 gwei each from `call` (first endpoint that answers, no quorum), so `maxFeePerGas` can reach about 30 000 gwei: 0.63 ETH for a 21 000-gas transfer and 6 ETH at the 200 000 gas ceiling, of which the priority fee (up to 0.21 ETH / 2 ETH) is actually paid to the block proposer. Impact: on an unaudited build a single hostile or faulty RPC endpoint (or a defect in the fee arithmetic) can make one reviewed transaction cost 12 to 120 times the ceiling that is meant to bound a mistake. The review screen shows the maximum fee and a warning above 5 % of the value, so the user can notice; nothing refuses it. Limits were not changed by this audit (owner decision).",17  "recommendation": "While `MainnetPolicy.unauditedMainnet` is true, add fee ceilings next to the value ceilings and enforce them at prepare and at sign (for example fee <= the value ceiling of the chain: 200 000 sat, 0.05 ETH). Independently: take `baseFeePerGas` and `eth_maxPriorityFeePerGas` from every endpoint and refuse a disagreement beyond a tolerance (as `quorum` does for the nonce), and cap the priority fee relative to the base fee.",18  "evidence": "",19  "fingerprint": "765c6bb57d7e",20  "reported": "2026-12-04",21  "owner": "integrator",22  "fixed": "2026-12-04",23  "resolution_note": "Fixed: `MainnetPolicy.limits` gained three fee ceilings next to the value ceilings (Sources/QyvoraCore/Networks.swift): Bitcoin fee <= 20 000 sat per transaction and <= 200 sat/vB, Ethereum maximum fee (gas limit x maxFeePerGas) <= 0.01 ETH. The service enforces them while `MainnetPolicy.unauditedMainnet` is true: at prepare (`buildBitcoinPlan`, `buildEthereumReview`), at sign (`validate`, `signPSBT`, `signEthereum` for the hot and the cold path) and at broadcast of a PSBT (`finalizeAndBroadcastPSBT`); the Bitcoin fee tiers offered are capped at the same rate. The settings, the mainnet warning, the permanent notice and the custom fee field show the ceilings. 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. Residual risk: The second half of the finding is not changed: fee figures still come from the first endpoint that answers (no comparison between endpoints, tracked by QYV-SVC-014). What a hostile endpoint can make one mainnet transaction cost is now bounded by the ceilings instead of 0.63 to 6 ETH. On test networks only the general ceilings apply (1 000 000 sat, 1 000 sat/vB, 10 000 gwei), as before.",24  "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.",25  "residual_risk": "The second half of the finding is not changed: fee figures still come from the first endpoint that answers (no comparison between endpoints, tracked by QYV-SVC-014). What a hostile endpoint can make one mainnet transaction cost is now bounded by the ceilings instead of 0.63 to 6 ETH. On test networks only the general ceilings apply (1 000 000 sat, 1 000 sat/vB, 10 000 gwei), as before."26}27
Files main
Menu

Theme