{"id":"XE-1848","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":451,"title":"`quote()` rejects entirely when one provider's certificate is malformed — one bad provider poisons lease discovery for all providers","area":"sdk-docs-web","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-09T07:55:46.166674+00:00","updated_at":"2026-11-14T22:57:04.296924+00:00","source_created_at":null,"told_at":"2026-11-10T14:00:35.102149+00:00","status_changed_at":"2026-11-10T14:00:33.397807+00:00","url":"https://bounty.xe.network/XE-1848","body":"## Title\r\n\r\n`quote()` rejects entirely when one provider's certificate is malformed — one bad provider poisons lease discovery for all providers\r\n\r\n## Summary\r\n\r\n`Xe.quote()` fetches every fitting provider's certificate in `Promise.all`\r\nand only catches *fetch* failures. A certificate that arrives but is\r\nmalformed — e.g. `price_multiplier_milli: 0` — makes `pricePerMinute` /\r\n`leaseCost` throw `XeUsageError` **outside** the try, and `Promise.all`\r\nrejects the whole quote. One bad provider (misconfigured, or serving a\r\nforged/malformed cert through a compromised node) makes `quote()` — and\r\ntherefore `openLease()` without an explicit provider, which goes through\r\n`#cheapest` → `quote()` — fail for every provider, including healthy ones.\r\n\r\n## Impact\r\n\r\n- **Denial of lease discovery.** A single provider advertising a\r\nzero-multiplier (or otherwise unpriceable) certificate blocks all\r\nquoting. The caller cannot open a lease without naming a provider\r\nexplicitly, and cannot even learn the healthy providers' prices.\r\n- **Scope limit (stated plainly).** No funds move and no bad block is\r\nsigned: `quote()` throws before anything is priced or signed. The\r\nharm is liveness of the lease path, and it needs a malformed cert to\r\nbe served — from a misconfigured provider or a malicious/compromised\r\nnode (the same threat model as SDK-2/XE-1730, where the SDK already\r\naccepts node-supplied certificates without verification).\r\n\r\n## Severity reasoning\r\n\r\n- **Low, not Medium:** nothing is signed or spent; the failure is a\r\nthrow, fail-closed, and the caller can work around it by naming a\r\nprovider explicitly. But it is a real availability defect in the\r\nprimary lease-discovery path, triggered by one bad input among many.\r\n- **Low, not Minor:** `quote()`'s own code anticipates bad providers —\r\na certificate *fetch* failure is caught and the provider skipped —\r\nbut the equivalent pricing failure is not, so the handling is\r\ninconsistent within one function.\r\n\r\n## Root cause\r\n\r\n`src/xe.ts` `quote()`: the `try` wraps only\r\n`await this.client.certificate(p.account)`; the `pricePerMinute(dims,\r\ncertificate.priceMultiplierMilli)` call that follows is outside it, and\r\n`leaseCost` throws `XeUsageError('leaseCost: multiplier must be\r\nnon-zero')` for a zero multiplier. `Promise.all` propagates the first\r\nrejection, discarding the healthy providers' quotes.\r\n\r\n## Reproduction\r\n\r\nHarness `/tmp/sdk-r5/verify.mjs` (section A), mock fetch only, no live\r\ntraffic. Run from the built SDK:\r\n\r\n```sh\r\ncd ~/workspace/xe-bounty/sdk\r\nnode /tmp/sdk-r5/verify.mjs\r\n```\r\n\r\nObserved output:\r\n\r\n```\r\nPASS A-quote-poisoned-by-bad-cert threw=XeUsageError: leaseCost: multiplier must be non-zero\r\nPASS A-control-404-cert-skipped quotes=1\r\n```\r\n\r\nWhat the run shows:\r\n\r\n1. Two fitting providers; the second serves a certificate with\r\n`price_multiplier_milli: 0` → `quote()` throws instead of returning\r\nthe first provider's quote.\r\n2. Control: the same second provider returning 404 for its certificate\r\nis skipped cleanly and the healthy quote is returned — so the\r\nskip-on-failure intent is already there for fetch errors, just not\r\nfor pricing errors.\r\n\r\n## Dedup note\r\n\r\nChecked against the public ticket list (186 public tickets, max\r\nXE-1799, snapshot 2026-11-09 ~14:19 WIB; title sweep). No title match\r\nfor `quote`, certificate pricing, or provider poisoning. Closest\r\nreports:\r\n\r\n- **XE-1730 (SDK-2)** — node-supplied certificates are never verified.\r\nDifferent defect (trust, not error handling): SDK-2 is about a\r\n*forged but well-formed* cert being priced; this is about a\r\n*malformed* cert crashing the whole quote. A fix for SDK-2 (verify\r\ncerts) would not fix this — a verified-but-zero-multiplier cert, or\r\nany other pricing throw, still rejects the `Promise.all`.\r\n- **XE-0104** — `LeaseAcceptPolicy` only consulted for `lease_open`.\r\nProvider-policy, unrelated to SDK quoting.\r\n\r\nNo known report covers this defect. Private/sealed tickets are\r\ninvisible, so a sealed duplicate cannot be ruled out.\r\n\r\n## Suggested fix direction\r\n\r\n- Move the `pricePerMinute` call inside the per-provider try (or catch\r\npricing errors alongside fetch errors) and skip providers whose\r\ncertificate cannot be priced, exactly as un-fetchable certificates\r\nare skipped today.\r\n\r\n## Payout address\r\n\r\n```\r\n052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da\r\n```\r\n\r\n## References (file:line; sdk @ 605c20a)\r\n\r\n| Location | What it shows |\r\n|---|---|\r\n| `src/xe.ts` (`quote`, ~`fits.map`) | `try` wraps only `client.certificate()`; `pricePerMinute` outside it; `Promise.all` propagates |\r\n| `src/lease.ts` (`leaseCost`) | Throws on `multiplierMilli <= 0n` |\r\n| `/tmp/sdk-r5/verify.mjs` (section A) | Verification harness (mock fetch; ephemeral, see \"Reproduction\") |","patch_refs":[],"thread":[{"id":2134,"source":"desk","source_ref":"reply:1501","author":"Joseph Denne","team":true,"body":"Thank you for this report. We have read it against the code and it is being handled. The assessment and any award follow the fix. https://bounty.xe.network/XE-1848","created_at":"2026-11-10T14:00:19.792775+00:00"}]}