<!-- XE-1848 · `quote()` rejects entirely when one provider's certificate is malformed — one bad provider poisons lease discovery for all providers · testnet -->
*Markdown view of <https://bounty.xe.network/XE-1848>. The page is the record; this is the same page for reading.*

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

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-14 22:57 UTC

Told
:   2026-11-10 14:00 UTC

### Patches

None linked.

### History

- [211827](https://bounty.xe.network/log/211827) 2026-11-14 22:57 UTC proposal.adopted
- [211826](https://bounty.xe.network/log/211826) 2026-11-14 22:57 UTC ticket.award
- [84116](https://bounty.xe.network/log/84116) 2026-11-10 14:00 UTC proposal.adopted
- [84115](https://bounty.xe.network/log/84115) 2026-11-10 14:00 UTC reply.sent
- [83978](https://bounty.xe.network/log/83978) 2026-11-10 14:00 UTC proposal.adopted
- [83977](https://bounty.xe.network/log/83977) 2026-11-10 14:00 UTC ticket.status new → triaging
- [83674](https://bounty.xe.network/log/83674) 2026-11-10 14:00 UTC proposal.adopted
- [83673](https://bounty.xe.network/log/83673) 2026-11-10 14:00 UTC proposal.adopted
- [83672](https://bounty.xe.network/log/83672) 2026-11-10 14:00 UTC ticket.facts
- [83671](https://bounty.xe.network/log/83671) 2026-11-10 14:00 UTC proposal.adopted
- [83670](https://bounty.xe.network/log/83670) 2026-11-10 14:00 UTC ticket.facts
- [83669](https://bounty.xe.network/log/83669) 2026-11-10 14:00 UTC proposal.adopted

[Full history](https://bounty.xe.network/log?ref=XE-1848) · [JSON](https://bounty.xe.network/v1/tickets/XE-1848) · [markdown](https://bounty.xe.network/XE-1848.md)

### 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 Denne**team2026-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
