Bounty
XE-1848 · Bounty

`quote()` rejects entirely when one provider's certificate is malformed — one bad provider poisons lease discovery for all providers

Triaging claimed Minor web filed 2026-11-09 07:55 UTC by Darkarmy921

Report

Title

quote() rejects entirely when one provider's certificate is malformed — one bad provider poisons lease discovery for all providers

Summary

Xe.quote() fetches every fitting provider's certificate in Promise.all and only catches fetch failures. A certificate that arrives but is malformed — e.g. price_multiplier_milli: 0 — makes pricePerMinute / leaseCost throw XeUsageError outside the try, and Promise.all rejects the whole quote. One bad provider (misconfigured, or serving a forged/malformed cert through a compromised node) makes quote() — and therefore openLease() without an explicit provider, which goes through #cheapest → quote() — fail for every provider, including healthy ones.

Impact

  • Denial of lease discovery. A single provider advertising a zero-multiplier (or otherwise unpriceable) certificate blocks all quoting. The caller cannot open a lease without naming a provider explicitly, and cannot even learn the healthy providers' prices.
  • Scope limit (stated plainly). No funds move and no bad block is signed: quote() throws before anything is priced or signed. The harm is liveness of the lease path, and it needs a malformed cert to be served — from a misconfigured provider or a malicious/compromised node (the same threat model as SDK-2/XE-1730, where the SDK already accepts node-supplied certificates without verification).

Severity reasoning

  • Low, not Medium: nothing is signed or spent; the failure is a throw, fail-closed, and the caller can work around it by naming a provider explicitly. But it is a real availability defect in the primary lease-discovery path, triggered by one bad input among many.
  • Low, not Minor: quote()'s own code anticipates bad providers — a certificate fetch failure is caught and the provider skipped — but the equivalent pricing failure is not, so the handling is inconsistent within one function.

Root cause

src/xe.ts quote(): the try wraps only await this.client.certificate(p.account); the pricePerMinute(dims, certificate.priceMultiplierMilli) call that follows is outside it, and leaseCost throws XeUsageError('leaseCost: multiplier must be non-zero') for a zero multiplier. Promise.all propagates the first rejection, discarding the healthy providers' quotes.

Reproduction

Harness /tmp/sdk-r5/verify.mjs (section A), mock fetch only, no live traffic. Run from the built SDK:

cd ~/workspace/xe-bounty/sdk
node /tmp/sdk-r5/verify.mjs

Observed output:

PASS A-quote-poisoned-by-bad-cert threw=XeUsageError: leaseCost: multiplier must be non-zero
PASS A-control-404-cert-skipped quotes=1

What the run shows:

  1. Two fitting providers; the second serves a certificate with price_multiplier_milli: 0 → quote() throws instead of returning the first provider's quote.
  2. Control: the same second provider returning 404 for its certificate is skipped cleanly and the healthy quote is returned — so the skip-on-failure intent is already there for fetch errors, just not for pricing errors.

Dedup note

Checked against the public ticket list (186 public tickets, max XE-1799, snapshot 2026-11-09 ~14:19 WIB; title sweep). No title match for quote, certificate pricing, or provider poisoning. Closest reports:

  • XE-1730 (SDK-2) — node-supplied certificates are never verified. Different defect (trust, not error handling): SDK-2 is about a forged but well-formed cert being priced; this is about a malformed cert crashing the whole quote. A fix for SDK-2 (verify certs) would not fix this — a verified-but-zero-multiplier cert, or any other pricing throw, still rejects the Promise.all.
  • XE-0104 — LeaseAcceptPolicy only consulted for lease_open. Provider-policy, unrelated to SDK quoting.

No known report covers this defect. Private/sealed tickets are invisible, so a sealed duplicate cannot be ruled out.

Suggested fix direction

  • Move the pricePerMinute call inside the per-provider try (or catch pricing errors alongside fetch errors) and skip providers whose certificate cannot be priced, exactly as un-fetchable certificates are skipped today.

Payout address

052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da

References (file:line; sdk @ 605c20a)

Location What it shows
src/xe.ts (quote, ~fits.map) try wraps only client.certificate(); pricePerMinute outside it; Promise.all propagates
src/lease.ts (leaseCost) Throws on multiplierMilli <= 0n
/tmp/sdk-r5/verify.mjs (section A) Verification harness (mock fetch; ephemeral, see "Reproduction")

Thread

Joseph Denneteam2026-11-10 14:00 UTCdesk

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