<!-- XE-17125 · [Medium] TS SDK quote()/openLease auto-pick trusts unsigned /providers + /certificate JSON from the node: a malicious node steers the lease (and its escrow) to an attacker provider with no confirmatio · testnet -->
*Markdown view of <https://bounty.xe.network/XE-17125>. The page is the record; this is the same page for reading.*

XE-17125 · Bounty

# \[Medium\] TS SDK quote()/openLease auto-pick trusts unsigned /providers \+ /certificate JSON from the node: a malicious node steers the lease (and its escrow) to an attacker provider with no confirmatio

Closed · duplicate
—claimed Medium
web
filed 2026-11-17 09:38 UTC
by Irwan0000

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Medium

Area
:   SDK / docs / web

Duplicate of
:   [XE-1730](https://bounty.xe.network/XE-1730) triaging

Tracked
:   —

Updated
:   2026-11-23 01:01 UTC

Told
:   2026-11-23 01:01 UTC

### Patches

None linked.

### History

- [784486](https://bounty.xe.network/log/784486) 2026-11-23 01:01 UTC proposal.adopted
- [784485](https://bounty.xe.network/log/784485) 2026-11-23 01:01 UTC reply.sent
- [784484](https://bounty.xe.network/log/784484) 2026-11-23 01:01 UTC ticket.status new → closed
- [783516](https://bounty.xe.network/log/783516) 2026-11-23 01:00 UTC proposal.adopted
- [783515](https://bounty.xe.network/log/783515) 2026-11-23 01:00 UTC proposal.adopted
- [783514](https://bounty.xe.network/log/783514) 2026-11-23 01:00 UTC ticket.facts
- [783513](https://bounty.xe.network/log/783513) 2026-11-23 01:00 UTC proposal.adopted
- [783512](https://bounty.xe.network/log/783512) 2026-11-23 01:00 UTC ticket.facts
- [782304](https://bounty.xe.network/log/782304) 2026-11-23 00:59 UTC note.added
- [782303](https://bounty.xe.network/log/782303) 2026-11-23 00:59 UTC proposal.created
- [782302](https://bounty.xe.network/log/782302) 2026-11-23 00:59 UTC proposal.created
- [782301](https://bounty.xe.network/log/782301) 2026-11-23 00:59 UTC proposal.created

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

### Report

# \[Medium\] TS SDK `quote()` / `openLease` auto-pick trusts unsigned `/providers` \+ `/certificate` JSON from the node: a malicious node steers the lease (and its escrow) to an attacker provider with no confirmation

- **Suggested tier:** Medium (same impact class as XE-10822, the CLI instance of this defect, claimed Medium: full lease escrow loss to an attacker provider, no VM, no exit)
- **Area:** SDK/docs/web — `sdk/src/xe.ts`, `sdk/src/client.ts`, `sdk/src/jobs/index.ts`
- **Head / commit under test:** sdk `594347b6833a82d8dec026eb92d2362e7578a0d8` and xe `8cc209d65c16089158da8fabd392628b71fe0711` (testnet-0006 build, public repo HEADs)
- **Found:** 2026-11-17, read-only local source review. No live testing, no account use.
- **Payout address (XE):** `db4043dea0d12c476c2644a3df09c4ce51fa1ce04617723405916ade3fa3305f`

## Summary

The TypeScript SDK decides *which provider receives a lease escrow* from unsigned JSON served by the single configured node, with no verification and no confirmation. `Xe.quote()` builds its provider list from `GET /providers` and prices each entry from `GET /certificate/<provider>`; `openLease()` (and `runJob()`) auto-pick the cheapest quote when the caller supplies no provider. A malicious or compromised node endpoint answers `/providers` with only its own (attacker) account, and the SDK signs a lease block to the attacker. The ledger cannot save it: `validateAndAddLease` only checks the certificate exists, belongs to the destination, and the price matches that certificate's multiplier — an attacker provider's self-issued certificate passes all three. This is the TypeScript SDK instance of XE-10822, which covers only the CLI (`cmd/xe/main.go` `pickProvider`); the SDK path is a separate codebase and call path, and the fix for the CLI does not touch it.

## Vulnerable code at HEAD

- `sdk/src/xe.ts:349-378` (`quote()`): filters `await this.client.providers()`, fetches `await this.client.certificate(p.account)` per provider, sorts cheapest-first. No provider-identity check anywhere: no signature on the provider entry, no certificate verification, no allowlist.
- `sdk/src/xe.ts:386-387` (`#cheapest`): takes `quotes[0]` with no further check.
- `sdk/src/xe.ts:269` (`openLease`): `const provider = options.provider ?? (await this.#cheapest(dims, options.maxPricePerMinute))` — the auto-pick is the default whenever the caller does not name a provider.
- `sdk/src/jobs/index.ts:148-153` (`runJob`): same auto-pick when no provider is given (`const [best] = await xe.quote(dims)`), so unattended jobs are steered the same way.
- `sdk/src/client.ts:298-302` (`providers()`): returns the node's `/providers` JSON via `toProvider` with no signature field and no verification.
- `sdk/src/client.ts:314-316` (`certificate()`): returns the node's `/certificate/<provider>` JSON via `toCertificate` with no verification.
- The SDK's own tutorial removes the user's last defence: `sdk/examples/javascript/01-first-wallet.md:86` and `typescript/01-first-wallet.md:88` — "You do not run a node. Point the SDK at any public one:".

## Worst case

Same precondition as XE-10822: the victim points the SDK at an attacker's node (or a TLS MITM / compromised team node). The attacker runs a provider node with its own genuine certificate (self-issued via `node/perf.go: generatePerformanceCertificate`, as XE-10822's body confirms) and answers `/providers` with only its own account. The SDK signs a lease to the attacker; the block passes the ledger because the certificate is genuine and the price is correct. The attacker then uses the XE-0012 mechanism (accepted, Critical — settle only checks elapsed time): accept, provide no VM, settle within the 1-hour grace — the victim's escrow is burned, the attacker's stake returns, XE emission is minted for the attacker. The victim loses the entire lease cost, gets no VM, and has no exit (cancel only works while `LeaseCreated`; force-settle only opens after expiry \+ grace \+ gap, after the attacker settles first). If the attacker does provide a VM, the victim's workload runs on the attacker's machine (root access by design). The price cannot be inflated through this path (the ledger recomputes cost), so this is not an overcharge variant.

## Reproduction (local harness, described; code-trace verified)

1. Run a stub node on localhost answering `/providers` with a single entry (the attacker's account, with capacity) and `/certificate/<attacker>` with the attacker's self-issued certificate.
2. `const xe = new Xe(wallet, { url: 'http://127.0.0.1:<stub>' })`, then `await xe.openLease({ vcpus: 1, memoryMb: 512, diskGb: 5, durationSecs: 3600 })` with no `provider` option.
3. The SDK signs a lease block whose `destination` is the attacker's account and whose `certificate_hash` is the attacker's certificate — no prompt, no confirmation, no warning that the provider list came from an unverified source.

Verification limits, stated honestly: this finding is verified by direct code trace at the pinned HEADs (every function above read in full); no live-network test was run and no PoC was executed against a live node. The ledger-side behaviour (certificate checks only, no provider validation) is the same code XE-10822 already proved with an executed local PoC on the CLI path.

## Bounds, stated honestly

- This is a malicious-node precondition (same as XE-10822 and XE-10713): the victim must be pointed at an attacker-controlled endpoint. It is not a remote attack against users of an honest node.
- The certificate half is *not* this finding: a forged certificate (wrong price/multiplier) is XE-1730. Here the certificate is genuine-but-self-issued, so a `verifyCertificate` fix would not stop this — the defect is the trusted provider *list*, and the fix is different (verify the provider set, or confirm the provider choice before signing).

## De-duplication

- **XE-10822 is the CLI instance only** (`cmd/xe/main.go` `pickProvider`); its body scopes itself to the CLI and its fix does not touch the SDK. This report is the TS SDK instance (`src/xe.ts` `quote`/`#cheapest`/`openLease` \+ `src/jobs/index.ts` `runJob`).
- Precedent for filing per-client instances separately: XE-11100's body confirms the CLI, TS SDK and web-wallet instances of the `receive()` defect were filed as separate tickets (XE-11100, XE-1733, XE-10332).
- Quote-family tickets are different mechanisms: XE-13480 / XE-13484 (price TOCTOU between quote and open), XE-16719 (certificate fan-out DoS), XE-1848 / XE-7934 (error handling), XE-7981 (stale advertisement), XE-9710 (`leaseCost` bounds). None covers provider-list steering.
- XE-13372 (marketplace `pendingOffers` flood steering) covers the node-side marketplace `RequestLease` path, which the SDK never calls.
- XE-0012 covers the settle-without-service half — this is how the attacker *becomes* the victim's provider.

## Suggested fix

Serve the signed provider advertisement \+ signature via the API and verify client-side; show the full provider address \+ certificate hash \+ cost, and ask for explicit confirmation before signing (like the `yes` prompt on `xe burn`); or require an explicit provider / provider allowlist for unattended `runJob` use.

### Thread

**Joseph Denne**team2026-11-23 01:01 UTCdesk

Thanks. This is the same finding as https://bounty.xe.network/XE-1730, which was filed first; the programme pays the
first verifiable submission, so this one closes as a duplicate. If you believe it is a different
bug, file a new report that links https://bounty.xe.network/XE-17125 and says what differs; it is read like any other.
