Skip to main content
This page covers the Rail402 facilitator (/verify, /settle, /supported), the Bazaar catalog and search, the upto settlement contract, the buyer side: the SDK, the rail402 CLI and the rail402-mcp server that let agents pay, and the Playground, a page and server that pay on the testnet from a browser. For each threat it says what Stellar makes different, which mitigations answer it, where they live in the code, which tests prove them, and what risk remains. Every threat is an entry in docs/security/threats.json. The tables below are generated from it, and a unit test fails when a cited source file no longer contains the cited symbol, when a cited test no longer exists, or when a cited conformance case is not declared by its harness. The operational test report shows the exercises that run these tests and what they observed.

Invariants

The design rests on seven properties. Each threat below is an attempt to break one of them.
  1. The facilitator is never the source of payment funds. It sponsors fees through a fee bump and nothing else; any payment that makes a facilitator account a payer, a source or a party to an authorization is refused.
  2. A signed authorization moves funds at most once. The Soroban host consumes its nonce, and Rail402’s settlement ledger answers every repeat from one record.
  3. The payer’s signature fixes the recipient and the amount, or the cap. Changing either after signing fails signature verification on chain.
  4. The sponsor’s exposure is bounded per settlement by the fee ceiling and per hour by the fee budget.
  5. A listing is owned by the payTo that was settled, and is published only after its own origin confirms it.
  6. Rail402 and its buyer tools never dial a non-public address on someone else’s behalf, unless loopback is explicitly allowed for a local test network.
  7. An agent cannot spend beyond the caps its owner set, which are checked immediately before signing.

Assets

Trust boundaries

Summary

STRIDE letters: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege. “Accepted risk” means the threat cannot be fully closed by a facilitator (for example a payer racing its own payment within one ledger); the residual risk says what bounds it.

Replay

A Stellar payment authorization is not a signed transaction but a Soroban authorization entry: a signature over one contract invocation, a nonce and an expiration ledger, bound to the network by its passphrase. The host consumes the nonce when the entry is used, so funds can move only once. What remains for the facilitator is not to pay for duplicates, to give every repeat the same answer, and to stop a seller from serving one payment many times.

R1. The same authorization is settled twice

Mitigated · Tampering, Elevation of privilege · boundary TB2 (Seller and facilitator) · asset: Payer funds Threat. A seller, a buyer or anyone holding a payment sends the same PAYMENT-SIGNATURE to /settle again, one after another or many at once, hoping the payer is charged more than once. What Stellar makes different. An exact or upto authorization is a Soroban authorization entry whose nonce the host consumes when the entry is used; a second use fails on chain with Error(Auth, ExistingValue). The nonce lives under the payer’s own address, for G and C accounts alike, until the signature expires. A duplicate that reaches the network is included and fails, so the sponsor still pays its fee. Preconditions. A copy of a payment payload that was already sent to /settle. Impact. Without protection: one wasted sponsor fee per duplicate. The payer can never be charged twice, because the host refuses the second use of the nonce. Mitigations Tests Conformance runs. live-matrix case replay-idempotent, live-matrix case replay-concurrent, live-matrix case replay-late. Residual risk. None for funds. A repeat costs a database read, and rate limits bound how often it can be asked.

R2. The same authorization in a new envelope

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Sponsor XLM Threat. An attacker wraps an already settled authorization entry in a transaction of different bytes (another source, sequence or fee) so it is not recognised as a repeat. What Stellar makes different. The authorization is bound to its invocation, not to the transaction, so it can be placed in any envelope. The host refuses the consumed nonce at apply time; a facilitator that only compared envelope bytes would submit it and pay the fee. Preconditions. A copy of a settled authorization entry. Impact. One wasted sponsor fee per attempt if it reached the network. Mitigations Tests Conformance runs. live-matrix case replay-rejected. Residual risk. None: nothing is submitted.

R3. An authorization replayed on another network

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Payer funds Threat. A payment signed for stellar:testnet is presented for stellar:pubnet, or the reverse. What Stellar makes different. The signed preimage (HashIdPreimageSorobanAuthorization) includes the network id, the SHA-256 of the network passphrase, so a signature is only valid on the network it was made for. Preconditions. A signed payment for one network. Impact. None on chain: signature verification fails on the other network. Mitigations
  • The network id is part of every signed preimage the buyer’s guard decodes and checks. (packages/stellar/src/auth.ts, networkIdForPassphrase)
  • A request is served only on the network its requirements name, and a payload for another network is refused. (apps/rail402/src/app.ts, invalid_network)
Tests Conformance runs. rejection-audit case unknown-network. Residual risk. None.

R4. Paid once, served many times

Accepted risk · Spoofing, Elevation of privilege · boundary TB1 (Buyer and seller) · asset: Seller revenue Threat. A buyer pays once and sends the same PAYMENT-SIGNATURE several times, concurrently or later. A stock upfront seller calls /settle without /verify; in the authorization flow, copies sent together all pass /verify before the first one settles. Either way the seller serves on a successful /settle, and an idempotent facilitator answers every repeat with the same success. What Stellar makes different. Nothing Stellar-specific allows it: it follows from answering repeats with the stored result, which the x402 idempotency requirement asks for. The Stellar part is that the answer carries the one settlement transaction hash, which a seller can deduplicate on. Preconditions. A seller that serves on a successful /settle without remembering which settlements it already served. Impact. The seller serves a paid resource more than once for one payment. The buyer is charged once. Mitigations
  • Every repeated /settle answer carries a repeat marker in EXTENSION-RESPONSES (rail402.settlement.repeat), with the attempt id of the request that holds the settlement’s claim as the repeat is answered (rail402.settlement.attempt): the one that started it, or the one that took a stale claim over and settled it, whose id replaces the abandoned request’s, also for a repeat that waited through the takeover. The Bazaar never lists rail402 as an extension a resource declares. (packages/facilitator/src/responses.ts, markRepeat)
  • The seller helpers refuse a second request whose settlement is a repeat or a transaction already served. Each /settle they send carries a new random attempt id, and the marker is set aside only when it echoes one of their own attempts that may have settled the payment without a success served for it (the facilitator answered settlement_pending, or /settle brought no answer of the facilitator’s own: anything but its x402 settle body). That success is served once. A marked success that echoes another id (another seller, replica, an earlier run, or a request that took over a stale claim), no id, or an id already resumed is refused, whatever the timing; a refusal in the facilitator’s own x402 body waits for nothing, and a refused repeat never counts as the serve. (packages/sdk/src/seller/dedupe.ts, withSettleDedupe)
  • In the authorization flow, verify refuses an authorization that is being settled or was, so a copy sent after the first settlement started never reaches the handler. (packages/facilitator/src/scheme.ts, alreadySubmitted)
  • The demo seller settles every route and tool, exact and upto, through withSettleDedupe, and so do the Playground’s lab sellers; the seller quickstart, the HTTP seller example and the seller helpers page wrap their facilitator client the same way, in both flows. (apps/demo-seller/src/seller.ts, withSettleDedupe)
  • The Playground’s lab sellers wrap their facilitator client in withSettleDedupe inside the trace recorder, so a refused copy is traced as refused. (apps/playground/src/lab/mount.ts, withSettleDedupe)
Tests Conformance runs. live-matrix case replay-idempotent. Residual risk. A seller on stock middleware, in either flow, that does not wrap its facilitator client with withSettleDedupe, or deduplicate PAYMENT-RESPONSE.transaction itself, can serve concurrent copies of one payment. The seller quickstart, the seller helpers page and the HTTP seller example all wrap it. A seller paired with a facilitator that does not record and echo the attempt id refuses buyers whose answer was lost or pending; with a facilitator that sends no marker at all, wrappers that can accept the same payment must share one memory.

R5. An upto authorization settled for zero stays usable

Mitigated · Tampering · boundary TB7 (Contracts) · asset: Payer funds Threat. A seller settles an upto payment for zero, then tries to charge the same authorization again for a positive amount. What Stellar makes different. An on-chain zero settlement still uses the payer’s authorization entry, so the host consumes its nonce like any other settlement. An off-chain zero (UPTO_ZERO_SETTLEMENT=offchain) sends nothing, so the nonce stays unused on chain until the signature expires. Preconditions. An upto payment settled for zero. Impact. Without protection, a second settlement of the same authorization for up to the cap. Mitigations
  • The upto contract consumes the payer’s nonce for a zero settlement too. (contracts/stellar/upto/src/lib.rs, pub fn settle)
  • An off-chain zero is a terminal record in the settlement ledger, so a later request for any amount is answered from it or refused as a conflict; only the named authority can settle on chain, and it is Rail402’s. (packages/facilitator/src/upto-scheme.ts, offchainZero)
  • A database restore can discard that record while the authorization is still valid, so every restore is recorded (restore-dump.sh in its own transaction, creating the table for an older dump; the runbook after a point-in-time recovery; the migration that adds the record, for a database that already holds settlements or was migrated earlier). Every upto network, whatever its zero settlement mode and ledger time now, then verifies no upto payment and settles none that moves funds until the chain has passed the longest window rule 7 can accept (the largest maxTimeoutSeconds at the shortest ledger time it counts, one second), counted from a ledger recorded only by recordRestoreHold (the service’s network poll): the ledger the chain can have reached by the time of a reading from a provider of that network whose newest ledger closed within the last minute (that ledger plus one per second since). Requests never record or move it and, until it is recorded, hold from their own reading. The poll starts the hold again from a reset test network’s new chain only after corroborating the reset (the same checks and a second poll), and never on pubnet. (packages/facilitator/src/upto-scheme.ts, restoreHold)
Tests Conformance runs. live-matrix case upto-zero. Residual risk. With off-chain zeros and STORE=memory, a restart forgets the record; the authorization then stays settleable by Rail402’s own authority until it expires. Use Postgres wherever off-chain zeros are enabled. The hold after a restore is counted in ledgers from the current TIMEOUT_MAX_SECONDS at the shortest ledger time rule 7 counts, so no ledger time setting, before or after the restore, shortens it. Lowering TIMEOUT_MAX_SECONDS in the same restore does, and so could a point-in-time recovery the operator did not record, a failover to an asynchronous standby that lost recent commits (not recorded at all), rolling back to a release that predates the record without waiting out the hold, or the runtime role setting the recorded ledger to 0 or deleting the record on a one-role host (it can change that ledger on any host, as it could already reopen an off-chain zero by deleting its settlement row): an authorization could then be settled once more, never above its cap and only to its payTo. The first ledger is recorded from one provider’s reading that passed the passphrase and freshness checks (its newest ledger closed within the last minute, and not in the future), as that ledger plus one for every second since it closed, the most the chain can have reached by then, so an honest reading up to a minute old cannot set it too low; until it is recorded every upto request holds, and rail402_upto_restore_hold_pending shows it. A provider that lies (compromised or misconfigured), answering this network’s passphrase with a fresh-looking ledger far below the chain, can still record a low first ledger and void the hold on any network, pubnet included; on a test network it can also restart the hold early over two polls. Configure only providers you trust; an in-process facilitator that never runs recordRestoreHold stays held after a restore until the owner records the ledger.

Front-running

Because the authorization is bound to its invocation rather than to a transaction, anyone who sees it before it lands can submit it in a transaction of their own. That can only make the signed payment happen, exactly as signed; it cannot redirect it. The cost is Rail402’s own failed transaction, and the risk is telling a seller “failed” for a payment that settled.

F1. A copied exact authorization lands first

Accepted risk · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. Someone who sees the settlement envelope (the seller, an RPC operator, a validator’s pending queue) copies the payer’s authorization entry into a transaction of their own and gets it included before Rail402’s. What Stellar makes different. A Soroban authorization is a bearer instrument for exactly one invocation: whoever submits it can only make the signed transfer happen, from the payer to payTo for the signed amount. It cannot be redirected. Rail402’s own transaction then fails on the consumed nonce and its fee is spent. Preconditions. Access to the envelope between signing and inclusion, and an account to pay the copy’s fee. Impact. One wasted sponsor fee per event. The attacker pays its own fee and gains nothing; the payment settles as signed. Mitigations Tests Residual risk. The wasted fee is not recoverable. Each event costs the attacker its own fee too.

F2. The seller is told the payment failed although it settled

Mitigated · Repudiation · boundary TB2 (Seller and facilitator) · asset: Seller revenue Threat. After a front-run, Rail402’s transaction fails with a consumed nonce and the seller is told the payment failed, although the payer was charged. Likewise when Rail402’s rebroadcast is refused and someone else lands its public transaction in a fee bump of their own. What Stellar makes different. The chain holds the proof: the nonce entry’s last-modified ledger, and in that ledger a successful transaction whose address credential (payer, nonce, signature expiration) and root invocation are byte-equal to the payer’s signed entry, with the matching token transfer event. Preconditions. A front-run as in F1, or a refused rebroadcast of a settlement transaction a send may have exposed. Impact. Without reconciliation the seller withholds a resource that was paid for. Mitigations
  • A failed settlement whose nonce was consumed is reconciled: Rail402 finds the other transaction on chain, proves it carried the same signed invocation after the request was claimed, and answers success with its hash. (packages/facilitator/src/third-party.ts, findThirdPartySettlement)
  • Proof requires a byte-equal root invocation and credential; a different invocation for the same nonce stays a failure. (packages/facilitator/src/third-party.ts, signedAuthorizationOf)
  • The failure is kept only when the search read RPCs that have reached the ledger Rail402’s transaction failed in and hold the ledger that consumed the nonce; a read from a lagging provider, a backend behind a balancer or another provider after a failover, a backend whose history starts after the consuming ledger, or a read error, leaves the settlement open for the next pass, which reads the failure again and searches with fresh reads. One that stays undecided for a minute is reported as unresolvable, and a failure on the used nonce whose nonce reads unused at the ledger it failed in (its entry lapsed) is reported as unresolvable at once instead of kept. (packages/facilitator/src/third-party.ts, rpc_behind)
  • An upto settlement whose rebroadcast the network refuses for good (a frozen sponsor key, say) after a send may have exposed its transaction keeps waiting until no later ledger can include that transaction, since anyone can wrap it in a fee bump of their own until then; the inner-hash lookup finds such a landing and the payment is answered as settled. One whose sends were all refused finishes at once. (packages/facilitator/src/engine.ts, includableAfter)
  • An exact settlement included after the payer’s authorization expired is searched the same way: the host checks the expiration before the nonce, so a copy that landed before the expiration makes Rail402’s transaction fail as expired, and the payment is answered as settled with the copy’s hash. (packages/facilitator/src/engine.ts, invalid_exact_stellar_signature_expired)
  • An exact settlement whose own transaction the network refused for good, or can never apply because another transaction took its channel’s sequence number, is decided from the payer’s nonce, never at once: anyone who holds the payment can carry its authorization in a transaction of their own until it expires. A copy that landed is answered as settled with its hash, and the settlement is answered as failed only once the authorization expired unused, so a seller is never told to refuse a buyer, or a buyer to pay again, while the first payment can still land. (packages/facilitator/src/engine.ts, othersCanCarry)
  • An exact settlement whose own transaction was included and failed for a cause that does not end the authorization (a balance spent, a trustline removed or deauthorized, an account or smart account that refused it for now, a token error, a failure without diagnostics) is not finished either: the failure rolls back, the payer’s nonce included, so anyone who holds the payment can still land it until it expires. An expired-authorization error ends it only when the transaction failed past the payer’s own expiration ledger, since a contract in the call path or a shorter-lived entry can raise one. The settlement answers settlement_pending, gives its channel back at once, and is searched as above; it is answered with its on-chain cause, the fee counted as wasted, once the nonce reads unused past the expiration. The SDK reports those causes as paid unknown, never retryable, so a buyer is not invited to pay again while the first payment can still land. (packages/facilitator/src/engine.ts, endsAuthorization)
Tests Residual risk. A settlement whose consuming ledger no RPC still holds stays unresolved and is reported (O4); reconciliation runs immediately after the failure, well inside the retention window. Soroban keeps a consumed nonce’s entry until the later of the authorization’s expiration and the consuming ledger plus the network’s minimum temporary entry lifetime (about a day on pubnet, an hour on testnet); a failure without diagnostics, on an expired authorization, or on any exact cause that leaves the authorization usable, first searched after that finds no consumption and is kept as failed, while one on the used nonce is left unresolved.

F3. A third party settles an upto payment for another amount by submitting it

Mitigated · Tampering, Elevation of privilege · boundary TB7 (Contracts) · asset: Payer funds Threat. Someone holding an upto payload (the buyer, the seller, a TLS-terminating proxy, a log, an RPC operator who sees the settlement envelope) submits it themselves for another amount up to the cap, such as zero or the whole cap, before or instead of the seller’s settlement. What Stellar makes different. The payer’s signature covers the cap, not the amount. The upto contract therefore also requires the authorization of the settlement authority named in the signed terms, and Rail402 makes that authority the operation’s source account, so its authorization is the transaction’s own signature and cannot be copied into another transaction. Preconditions. A copy of an upto payload. Impact. None: the network refuses a settlement that the settlement authority did not authorize, and Rail402’s settlement proceeds. The same request through the facilitator’s own /settle is F5. Mitigations
  • The contract requires terms.facilitator to authorize settle(payer, terms, amount), so the authority’s authorization covers one amount and nothing else. (contracts/stellar/upto/src/lib.rs, terms.facilitator.require_auth())
  • Rail402 signs as the authority through a source-account credential that exists only inside its own transaction. (packages/upto/src/terms.ts, authorityEntry)
Tests Residual risk. None against anyone without the settlement authority’s key; a holder of that key is U10.

F4. Another holder of the authority settles first

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Seller revenue Threat. Two replicas sharing the sponsor secret, or a stale process, settle the same upto payment; one lands first with a different amount than the seller asked for. What Stellar makes different. Only a transaction signed by the authority can land; the landed amount is readable from the settle arguments and the upto_settled event. Preconditions. Two processes that hold the same authority key. Impact. Without reconciliation the seller gets a false failure, or a success for an amount it did not request. Mitigations
  • The later settlement is answered with the landed transaction when it settled the same amount, and with settle_upto_stellar_settled_elsewhere, naming both amounts, when it did not. (packages/facilitator/src/engine.ts, settle_upto_stellar_settled_elsewhere)
Tests Residual risk. None beyond one wasted fee.

F5. A payload holder fixes the upto amount through the facilitator’s /settle

Accepted risk · Tampering · boundary TB2 (Seller and facilitator) · asset: Seller revenue Threat. Someone holding an upto payload asks the facilitator’s own /settle to settle it for another amount up to the cap, such as zero or the whole cap, before the seller does. What Stellar makes different. The payer’s signature covers the cap, not the amount, and the facilitator is the settlement authority: whichever accepted /settle request comes first decides the amount it authorizes, and the payer’s nonce then makes the authorization single-use. Preconditions. A copy of an upto payload and access to the facilitator’s /settle (keyless on the public testnet service). Impact. The first accepted request fixes the amount anywhere in [0, cap] to payTo: a buyer who settles zero first leaves the seller unpaid for that request, and anyone who settles the cap first charges the buyer the full cap. The seller’s own later request for a different amount is refused as an idempotency conflict. Funds never go elsewhere and never exceed the cap. Mitigations
  • The facilitator settles an authorization once: the first accepted amount wins, and a later request for a different amount is refused with settle_upto_stellar_idempotency_conflict naming the amount that holds it. (packages/facilitator/src/engine.ts, idempotencyConflict)
  • Operators can require API keys for /verify and /settle per network, so only known sellers can settle; the payload travels only from buyer to seller over TLS, and sellers settle before releasing a buffered response. (apps/rail402/src/app.ts, requireApiKey)
Tests Residual risk. Accepted for payload holders on a keyless facilitator: a buyer or anyone who sees the payload can fix the amount through /settle before the seller (unpaid seller compute and one sponsor fee, or the buyer charged up to its own cap). Operators who need more require API keys for /settle.

Fee sponsorship

The sponsor pays the fee of every transaction it submits, and Soroban charges resource fees whether the transaction succeeds or fails. Every refusal Rail402 can make before signing costs nothing; a transaction that is included and fails costs its fee. Rail402 refuses whatever it can see coming, names and counts what it cannot, and bounds the total.

S1. A payment passes simulation and fails at apply

Accepted risk · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. A payer spends the balance, or changes a smart account’s state, after the settle-time simulation and before inclusion, so the settlement is included and fails. What Stellar makes different. Soroban resource fees are charged when a transaction is included, success or failure; the sponsor pays through the fee bump. Simulation runs against the latest ledger, so a change made in the ledgers between simulation and inclusion is not seen. Preconditions. A payer (or its smart-account policy) able to act within about one ledger of the settlement. Impact. One wasted sponsor fee per event, never more than the fee ceiling. No funds move. Mitigations
  • Settle simulates again with the current ledger, so a change made before settle is refused without submitting. (packages/facilitator/src/scheme.ts, settle)
  • The failure is named from the transaction’s diagnostic events and counted as wasted fee. It rolls back, the payer’s nonce included, so the exact settlement waits until the authorization expired unused before it answers the failure, and answers success with a copy’s hash when someone who holds the payment lands it meanwhile (F2); its channel is given back at once. (packages/facilitator/src/explain.ts, explainFailedTransaction)
  • The hourly fee budget and the reserve floor bound the total a griefer can burn. (packages/facilitator/src/guard.ts, SponsorBudget)
Tests Residual risk. The race inside one ledger cannot be closed by a facilitator that does not hold the funds. Each event costs the payer an on-chain transaction of its own.

S2. An authorization expires between submission and inclusion

Accepted risk · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. A payment is settled with an authorization whose expiration ledger passes while the transaction waits for inclusion. What Stellar makes different. Validity runs through signatureExpirationLedger inclusive; the transaction’s time bound can outlive it. An included transaction whose authorization expired fails and its fee is spent. Preconditions. A payment settled at the very end of its validity window. Impact. One wasted sponsor fee. Mitigations
  • Settle refuses an authorization that expires within a one-ledger margin of the current ledger. (packages/facilitator/src/preflight.ts, invalid_exact_stellar_signature_expiration_too_soon)
  • An upto settlement’s ledger bounds end at the expiration ledger, so the network refuses it before inclusion and no fee is spent. (packages/upto/src/facilitator/scheme.ts, buildTransaction)
Tests Conformance runs. live-matrix case expiry-window. Residual risk. For exact, a transaction that waits longer than the margin in the network’s queue can still fail this way; it is named and counted as wasted. When a copy of the authorization landed before the expiration, the failure is searched and the payment answered as settled (F2).

S3. A payment that is expensive to settle

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Sponsor XLM Threat. A payer submits a payment whose settlement needs large resources: a heavy __check_auth, a token that writes a lot of state, or rent for entries it extends. What Stellar makes different. Soroban fees depend on the instructions, ledger reads and writes, and rent of the invocation, which the payer’s account and the token contract choose. The fee is known from simulation before anything is signed. Preconditions. A smart account or token contract whose calls are costly. Impact. Without a ceiling, an arbitrary fee per settlement. Mitigations Tests Residual risk. A payment just under the ceiling costs up to the ceiling. Operators accepting tokens that pay rent on read raise the ceiling knowingly (the TEST6 token needs more than 1,000,000 stroops on testnet, and the testnet default of 2,000,000 leaves room for its rent price to rise).

S4. A flood of valid small payments

Accepted risk · Denial of service · boundary TB2 (Seller and facilitator) · asset: Sponsor XLM Threat. Someone makes many real, valid payments of the smallest amount to drain the sponsor through fees. What Stellar makes different. Every valid settlement costs the sponsor a fee of tens of thousands of stroops, far more than a one-unit USDC payment is worth. Preconditions. Funds for many small payments. Impact. Sponsor XLM spent at the attacker’s pace. Mitigations
  • An hourly fee budget, shared by replicas through the settlement ledger, stops new settlements once reached; pubnet refuses to start without one. (packages/facilitator/src/guard.ts, maxSpendPerHourStroops)
  • Per-client rate limits and API keys on /verify and /settle; API keys must be decided explicitly for pubnet. (apps/rail402/src/rate-limit.ts, RateLimiter)
  • Per-asset minimum amounts for exact payments and upto caps (an upto settlement may still be zero; see U6). (apps/rail402/src/config.ts, parseAssets)
Tests Conformance runs. rejection-audit case rate-limited, rejection-audit case api-key-required. Residual risk. On a free, keyless testnet facilitator the per-client rate limit (IPv6 clients are grouped by /64) and, where configured, the hourly budget are the only bounds. A client with many addresses passes the rate limit, so the budget is the real bound: once it is spent, every settlement is refused until the hour moves on, which trades availability for the sponsor’s balance. On pubnet the budget is required, and pricing, keys and minimums are an operator decision.

S5. The sponsor falls below its reserve

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Availability Threat. The sponsor’s balance runs low, from normal use or an attack, until fee bumps start failing mid-settlement. What Stellar makes different. The sponsor also carries the base reserves of the channel accounts and the upto authority, which it sponsors; below them it cannot pay fees at all. Preconditions. Sustained settlement volume or an attack as in S4. Impact. Settlements fail after signing; the service becomes unavailable. Mitigations Tests Residual risk. None beyond downtime until the sponsor is refunded.

S6. Duplicate submissions of one settlement

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. Retries, concurrent requests or two replicas submit the same settlement more than once. What Stellar makes different. Each submitted transaction consumes a channel sequence number and pays its own fee; the second one fails on the consumed nonce. Preconditions. Concurrent or repeated requests for one payment. Impact. Wasted fees and sequence conflicts. Mitigations Tests Conformance runs. concurrency case distinct-sequences. Residual risk. None.

S7. Restoring archived state inside a buyer’s payment

Mitigated · Denial of service · boundary TB7 (Contracts) · asset: Sponsor XLM Threat. A settlement touches an archived contract instance or entry, and the transaction would restore it, billing the restoration rent to the sponsor as part of the payment. What Stellar makes different. Since protocol 23 a freshly simulated invocation of an archived persistent entry restores it automatically inside the transaction, and the fee payer pays the rent. Preconditions. An archived settlement contract, token instance or balance entry. Impact. Rent paid by the sponsor on behalf of whoever let the entry expire. Mitigations
  • A simulation that reports archived state is refused: the upto settlement contract with invalid_upto_stellar_settlement_contract_archived, other entries with the archived-state code; nothing is submitted. (packages/upto/src/facilitator/simulation.ts, archivedStateRejection)
  • Exact payments name archived state from the simulation’s restore preamble. (packages/facilitator/src/explain.ts, explainSimulation)
Tests Residual risk. None; restoration is an operator action (U7).

S8. Dust self-payments drain the pubnet fee budget for every seller

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Sponsor XLM Threat. A caller settles many valid payments of the smallest amount, often to a payTo it controls, so the sponsor pays a full fee each time and the hourly budget is spent for everyone. What Stellar makes different. A token transfer settlement costs the sponsor a resource fee of tens of thousands of stroops, while the payment can be one base unit; paying oneself is legal on chain. Preconditions. One funded account with a trustline; on pubnet an API key when keys are required. Impact. Without controls the hourly budget is exhausted within minutes and every other seller’s settlements are refused until the hour moves on. Mitigations
  • Each access key carries its own hourly sponsor budget, keyless callers share one, and both are checked with the network budget when the settlement is claimed. (apps/rail402/src/access.ts, sponsorBudgetStroopsPerHour)
  • Pubnet requires an explicit minimum amount for every accepted asset and refuses to start without one. (apps/rail402/src/config.ts, config_pubnet_asset_min_missing)
  • Per-payer and per-payTo settlement limits per minute, on by default on pubnet, count only payments that proved the payer’s signature (just before the sponsor signs), so forged payloads naming a seller or a wallet cannot use up its quota. The payTo limit is counted per access key, with one shared count for keyless callers, so keyless dust cannot use up a keyed seller’s quota. (packages/facilitator/src/limits.ts, admitVerified)
  • On pubnet a non-zero upto settlement is held to the asset’s minimum, as an exact amount is; a zero settles off-chain. (packages/facilitator/src/upto-preflight.ts, amount < asset.minAmount)
  • Finished settlements count the fee actually charged against the budgets (nothing when they expired or the network refused them), so payloads that never land stop holding budget once finished. (packages/store-postgres/src/settlement-ledger.ts, WHEN state = 'expired' THEN 0)
Tests Residual risk. Self-payments are not refused outright; the per-payTo limit and the caller budget bound them. Keyless callers share one per-payTo count, so keyless dust can still delay keyless payments to a seller. A patient attacker with many keys or payers spends up to the sum of their budgets, still bounded by the network budget; keys are issued on request.

S9. One payer repeats settlements that are included and fail

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. A payer deliberately makes settlements fail at apply time (spends the balance after simulation, a smart account whose check flips, an expiring authorization), again and again; each included failure costs the sponsor a fee. What Stellar makes different. A failed transaction that is included still charges its fee to the fee-bump source; the race inside one ledger cannot be closed by a non-custodial facilitator. Preconditions. An account the attacker controls; on pubnet an API key. Impact. Real XLM per event, otherwise bounded only by the hourly budgets. Mitigations
  • A payer whose settlements were included and failed PAYER_FAILURES_PER_HOUR times in the last hour is refused with a coded, retryable reason until the hour moves on (3 by default on pubnet). (packages/facilitator/src/limits.ts, failuresPerHour)
  • Pubnet’s expiration margin defaults to two ledgers, so a settlement that lands a ledger late does not fail after the fee is paid. (apps/rail402/src/config.ts, PUBNET_EXPIRATION_MARGIN_LEDGERS)
Tests Residual risk. The first failures per payer per hour are paid; new payer accounts cost the attacker reserves. An exact failure that leaves the payer’s authorization usable counts once its settlement finishes, when the authorization expired unused (at most maxTimeoutSeconds later); until then the hourly fee budget bounds what such failures cost.

S10. Surge pricing against the inclusion floor and the fee ceilings

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Availability Threat. During mainnet surge pricing the inclusion bid sits at its floor or cap and is never included, or a ceiling that silently defaults lets one settlement cost far more than the operator planned. What Stellar makes different. Mainnet’s Soroban inclusion fees have sat at 200 stroops; the bid falls back to the floor when fee stats cannot be read. Preconditions. Network congestion, or an RPC that cannot serve getFeeStats. Impact. Settlements pend and time out, channels stay leased; or each settlement spends up to an unplanned ceiling. Mitigations
  • Pubnet refuses to start without explicit PUBNET_MAX_TX_FEE_STROOPS and PUBNET_INCLUSION_FEE_STROOPS of at least 200 (unless explicitly overridden) and, with upto, PUBNET_UPTO_MAX_TX_FEE_STROOPS. (apps/rail402/src/config.ts, PUBNET_INCLUSION_FEE_STROOPS)
  • A metric counts fee-stats readings whose bid is pinned at the cap or bid blind at the floor, for alerting. (apps/rail402/src/metrics.ts, inclusionFeePinned)
Tests Residual risk. In a sustained surge above the cap, pubnet settlements pend or fail; that is the configured trade-off.

S11. Concurrent admissions overshoot the hourly budget

Mitigated · Denial of service · boundary TB4 (Facilitator and its state) · asset: Sponsor XLM Threat. Many settlements are admitted at once while the committed fees are just under the budget; each passes the check before any of them records its envelope. What Stellar makes different. n/a (facilitator logic). Preconditions. A burst of concurrent settles near the budget edge, on one or several replicas. Impact. Spend above the budget by up to the number of concurrent admissions times the fee ceiling. Mitigations
  • Each claim reserves its settlement’s fee ceiling until its envelope is recorded, and the budget check and the claim are one step under a per-network database lock shared by every replica. (packages/store-postgres/src/settlement-ledger.ts, BUDGET_LOCK_ID)
  • The engine passes the reservation and the hourly limits with every sponsored claim; an exact settlement reserves its worst case, the fee ceiling plus the highest inclusion bid its fee bump pays again. (packages/facilitator/src/engine.ts, exactReserveStroops)
  • The sponsor refuses to sign a fee bump whose fee exceeds the settlement’s reservation, so nothing broadcast can cost more than was reserved. (packages/facilitator/src/engine.ts, costs more than the settlement reserved)
Tests Residual risk. None: a settlement costs at most its reservation.

S12. Settlements admitted while the sponsor balance is unknown

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. After a restart or during an RPC outage the sponsor balance is unknown and the reserve floor is skipped, so settlements spend into the reserve that keeps channels and the authority alive. What Stellar makes different. Channel and authority reserves are sponsored by the sponsor; dropping below its own minimum balance makes fee bumps fail mid-settlement. Preconditions. A restart, or an RPC that cannot be read. Impact. Fees spent below the reserve floor. Mitigations
  • On pubnet the sponsor guard refuses with a retryable code until a balance has been read; testnet keeps admitting. (packages/facilitator/src/guard.ts, refuseWhileUnknown)
  • Pubnet is held, refusing its own settlements, while the sponsor balance is unknown or below its reserve. (apps/rail402/src/runtime.ts, sponsor_balance_unknown)
Tests Residual risk. None beyond a short refusal window after start.

S13. Contract TTL upkeep spends outside the hourly budget

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. The upto TTL keeper extends or restores contract state with the sponsor’s XLM; a lying RPC, a mis-sized ceiling or a loop makes it spend up to its ceiling repeatedly. What Stellar makes different. TTL extension cost scales with entry size and ledgers; extending the code entry by the network maximum cost about 32 XLM on testnet. Preconditions. The keeper enabled on pubnet; a bad simulation or a planning bug. Impact. Up to the keeper’s ceiling per round, outside any settlement budget. Mitigations
  • Pubnet requires an explicit keeper ceiling, and a daily cap (one maximal extension per day unless configured) stops rounds that could pass it. (apps/rail402/src/upto-keeper.ts, dailyMaxFeeStroops)
  • Each keeper transaction reserves its fee ceiling as sponsor spend before it is signed, within the daily cap and the network’s hourly budget, atomically with settlement claims; the reservation is corrected to the fee charged once known, and stays at the ceiling while a transaction that failed to confirm may still land. (packages/store-postgres/src/settlement-ledger.ts, reserveSponsorSpend)
  • A transaction included and failed is counted at the fee it was charged; one with an unknown outcome keeps its ceiling counted. (apps/rail402/src/upto-keeper.ts, settleFailed)
Tests Residual risk. One extension per day up to the ceiling, whatever its outcome on chain.

Catalog poisoning

The Bazaar catalogs resources automatically after a successful settlement. The settlement proves one thing, that a payment reached payTo; everything else in the resource description came from the buyer’s request and must be confirmed at the resource’s own origin before it is published.

P1. Forged listing metadata or price

Mitigated · Spoofing, Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A buyer (or a seller’s buggy client) echoes a resource block with a false description, price or schema in the payment, hoping the catalog publishes it. What Stellar makes different. Nothing on chain describes the resource; the settlement proves only that a payment to payTo happened. The metadata must be confirmed at its origin. Preconditions. One real settlement to the seller. Impact. Misleading listings shown to buyers and agents. Mitigations
  • An HTTP resource, or an MCP tool at an http(s) endpoint, is published only after its own 402 (for a tool, the answer to an unpaid tools/call over MCP) confirms payTo, price and metadata; what is published always comes from that answer, so echoed metadata never changes a listing on its own. (packages/bazaar/src/catalog.ts, checkOrigins)
  • MCP tools are asked through safe-fetch with the MCP client: the tool must be declared in tools/list and its unpaid call must answer with the x402 PaymentRequired. (packages/bazaar/src/mcp-origin.ts, probeMcpTool)
  • A published listing is decided by one answer only, at its resource or its route template’s example path, asked as its origin confirmed it, and a published MCP tool by its listed call; an answer at a path a payer chose never changes or withdraws it, a published tool whose listed call fails for now is retried without calling it with a payload’s arguments, and an example kept from before examples were confirmed never withdraws it. While a listing not yet listed has a check open, the check keeps up to 4 paths per asset (the largest payments) and 8 in all (the latest) that its owner’s payers paid, asks them largest payments first within its host’s budget, going on from what earlier runs found when the budget runs out, and lists the listing from an answer that lists it for its owner at that answer’s price first. Later settlements never reset a check’s retries; one that pays the owner of a listing not yet listed makes its check due now and has its path asked again, and a run it makes due before the next scheduled retry spends none. (packages/bazaar/src/catalog.ts, decide)
Tests Conformance runs. live-bazaar case forged-metadata, live-bazaar case not-x402. Residual risk. A seller can describe its own resource falsely; buyers bind the price and recipient of a listing when paying (M6). Tools under an mcp:// URL have no origin to check (P10). Dust can still push a buyer’s payment out of a new listing’s open check: 4 payments in its asset at least as large, or 8 payments in other assets, two or more of them, made after it; the listing is then decided by the paths kept, and the buyer’s next settlement adds its path again. When a host’s budget is below a check’s paths, a larger payment in any token is asked before the buyer’s, which delays the buyer’s path by about a minute for each budget’s worth of such payments.

P2. Taking over another seller’s listing

Mitigated · Spoofing, Elevation of privilege · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. An attacker pays a URL that belongs to another seller, but to its own payTo, to take over or modify that listing. What Stellar makes different. The settled payTo is the only identity the facilitator has proven, from a settlement that moved value to it. An upto zero moves nothing and proves nothing, so it never catalogs. Preconditions. A settlement for the victim’s URL to the attacker’s account. Impact. Payments for a listed resource redirected to the attacker. Mitigations
  • A listing is bound to the settled payTo; another payTo is refused with bazaar_owner_conflict, and ownership moves only when the origin names the new payTo. (packages/bazaar/src/codes.ts, bazaar_owner_conflict)
  • A settlement that moved nothing (an upto zero, on-chain or off) never catalogs. A settlement that moved one base unit does not help either: a listing is published only with what its own origin answers (P1, P9). (packages/bazaar/src/catalog.ts, unprovenSettlement)
  • Every claimant of a listing is kept until a check ran with it, a check only claims asked for never withdraws a published listing, and a claim is weighed at the listing’s resource or route-template example path alone, never at the path the claimant paid: the listing moves only to a claimant that path names, and not its owner. A template’s example is the path its creating settlement paid, then the one its origin confirmed when it was listed, never pathParams a payer echoed; any other answer there refuses the claim. (packages/bazaar/src/catalog.ts, mayWithdraw)
Tests Conformance runs. live-bazaar case owner-conflict. Residual risk. A tool under an mcp:// URL is scoped to its owner, so it cannot be taken over, but its first content is whatever its first payer echoed (P10). On a host that serves one tenant per path, whoever first pays for a route template no origin has confirmed chooses its first example path, which the origin’s answer there then decides, as it could by paying its own payTo. Listings cataloged before examples came from the paid path keep the example their first payer echoed until they are listed again. Such a kept example weighs claims all the same: when it is another tenant’s path on a host that serves one tenant per path, that tenant’s claim moves the listing to it; and while it answers for no payTo (an echoed path the seller does not sell), the listing stays with its owner, so a seller that moved to a new payTo cannot move it until that path answers or the listing expires.

P3. Hostile JSON Schema in listing metadata

Mitigated · Denial of service, Information disclosure · boundary TB2 (Seller and facilitator) · asset: Availability Threat. Metadata carries a schema with a catastrophic regular expression, a combinatorial check, deep nesting or an external $ref. What Stellar makes different. None: this is a property of the catalog, which validates schemas it receives in payments. Preconditions. One settlement carrying the schema. Impact. Catalog workers stalled, or the service fetching arbitrary URLs. Mitigations
  • Schemas compile and validate in a worker with a time budget and a bounded queue; external references are refused. (packages/bazaar/src/schema-sandbox.ts, SchemaSandbox)
  • One sandbox per network and lane (settlements and origin checks, /verify previews), each with its own worker and queue; a busy validator decides nothing, and a settlement’s cataloging stays queued and is retried. (packages/bazaar/src/schema-sandbox.ts, SchemaSandboxes)
Tests Conformance runs. live-bazaar case schema-rejected. Residual risk. None.

P4. Encoded traversal in a route template

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A routeTemplate hides ../, NUL, CR/LF or a backslash behind percent-encoding so that a listing matches, or later fills, paths it should not. What Stellar makes different. Nothing in the parsing is Stellar-specific. What a template changes is which paths are paid to one Stellar account: a listing and every path its template claims stay bound to the payTo proven by the settled transfer (P2), so a template can only widen a seller’s own listing, and only over paths its own route matched. Preconditions. One settlement carrying the template. Impact. A listing that claims paths of another resource, or a buyer tool that fills a path outside the seller’s route. Mitigations Tests Conformance runs. live-bazaar case route-template. Residual risk. None.

P5. Wash settlements to flood or rank the catalog

Accepted risk · Tampering, Denial of service · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A seller pays itself through a second account many times to create many listings or to look popular. What Stellar makes different. Settlements are cheap on Stellar, so volume is a weak signal of quality. Preconditions. Two accounts and a little USDC. Impact. Catalog spam and manipulated rankings. Mitigations
  • New listings are rate-limited per owner and origin, per payer and for the whole catalog. (packages/bazaar/src/catalog.ts, maxNewListingsPerPayerPerHour)
  • The owner’s and the network’s hourly quotas are spent when a listing is first published: one its origin confirms while either is spent waits, without spending a retry, so listings created at once or kept pending for hours never publish past the quotas. (packages/bazaar/src/catalog.ts, newListingsSpent)
  • Tools no origin can confirm (mcp://) are counted apart, within half of the network’s hourly quota of new listings and half of its room, so dust payments for them never use up what sellers with an origin need. (packages/bazaar/src/policy.ts, unverifiedBudget)
  • Search never ranks by settlement count: ties break by origin verification, then listing age. (packages/bazaar/src/wire.ts, trustRank)
  • Self-payments are not cataloged. (packages/bazaar/src/codes.ts, bazaar_self_payment)
Tests Residual risk. A patient seller can still create listings up to the limits; each needs a working origin that answers 402, or, on testnet, takes a place among the mcp:// tools, which share half of the network’s quota and room.

P6. One payment used for many listings

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. The same settled transaction is presented with different resource blocks to catalog several resources. What Stellar makes different. A transaction hash identifies exactly one settlement on chain. Preconditions. One settlement. Impact. Listings without payments behind them. Mitigations Tests Conformance runs. live-bazaar case settlement-reused, live-bazaar case duplicate-settlement. Residual risk. None.

P7. Injection through reasons and response headers

Mitigated · Tampering, Denial of service · boundary TB2 (Seller and facilitator) · asset: Availability Threat. Metadata crafted so that a rejection reason quoting it breaks headers, logs or clients, or grows EXTENSION-RESPONSES beyond what proxies accept. What Stellar makes different. EXTENSION-RESPONSES travels in the same /settle answer as the settled transaction hash. The payment is final on the ledger whatever happens to the header, so a header that breaks the answer would hide a settled payment from the seller; the bound keeps that answer intact. Preconditions. One settlement with crafted metadata. Impact. Broken settle responses or log injection. Mitigations Tests Conformance runs. live-bazaar case header-bounded. Residual risk. None.

P8. Duplicate listings through URL spellings

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A seller or attacker lists one resource many times by varying case, ports, dot segments or percent-encoding. What Stellar makes different. A spelling variant would be a second key with no owner, escaping the binding to the payTo proven on chain (P2). Listings are keyed by the canonical URL per network (stellar:testnet, stellar:pubnet), so one resource has one owner per network. Preconditions. Settlements for the variant URLs. Impact. Duplicate results, and a second listing that escapes the owner binding of the first. Mitigations
  • URLs are canonicalised (case, default ports, dot segments, percent-encoding, query and fragment) before they key a listing. (packages/bazaar/src/url.ts, canonicalizeUrl)
Tests Residual risk. None.

P9. Planting a seller’s MCP tool listing

Mitigated · Spoofing, Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A payer pays a seller’s payTo one base unit (or settles one unit under an upto cap of any size) while echoing the seller’s MCP endpoint and tool name with its own description, input schema or price, hoping to publish, freeze or domain-verify that content under the seller’s identity, or to use up the seller’s quota of new listings. What Stellar makes different. The settlement proves a payment to payTo, not who wrote the echoed tool description. Dust costs the payer almost nothing and the sponsor pays the fee, so a settlement alone cannot vouch for content. Preconditions. A trustline and one base unit of the asset; the seller’s MCP endpoint and tool name. Impact. Spoofed tool descriptions (prompt injection) and prices shown to agents under the seller’s verified identity; the seller’s own tools not cataloged. Mitigations
  • A tool at an http(s) endpoint stays pending until the tool itself answers an unpaid tools/call with a PaymentRequired naming the owner; until an origin check has confirmed it, the tool must also offer the scheme, network, asset, payTo and price (cap) of a settlement for it, the one that created it or one its check keeps, or the listing is quarantined with origin_payment_mismatch. A later settlement never narrows what an earlier one proved. (packages/bazaar/src/catalog.ts, samePayment)
  • A later settlement the tool itself asked for is checked again and replaces planted content with the tool’s own answer to its listed call; a planted settlement can neither change nor withdraw a confirmed tool whose listed call answers with a PaymentRequired or fails for now. Once that call is answered without one, the first call a payer proposed, largest payments first, whose PaymentRequired lists the tool for its owner updates the tool with the tool’s own answer to that call, and the example that answer declares becomes the listed call (the payer’s arguments when the tool echoes them; the change then stays until that call is answered without a PaymentRequired). (packages/bazaar/src/catalog.ts, checkOrigins)
  • A check calls the tool as its listing describes first; the example arguments its settlements proposed are tried only when that call is answered without a PaymentRequired (a published tool whose listed call fails for now is retried instead), and only a PaymentRequired to them that lists the tool for its owner is used, so echoed arguments can confirm a tool but never withdraw it: only the listed call’s answer does. (packages/bazaar/src/catalog.ts, originAsker)
  • Domain trust is granted only to origin-verified listings, and needs the two-way SEP-1 binding. (packages/bazaar/src/catalog.ts, enrich)
  • The owner’s hourly quota is kept per origin, and only listings that origin confirmed for a settlement that paid the owner its price count toward it. (packages/store-postgres/src/catalog-store.ts, countCreatedBy)
Tests Conformance runs. live-bazaar case mcp-tool. Residual risk. Tools under an mcp:// URL (P10). A planted settlement can quarantine a tool that was never confirmed until the tool’s next real settlement. Once a published tool’s listed call is answered without a PaymentRequired (its arguments changed), the first call a payer proposed, largest payments first, whose PaymentRequired lists the tool for its owner updates it with the tool’s own answer to that call, which for a tool that prices by its arguments may differ from its answer to other calls.

P10. Unverifiable content of mcp:// tools

Accepted risk · Spoofing, Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A tool under an mcp:// URL names no server, so nothing but the settlement vouches for its description, schema and price; whoever first pays its owner for it chooses them. What Stellar makes different. As P9: a settlement proves the payment, not the content. Preconditions. One settlement of one base unit to the owner, before the tool’s first real settlement. Impact. A misleading description or price on the owner’s mcp:// tool listing. Mitigations
  • mcp:// tools are scoped to their owner and published at trust settled, which they never leave: no domain can vouch for them. (packages/bazaar/src/catalog.ts, verifiable)
  • The Rail402 SDK does not call mcp:// resources, and its default pubnet policy pays MCP listings only at domain_verified. (packages/sdk/src/policy/policy.ts, resolvePolicy)
Tests Residual risk. On testnet, the first content of an mcp:// tool is chosen by its first payer and kept, and such tools, counted apart, can fill their half of the network’s quota and room. Sellers who want their own content listed serve their tools at an http(s) endpoint. Pubnet refuses mcp:// tools (P11).

P11. Buyer-written mcp:// tools on pubnet

Mitigated · Spoofing, Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A tool under an mcp:// URL would be published at once with content chosen by whoever first pays its owner one base unit; on pubnet that content reaches agents paying real money. What Stellar makes different. A pubnet settlement of one base unit with a sponsored fee costs the attacker almost nothing. Preconditions. One pubnet settlement to the owner carrying a bazaar extension for an mcp:// tool. Impact. Without protection: an impostor tool description or price shown to pubnet buyers. Mitigations
  • Pubnet refuses mcp:// tools before any write with bazaar_resource_unverifiable, at /verify and /settle, reported in EXTENSION-RESPONSES; MCP tools at an https endpoint are cataloged through their origin check. (packages/bazaar/src/catalog.ts, refusal)
  • Pubnet rules cannot be loosened: PUBNET_BAZAAR_ORIGINLESS_MCP accepts only refuse, and the catalog refuses on pubnet whatever it is given. (packages/bazaar/src/policy.ts, catalogRulesFor)
  • An optional minimum settled amount per asset and network makes each pubnet listing cost what the operator chooses. (apps/rail402/src/discovery-config.ts, parseMinimums)
Tests Residual risk. None on pubnet; testnet keeps P10.

P12. A token named USDC treated as US dollars

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. A dollar price filter that recognised US-dollar assets by symbol would treat any accepted token whose symbol is USDC as dollars, so a listing priced in a worthless token would match a buyer’s dollar ceiling. What Stellar makes different. Asset symbols are not unique on Stellar; only the issuer, or the contract address, identifies a token. Preconditions. An operator accepts a second token that uses a dollar stablecoin’s symbol. Impact. Without protection: search results that misstate what a buyer pays in dollars. Mitigations Tests Residual risk. A seller can still price its own resource as it likes.

P13. Pre-empting a pubnet seller’s listing

Mitigated · Spoofing · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. An attacker pays a known seller’s payTo first, with echoed metadata, to plant a pending listing or burn that owner’s hourly quota before the seller lists, for example with listings on its own host that answers a 402 naming the seller’s payTo, or that it hands over to the seller. What Stellar makes different. Anyone can pay any account that can receive the asset. Preconditions. One settlement per planted listing to the seller’s payTo. Impact. Without protection: the seller’s own listings refused for the hour, or planted content shown. Mitigations
  • A pending listing is never listed or searched until its origin names the payTo; its public detail and history show its state and settled payment but withhold the metadata the payer echoed. Only listings the owner’s origin confirmed count toward its quota, and the network-wide quota counts published listings only, when they are first published. (packages/bazaar/src/wire.ts, withheldContent)
  • The owner’s quota is kept per origin (scheme, host and port), so listings an attacker’s host confirms for the payTo count only at that host and never against the seller’s own origins. (packages/bazaar/src/store.ts, resourceOrigin)
  • A listing counts toward its owner’s quota only once its origin confirmed a settlement that paid the owner its price there (for upto, the whole cap), and never after an ownership transfer; none is charged past the quota, and one that would be waits to be published. Dust payments for spellings of a seller’s route that its server answers alike (case, repeated or trailing slashes), and listings handed over to the seller, cannot use up its quota. (packages/bazaar/src/catalog.ts, quotaCharge)
  • Quotas are kept per network, so testnet payments never burn a seller’s pubnet quota. (packages/bazaar/src/catalog.ts, budgetFor)
Tests Residual risk. An attacker can delay an owner’s listing by one origin check; claims are kept, so paying again does not extend the delay. A party that pays a seller its full price for each of the quota’s listings in an hour, for example for spellings of one route the seller’s server answers alike, still uses up the seller’s quota at that origin: that is buying from the seller, and each spelling is listed separately. One host shared by several sellers is one origin, so a tenant that sets its own routes’ payTo can do the same there at its own price.

P14. Origin checks reflected at third-party hosts and trust shown across networks

Mitigated · Denial of service, Spoofing · boundary TB5 (Facilitator and the open internet) · asset: Catalog and search integrity Threat. A per-process origin-check budget lets testnet payments make the service send requests to public hosts at pubnet’s expense; an item-level trust that is the maximum over networks lets a pubnet buyer read trust earned on testnet; and a settlement count summed over networks shows free testnet settlements next to a pubnet offer. What Stellar makes different. Trust is proved per network: a home_domain and a settlement exist on one network only. Preconditions. Listings for one resource on both networks, or many testnet listings on one host. Impact. Without protection: pubnet origin checks delayed by testnet traffic; a pubnet listing shown as domain_verified on testnet’s proof. Mitigations
  • Origin requests per host are budgeted per network. (packages/bazaar/src/catalog.ts, spendHostBudget)
  • Origin checks are claimed and run in one lane per network, a bounded number at a time; a network whose lane is busy is skipped, so unanswering testnet hosts never delay pubnet checks. (packages/bazaar/src/catalog.ts, checkOrigins)
  • An item shows the weakest of its listings’ trust, and with a network filter that network’s listing only. (packages/bazaar/src/wire.ts, trustFor)
  • An item’s settlement count is the fewest of its listings’, never a sum across networks; each network’s count is shown on its own listing. (packages/bazaar/src/wire.ts, settlementsFor)
Tests Residual risk. Testnet still causes bounded outbound requests.

P15. A payer decides whether a seller’s usage is published

Mitigated · Tampering, Information disclosure · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. The private-usage opt-out is read from the payload a buyer echoes. For a listing no origin confirms, such as a tool under an mcp:// URL, the first payer’s echo would decide it for good: leaving the key out publishes every later payer of a seller that opted out; adding it hides a seller’s usage. What Stellar makes different. A testnet settlement costs nothing, and the smallest pubnet one almost nothing. Preconditions. One settlement to the seller whose payload omits or adds rail402-private-usage. Impact. Without protection: payer addresses, transactions and amounts of a seller that opted out published by the usage routes and the Explorer. Mitigations
  • Usage is never published for a listing whose content no origin confirmed (trust settled): the usage routes answer discovery_usage_private or leave it out, whatever its first payer echoed. The rule is applied at read time, so listings cataloged before it are covered without changing their data. (packages/bazaar/src/store.ts, export function usageVisible)
  • The same rule in the Postgres store’s usage queries. (packages/store-postgres/src/catalog-store.ts, const PRIVATE_USAGE)
  • The opt-out ratchets one way: a settlement whose payload declares it makes the usage private at once and asks the origin to confirm; nothing a payer sends removes it, only the origin’s own 402 does. (packages/bazaar/src/catalog.ts, const ratchet)
Tests Residual risk. A payer can still hide an origin-confirmed listing’s usage until its origin check runs again; that fails private, never public.

P16. The usage routes publish what each payer bought

Mitigated · Information disclosure · boundary TB2 (Seller and facilitator) · asset: Payer privacy Threat. The usage routes link settlements, and with them payer addresses, to the listings they paid for, keylessly; an explorer caching them shows each payer’s purchases labelled by resource. On pubnet these are real customers’ purchase histories. What Stellar makes different. Payments are public on chain, but name only payer, payTo and amount; the resource bought is known only to the seller and the catalog. Preconditions. Any reader of the public discovery routes. Impact. Without protection: a pubnet payer’s purchases published by resource, without the payer’s consent. Mitigations
  • Each network publishes either settlement links or counts only (<NET>_BAZAAR_USAGE_DETAIL); pubnet defaults to counts: /discovery/settlements links nothing and a listing’s usage lists no settlement or payer. (apps/rail402/src/discovery.ts, export function defaultUsageDetail)
  • The setting is read per network, so testnet’s never applies to pubnet. (apps/rail402/src/discovery-config.ts, BAZAAR_USAGE_DETAIL)
  • The Explorer shows a payment’s ‘paid for’ only from the Bazaar’s links, so with counts it labels no pubnet payment and says the network publishes counts only. (apps/explorer/src/web/pages/resource.ts, links no payment, and no payer, to a listing)
  • The other public routes keep the same promise: a listing’s version history names no settlement transaction while its usage is private or its network publishes counts only, and a private listing shows no lastSettled. (packages/bazaar/src/wire.ts, export function toVersionItem)
Tests Residual risk. An operator can set PUBNET_BAZAAR_USAGE_DETAIL=settlements; counts and dates stay public and can still be matched to a seller’s few on-chain payments. Testnet publishes links by default. A private listing’s settlement count stays public; polling it shows when the listing was bought.

SSRF

Cataloging makes the facilitator fetch URLs that sellers choose, and paying makes an agent fetch URLs that a listing or a prompt suggests. Both run through a fetch that resolves the host itself, refuses non-public addresses at dial time, follows no redirect it has not re-checked, and caps sizes and times.

X1. Origin checks to private or metadata addresses

Mitigated · Information disclosure, Elevation of privilege · boundary TB5 (Facilitator and the open internet) · asset: Operator infrastructure Threat. A listing’s resource URL points at a private, loopback, link-local or cloud metadata address, so the catalog’s origin check reaches the operator’s internal network. What Stellar makes different. Cataloging runs after any settlement, so anyone who can pay a cent can make the facilitator fetch a URL. Preconditions. One settlement with a crafted resource URL. Impact. Requests from the facilitator’s network position; internal data in listing metadata. Mitigations
  • Hosts are resolved and every address checked against a block list at dial time, IP literals before any lookup. (packages/bazaar/src/origin.ts, safeLookup)
  • Private and loopback addresses are refused unless DISCOVERY_ALLOW_LOOPBACK is set, which is refused together with pubnet. (apps/rail402/src/config.ts, DISCOVERY_ALLOW_LOOPBACK)
Tests Residual risk. None known. The RPC URL is operator configuration and trusted.

X2. DNS rebinding

Mitigated · Information disclosure, Elevation of privilege · boundary TB5 (Facilitator and the open internet) · asset: Operator infrastructure Threat. A hostname answers with a public address when checked and a private one when connected. What Stellar makes different. The SEP-1 domain check fetches stellar.toml from a host the seller names, so a seller’s own DNS zone is the natural rebinding vector. That fetch uses the same pinned lookup as origin checks. Preconditions. Control of a DNS zone. Impact. As X1. Mitigations
  • The address that is checked is the address that is dialled: the lookup used by the connection validates every answer. (packages/safe-fetch/src/lookup.ts, pinnedLookup)
Tests Residual risk. None.

X3. Redirects to internal hosts

Mitigated · Information disclosure, Elevation of privilege · boundary TB5 (Facilitator and the open internet) · asset: Operator infrastructure Threat. A public origin answers with a redirect to a private address. What Stellar makes different. Rail402 reads stellar.toml only from the listing’s own host and follows no redirect for it, so a seller cannot point the SEP-1 check at an internal address. Preconditions. Control of a public origin. Impact. As X1. Mitigations
  • Origin checks and SEP-1 fetches follow no redirects; buyers follow only same-origin redirects, re-checking each hop, and none after paying. (packages/safe-fetch/src/redirect.ts, nextHop)
Tests Conformance runs. rejection-audit case mcp-redirect-private. Residual risk. None.

X4. Oversized or slow answers

Mitigated · Denial of service · boundary TB5 (Facilitator and the open internet) · asset: Availability Threat. An origin answers with a huge, compressed or endless body, or holds connections open by trickling bytes or by never reading the request body. What Stellar makes different. SEP-1 limits stellar.toml to 100 KB; Rail402 enforces that limit on the decoded file. Preconditions. Control of an origin. Impact. Memory exhaustion or stalled workers. Mitigations
  • Body and header caps apply after decoding, with header, idle and total timeouts. (packages/safe-fetch/src/limits.ts, DEFAULT_LIMITS)
  • A body safe-fetch does not return (a redirect’s, refused or followed, or a 205’s) is never read: unless it arrived whole with the headers and the whole request was sent, its connection is closed at once and never returns to the pool, so an endless redirect body cannot hold a connection past the request. (packages/safe-fetch/src/fetch.ts, function discard)
  • An answer that ends before the server took the whole request body closes its connection, instead of leaving it, with no timeout, to an upload the server may never read. (packages/safe-fetch/src/fetch.ts, Such a connection cannot be reused: close it.)
  • Nothing past the end of a compressed body is read: an answer that goes on after it (bytes after a deflate or br stream, gzip padding) closes its connection once the body is read, so those bytes are neither left uncounted nor watched only by an idle timeout they keep resetting. (packages/safe-fetch/src/fetch.ts, connection unless the answer itself has ended)
  • Origin checks close the connection as soon as the response headers arrive and never read a body; stellar.toml reads keep one deadline through the whole body and close the socket on every outcome. (packages/bazaar/src/origin.ts, close the connection now)
Tests Residual risk. None.

X5. stellar.toml fetches

Mitigated · Information disclosure · boundary TB5 (Facilitator and the open internet) · asset: Operator infrastructure Threat. The domain check fetches /.well-known/stellar.toml from a host the seller chose. What Stellar makes different. SEP-1 lets a domain claim Stellar accounts; Rail402 reads ACCOUNTS, and the owner’s home_domain, to raise an origin-verified listing’s trust to domain_verified only when both name each other, which means fetching from the seller’s host. Preconditions. One listed resource. Impact. As X1. Mitigations Tests Residual risk. None.

X6. Paid calls to agent-chosen URLs

Mitigated · Information disclosure, Elevation of privilege · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. An agent, possibly steered by text in a listing, asks pay_and_call (or the SDK or CLI) to call a private address, sending a payment or the agent’s request there. What Stellar makes different. None: the buyer’s egress runs on the agent’s machine. Preconditions. An agent that follows URLs from untrusted content. Impact. Requests to the agent’s internal network, with a payment header attached. Mitigations
  • Every buyer request goes through safe-fetch: public destinations only, the address pinned at dial time, redirects re-checked. (packages/safe-fetch/src/fetch.ts, createSafeFetch)
Tests Conformance runs. rejection-audit case mcp-private-address. Residual risk. None.

Smart accounts

A C… payer is a contract account whose __check_auth decides whether a payment is authorized. Nothing about it can be checked offline: only executing it tells, and its answer can change between simulation and inclusion. Rail402 simulates in enforcing mode at verify and again at settle; policy composition with upto is proved in contract tests with OpenZeppelin smart accounts.

A1. A payment signed by a key the account does not accept

Mitigated · Spoofing · boundary TB7 (Contracts) · asset: Payer funds Threat. Someone signs a C-account payment with a key that is not one of the smart account’s signers. What Stellar makes different. A contract account authorizes through its own __check_auth; only executing it can tell whether a signature is valid. There is no signature a facilitator could check offline. Preconditions. Knowledge of the smart account’s address. Impact. None if detected; the account’s __check_auth refuses. Mitigations
  • Verify and settle both run an enforcing simulation, which executes __check_auth; a refusal is named smart_account_rejected. (packages/stellar/src/diagnostics.ts, classifyTransferFailure)
Tests Conformance runs. live-matrix case c-payer-wrong-key, rejection-audit case upto-c-payer-wrong-key. Residual risk. None.

A2. __check_auth that passes simulation and fails at apply

Accepted risk · Denial of service · boundary TB7 (Contracts) · asset: Sponsor XLM Threat. A smart account whose __check_auth depends on state it can change (a nonce, a time, a policy budget) passes simulation and fails at inclusion, deliberately. What Stellar makes different. __check_auth is arbitrary contract code. Its result at apply time can differ from simulation, and the included, failed transaction’s fee is the sponsor’s. Preconditions. A smart account the attacker controls. Impact. One wasted sponsor fee per payment. Mitigations
  • The simulation is repeated at settle, so state changed before settle is caught. (packages/facilitator/src/scheme.ts, settle)
  • Wasted fees are metered; the hourly budget bounds the total. Since a smart account can accept the same authorization later, the settlement answers the failure only once the authorization expired unused, and a copy landed meanwhile as settled (F2). (packages/facilitator/src/guard.ts, SponsorBudget)
Tests Residual risk. Like S1, the race within one ledger cannot be closed. A per-payer limit on on-chain failures is not built; the hourly budget is the bound.

A3. Policy events refuse exact payments from policy accounts

Accepted risk · Denial of service · boundary TB7 (Contracts) · asset: Availability Threat. A smart account with a policy that emits its own events (such as a spending limit recording a spend) pays with exact. What Stellar makes different. The upstream @x402/stellar exact verifier accepts only the token’s transfer event in the simulation and refuses any other contract event as invalid_exact_stellar_payload_event_not_transfer. The upto verifier accepts events other than balance changes, so policy events do not refuse upto payments. Preconditions. A payer whose __check_auth publishes events. Impact. Such accounts cannot pay with exact through any facilitator built on the upstream verifier; nothing moves and the sponsor pays nothing. Mitigations Tests. None: this is a documented limit, not a behaviour Rail402 implements. Residual risk. An upstream limit of the exact scheme; it fails closed. Policy accounts pay with upto.

A4. A spending limit that does not cover upto

Mitigated · Elevation of privilege · boundary TB7 (Contracts) · asset: Agent budgets Threat. An agent key constrained by a spending-limit policy pays with upto, whose settlement reaches the account as an approve rather than a transfer, and slips past a limit that only counts transfers. What Stellar makes different. The upto contract spends through approve(payer, contract, cap, expiration) and transfer_from, so the account’s __check_auth sees an approve context for the full cap. Preconditions. A smart account whose policy budgets transfer only. Impact. Spending beyond the account owner’s budget. Mitigations Tests Conformance runs. live-matrix case upto-c-over-limit. Residual risk. OpenZeppelin’s stock spending-limit policy refuses the approve context outright; accounts that use it cannot pay with upto.

A5. Bypassing the policy through the Default rule

Mitigated · Elevation of privilege · boundary TB7 (Contracts) · asset: Agent budgets Threat. An agent key picks a context rule without the spending policy (the Default rule, or the policy-free upto rule for the approve), or a relayer moves a signed payment to another rule. What Stellar makes different. In OpenZeppelin smart accounts the signer chooses the rule per context, so a key that appears on a rule without the policy can spend without it. Preconditions. An agent key listed on a rule without the policy. Impact. Spending beyond the budget. Mitigations
  • The documented rule configuration keeps the agent key off every rule without the policy, and the signature covers the rule ids. (contracts/testing/README.md, Rule configuration for an agent key)
Tests Residual risk. Depends on the account owner configuring rules as documented.

A6. Concurrent payments beyond the account’s own budget

Accepted risk · Denial of service · boundary TB7 (Contracts) · asset: Sponsor XLM Threat. Several payments from one policy account are verified at once; together they exceed the account’s budget, and the later ones fail at apply. What Stellar makes different. The policy’s budget is on-chain state updated at apply time; simulations of concurrent payments each see the budget before the others. Preconditions. A policy account paying several sellers at once. Impact. Wasted sponsor fees for the payments that fail. Mitigations Tests Residual risk. As S1.

MCP paid calls

rail402-mcp, the SDK and the CLI hold a signing key on the agent’s side. The threats are about the agent’s money: paying more than allowed, paying the wrong party, leaking the key, paying twice, and following URLs it should not.

M1. An agent spends beyond its caps

Mitigated · Elevation of privilege · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. A model, a prompt injection or a bug makes an agent pay more per call or per session than its owner allowed, including through many concurrent calls or several processes. What Stellar makes different. A signed authorization is spendable by whoever holds it until it expires, so the cap must be enforced before signing, not after. Preconditions. An agent with a signing key and a budget. Impact. Loss of the agent owner’s funds up to the key’s balance. Mitigations
  • A guarded signer checks the per-call cap and reserves the session budget immediately before signing, and signs only the payment it approved. (packages/sdk/src/policy/guard.ts, createGuardedSigner)
  • The budget ledger reserves atomically, also across processes sharing one SQLite file. (packages/sdk/src/policy/ledger.ts, checkReservation)
Tests Conformance runs. rejection-audit case mcp-per-call-cap, rejection-audit case mcp-over-ceiling. Residual risk. The caps bound the loss; anything within them the agent may spend.

M2. Payments on networks, assets or to recipients not allowed

Mitigated · Elevation of privilege · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. A seller’s 402 asks for another network, another asset, or a recipient outside the allow list. What Stellar makes different. Assets are contracts; the same symbol can be issued by anyone. The policy therefore compares contract ids and network passphrases, not symbols. Preconditions. A seller offering unexpected terms. Impact. Payment in the wrong asset or to the wrong party. Mitigations
  • Spend decisions check the network in the signed preimage, the asset contract and the recipient against the policy. (packages/sdk/src/policy/decide.ts, decideSpend)
Tests Conformance runs. rejection-audit case mcp-network-not-permitted, rejection-audit case mcp-asset-not-permitted, rejection-audit case mcp-recipient-not-permitted. Residual risk. None.

M3. Secrets in tool schemas, results, errors or logs

Mitigated · Information disclosure · boundary TB6 (Agent, MCP server and paid URLs) · asset: Secrets Threat. The signing seed, its raw bytes, a signature or a payment header leaks into an MCP tool schema, a tool result, a protocol error, a log line, the budget ledger or the CLI’s output. What Stellar makes different. A Stellar seed (S…) or its 32 raw bytes is the whole key; a leaked signed authorization is spendable until it expires. Preconditions. Any error or log path that echoes inputs, or a seller that echoes the payment into its answer. Impact. Loss of the agent’s funds. Mitigations
  • Errors and results are redacted and sanitised; loggers redact secret-like fields. (packages/sdk/src/redact.ts, redactDeep)
  • Tool schemas are published without secret-like properties or header mirroring. (packages/mcp/src/schemas.ts, publishedSchema)
  • A seller that echoes its request cannot hand the payment back: a paid answer is returned and stored with the call’s payment header, payload, signed entries and signatures replaced. (packages/sdk/src/flow/scrub.ts, scrubOutcome)
Tests Residual risk. The key lives in the agent’s process; a compromised host is out of scope.

M4. A retry pays twice

Mitigated · Tampering · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. An agent retries a paid call after a timeout or crash and pays again for the same work. What Stellar makes different. Each new authorization carries a fresh nonce, so a retry signed anew is a second payment. Preconditions. A retried tool call. Impact. Double payment. Mitigations
  • Calls carry an idempotency key; a repeated key replays the stored outcome without signing, and the payment identifier travels to the seller. The key belongs to the payer on its network, not to a budget window: the ledger checks it across every window and session of the payer inside its atomic reserve, so a retry after a renewal or a new session never signs again. The payment identifier is chosen at random the first time a key pays a resource and kept with the key, so it stays the same for the call and cannot be worked out from the payer and a guessable key. The SQLite ledger that keeps keys this way is schema version 3, which earlier versions (that check keys per window) refuse to open. (packages/sdk/src/flow/common.ts, replayStored)
  • A repeated key first reconciles its own payment on chain: it reports a consumed authorization as paid, and frees the key for a new payment only once the chain shows the authorization expired unused. (packages/sdk/src/flow/common.ts, replayStored)
Tests Residual risk. A retry without the same key is a new payment by design. The in-memory ledger forgets keys when its process exits, and the browser storage ledger drops a key with its window once that window ended seven days ago and all its payments are resolved on chain.

M5. Prompt-injected listings and bait-and-switch sellers

Accepted risk · Spoofing, Tampering · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. A listing’s text steers the agent, or the seller’s live 402 asks for a different recipient or a higher price than its listing. What Stellar makes different. The listing’s payTo is the account the facilitator saw settled; the live 402 is not bound to it unless the buyer checks. Preconditions. A malicious or changed seller. Impact. Payment to an unexpected party or at an unexpected price. Mitigations Tests Residual risk. An agent still reads seller-controlled text; the caps (M1) bound what it can spend.

M6. A tampered payment or a false settlement report

Mitigated · Tampering, Repudiation · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. A scheme client changes the payload after the guard approved it, or a seller reports a settlement that did not happen, reports another payment’s transaction hash, or settles through its own contract so the transaction does not look like a direct settlement. What Stellar makes different. The host records every authorization nonce it consumes in a temporary ledger entry keyed by the payer and the nonce, and only the entry the payer signed can consume it. A transaction used a payment’s authorization exactly when it carries the payer’s entry with that payment’s nonce and its meta creates that nonce entry, whatever its call path: Soroban matches an entry below the top-level call, so a wrapper, router or batch contract can settle it too, and one transaction can consume several nonces. A transfer event alone says nothing about which authorization moved the money. Preconditions. A malicious scheme client or seller. Impact. Paying for something else, believing a payment failed or succeeded wrongly, or a session budget that under-counts what moved. Mitigations
  • The guard compares the payload with what it signed. (packages/sdk/src/policy/guard.ts, checkGuardedPayload)
  • A payment is proven only by its own nonce: a transaction that consumed it settles the reservation whatever its shape, for the exact price, or for upto the amount the signed settlement contract recorded for the signed terms (the whole cap when that cannot be read). A consumed authorization is never released. (packages/sdk/src/policy/proof.ts, reservationSettlement)
  • A reported hash is only a claim against the payment it was reported for and counts as spent; it never removes a transaction from another payment’s proof. Budget returns only when the authorization has expired and no transaction in its validity range consumed it. (packages/sdk/src/policy/reconcile.ts, reconcile)
  • An expired payment the RPC can no longer prove either way counts as spent at its whole amount and is no longer reconciled. (packages/sdk/src/sqlite/ledger.ts, markUnprovable)
Tests Residual risk. A payment that is not reconciled before the RPC’s retention ends counts as spent in full, even if it never moved money.

M7. Another local process drives the MCP server over HTTP

Mitigated · Spoofing, Elevation of privilege · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. A web page (DNS rebinding) or another local process reaches the MCP server’s HTTP transport and spends through its tools. What Stellar makes different. The MCP server holds the agent’s Stellar signing key. Any caller that reaches its tools can make it sign Soroban authorization entries, bounded only by its per-call and session caps (M1) and its network, asset and recipient allow lists (M2); keeping other callers out is what keeps that key the agent’s. Preconditions. The HTTP transport enabled. Impact. Spending by an unauthorised caller, within the caps. Mitigations
  • The HTTP transport listens on loopback, requires a bearer token and refuses foreign Host and Origin headers. (packages/mcp/src/http.ts, hostHeaderValidationResponse)
Tests Residual risk. None; stdio is the default transport.

M8. A pubnet budget that renews forever or resets, or caps set too high

Mitigated · Elevation of privilege · boundary TB6 (Agent, MCP server and paid URLs) · asset: Agent budgets Threat. The default budget window renews when it expires, so a looping or prompt-injected agent spends its full budget every day with no end; or an owner configures caps far above what an agent should ever pay with real funds. What Stellar makes different. Every pubnet payment moves real USDC from the agent’s account under a Soroban authorization the agent signs on its own; nothing on chain limits how often a funded key signs. Preconditions. An agent with a pubnet key runs unattended for longer than one budget window, or its caps were set carelessly. Impact. Real funds spent beyond what the owner meant, one window after another. Mitigations
  • On pubnet the default budget window does not renew; renewal is an explicit choice (autoRenew, RAIL402_SESSION_AUTO_RENEW). (packages/sdk/src/policy/budget.ts, DEFAULT_SESSION)
  • Pubnet USDC caps above 1 USDC per call or 10 USDC per window, and caps on any other pubnet asset (which has no built-in ceiling), are refused unless larger caps are allowed explicitly (allowLargeCaps, RAIL402_ALLOW_LARGE_CAPS). (packages/sdk/src/policy/policy.ts, PUBNET_CAP_CEILINGS)
  • A pubnet buyer with a key keeps its budget in the persistent SQLite store: RAIL402_BUDGET_STORE=memory is refused there, since every process start and every restart of rail402-mcp would open a fresh window with the full budget. (packages/sdk/src/config.ts, resolveAgentConfig)
Tests Residual risk. Within one window, and within the caps, an agent may spend its whole budget. A program that builds a buyer in code chooses its own ledger; the SDK’s default is in memory.

M9. A pubnet payment is signed without a human, or an approval covers more than it showed

Mitigated · Elevation of privilege, Spoofing · boundary TB6 (Agent, MCP server and paid URLs) · asset: Payer funds Threat. An agent, steered by listing text or a prompt, makes a real-money payment with nobody confirming the network, recipient and amount; or it reuses one approval to pay other recipients or listings, or shows the person a resource text that hides what is really paid. What Stellar makes different. The buyer signs a Soroban authorization entry that lets the facilitator move the stated amount to payTo; once signed and settled, the transfer is final. Preconditions. A pubnet key configured in the SDK, CLI or MCP server. Impact. A real payment the owner never saw. Mitigations
  • A pubnet buyer with a signer must choose how payments are confirmed: a confirm function (SDK), a form elicitation through the MCP client or RAIL402_MCP_CONFIRM=never for headless agents (MCP server). Under first-per-session an approval covers only the window, recipient base account, listing (or resource without one), asset, scheme and settlement authority it was shown for; any other one is asked about again. A declined or unavailable confirmation signs and reserves nothing. (packages/sdk/src/confirm.ts, createConfirmationGate)
  • Every prompt says what approving covers: this payment only, or that recipient and listing again without asking, up to the per-call cap and the budget left, until the window ends. It shows the listing and the upto settlement authority, and untrusted fields stay on one line without control, line-break or bidirectional characters; an MCP endpoint whose raw text carries them is refused (egress_url_invalid), and the normalized URL is what is confirmed and reserved. (packages/mcp/src/confirmation.ts, confirmationMessage)
  • The sealed MCP intent binds the listing, the upto settlement authority and the budget window with the network, scheme, asset, recipient, resource and amount, so a retry that names another authority or listing, or whose payment falls in another window (it renewed, or the session was restarted, while the person decided), is asked about again with that window’s end and budget. (packages/mcp/src/confirmation.ts, covers)
  • An MCP confirmation’s request state carries a single-use id and a digest of the exact tool call it was asked for: a replayed approval is refused with rpc_confirmation_used, one reused for other arguments or another tool with rpc_confirmation_mismatch, and a forged or expired state fails its MAC check; so under RAIL402_MCP_CONFIRM=every one approval signs at most one payment. (packages/mcp/src/server.ts, UsedConfirmations)
  • No helper defaults a pubnet buyer to never asking: openBuyer (CLI) and openConfiguredBuyer (MCP) pass no confirmation policy unless given one, so the SDK refuses a pubnet buyer with a key until the caller chooses. (packages/mcp/src/runtime.ts, openConfiguredBuyer)
  • The CLI asks on the terminal before a pubnet payment (each process is its own buyer, so each pay or purchase asks), or takes —yes. This protects a person at the terminal from mistakes; it is not a control against an agent that can run the CLI, which can pass —yes or answer its own terminal. Agents get confirmation through rail402-mcp’s elicitation, which the MCP client shows to the person, and are otherwise bounded by caps, tagged keys and the policy. (packages/cli/src/commands/common.ts, paymentConfirmation)
Tests Residual risk. Headless agents that turn confirmation off rely on their caps (M1, M8). Under first-per-session, later payments to an approved recipient and listing in the same window are not asked about again; RAIL402_MCP_CONFIRM=every asks for each. The MCP client is trusted to show the form to a person and to report the answer honestly. The CLI confirmation guards a person, not an agent that runs the CLI.

M10. A testnet key used on pubnet, or a key for the wrong network

Mitigated · Information disclosure, Elevation of privilege · boundary TB6 (Agent, MCP server and paid URLs) · asset: Secrets Threat. A key handled as a throwaway testnet key (in examples, shell history, Playground exports) pays on pubnet, or a server meant for one network is given the other network’s key. What Stellar makes different. A Stellar seed is a valid key on every network, so nothing in the key itself says which network it belongs to. Preconditions. A key file or a seed in the environment, and a pubnet configuration. Impact. Real funds paid with a key that was never protected as a real-money key. Mitigations
  • Key files carry a network tag (rail402 keys new/import write it); a file tagged for another network is refused, pubnet refuses untagged files unless explicitly allowed, and a seed in RAIL402_SECRET_KEY is never used on pubnet. (packages/sdk/src/keys.ts, checkKeyNetwork)
  • The Playground’s key download is a key file tagged for testnet, and rail402 keys import reads a tagged file and refuses a tag for another network (key_network_mismatch), so a browser key never becomes a pubnet key unseen. (packages/cli/src/commands/keys.ts, imported)
Tests Residual risk. An owner can retag a key file by hand, or import a bare seed for any network.

M11. An agent pointed at an impostor Bazaar or MCP endpoint

Accepted risk · Spoofing · boundary TB6 (Agent, MCP server and paid URLs) · asset: Payer funds Threat. An agent is configured, or talked into using, a hostile catalog or discovery endpoint that lists attacker recipients at plausible prices. What Stellar makes different. A listing names the payTo a payment authorization will credit; whoever controls the catalog chooses which Stellar accounts an agent is shown. Preconditions. A buyer configured with an untrusted Bazaar URL, or an agent that follows listing IDs from an untrusted discovery endpoint. Impact. Payments to an attacker’s account, within the caps. Mitigations
  • Pubnet needs an explicit https Bazaar URL; the hosted endpoint never pays, so a listing found anywhere is paid only through the buyer’s own Bazaar, whose live 402 must match the listing’s owner and price (M5). (packages/sdk/src/config.ts, resolveAgentConfig)
  • A pubnet buyer built in code gets the same rule: createBuyer and createBrowserBuyer refuse a Bazaar or facilitator URL that is not https, carries credentials, or names an IP address, localhost, a single label or a private-network suffix (payment_policy_invalid). (packages/sdk/src/buyer-core.ts, pubnetEndpointRefusal)
Tests Residual risk. A user who configures a hostile catalog trusts it. Mitigated · Tampering, Spoofing · boundary TB6 (Agent, MCP server and paid URLs) · asset: Payer funds Threat. A transaction or account link opens the other network’s explorer, or an operator template points somewhere unexpected, so a user checks a payment against the wrong record. What Stellar makes different. The same account address exists on testnet and pubnet; only the network in the link says which ledger a user is looking at. Preconditions. A receipt, CLI output or Playground page showing an explorer link. Impact. A user believes a payment happened, or did not, on the wrong network. Mitigations
  • Links are built per network by the SDK’s explorer provider (stellar.expert, the Rail402 Explorer or validated https templates with {network}/{networkPath}); account links come from the provider, never from rewriting a transaction template, and the Playground uses the same functions. (packages/sdk/src/explorer.ts, explorerAccountUrl)
  • createBuyer and createBrowserBuyer validate a provider passed in code with the same rules as a configured one (https only, no credentials, the right placeholders). (packages/sdk/src/buyer-core.ts, assembleBuyer)
Tests Residual risk. None.

M13. A seller names its own settlement authority for a pubnet upto payment

Mitigated · Tampering, Elevation of privilege · boundary TB6 (Agent, MCP server and paid URLs) · asset: Payer funds Threat. A seller puts a key it controls in an upto option’s extra.facilitatorAddress, so it can settle the full cap whatever the call used, or switches the authority between the confirmation and the signature. What Stellar makes different. An upto authorization lets the named settlement authority move up to the cap through the pinned upto contract; whoever holds that authority decides how much of the cap is settled. Preconditions. A pubnet buyer with upto enabled (an explicit pinned upto contract). Impact. The full cap is charged for a call that used less, within the caps the user approved. Mitigations
  • On pubnet a buyer that can sign upto pins the authorities it accepts: the policy’s uptoFacilitators (RAIL402_UPTO_FACILITATORS), or else the facilitatorAddress values its facilitator advertises for upto on pubnet in /supported, read once when the buyer is created; without either it refuses to open (payment_policy_invalid). Any other authority is refused before signing. (packages/sdk/src/buyer-core.ts, pinUptoAuthorities)
  • The authority is shown in the MCP and CLI prompts and bound in the sealed MCP intent, so a different authority on the retry is asked about again. (packages/mcp/src/confirmation.ts, covers)
Tests Residual risk. The pinned facilitator is trusted to settle only what was used; a buyer created before the facilitator rotates its authority keeps the earlier set until it is created again. Testnet accepts any authority other than the payer and the recipient.

The upto contract

With upto the payer signs a cap, and the settlement authority named in the terms chooses the amount at settlement. The contract x402-upto-stellar has no admin, no storage and no upgrade path; the payer’s signature covers the terms and an approve of the cap to the contract, and the authority’s authorization covers the amount.

U1. Settling more than the cap

Mitigated · Tampering, Elevation of privilege · boundary TB7 (Contracts) · asset: Payer funds Threat. The settlement authority, a bug or a hostile seller settles an amount above the cap the payer signed. What Stellar makes different. The payer’s signature covers approve(payer, contract, max_amount, expiration_ledger); the token would refuse a transfer_from above the allowance, and the contract refuses first. Preconditions. Control of the settle arguments. Impact. None: refused. Mitigations Tests Conformance runs. live-matrix case upto-over-cap, rejection-audit case upto-settle-over-cap. Residual risk. None.

U2. Changing the recipient, token, expiry, nonce or tree

Mitigated · Tampering · boundary TB7 (Contracts) · asset: Payer funds Threat. The terms or the authorization tree are changed after signing: another recipient, token, facilitator, expiration, nonce or an extra sub-invocation. What Stellar makes different. Every term is an argument of the signed settle(terms) root invocation and of its approve child; the host checks the signature over the whole tree, and the network id and nonce are in the preimage. Preconditions. A copy of the payload. Impact. None: signature verification fails. Mitigations
  • The facilitator checks every bound field and the exact tree shape before simulating; the host rejects any change the facilitator missed. (packages/upto/src/authorization.ts, inspectUptoAuthorization)
Tests Conformance runs. rejection-audit case upto-wrong-recipient, rejection-audit case upto-wrong-asset, rejection-audit case upto-authorization-tree, rejection-audit case upto-forged-terms. Residual risk. None.

U3. Settling one authorization twice

Mitigated · Tampering · boundary TB7 (Contracts) · asset: Payer funds Threat. The same upto authorization is settled twice, for the same or different amounts. What Stellar makes different. The payer’s entry nonce is consumed by the host on first use and kept until the signature expires; a failed settlement rolls the nonce back. Preconditions. A copy of the payload and the authority. Impact. None: the second use fails with Error(Auth, ExistingValue); Rail402 answers repeats from its ledger. Mitigations Tests Conformance runs. live-matrix case upto-repeat-different-amount, rejection-audit case upto-replay, live-matrix case upto-concurrent-same-authorization. Residual risk. None.

U4. Settling with an authority the payer did not name

Mitigated · Spoofing, Elevation of privilege · boundary TB7 (Contracts) · asset: Payer funds Threat. A facilitator, or anyone, settles an upto payment that named another settlement authority. What Stellar makes different. terms.facilitator is part of the signed terms and must authorize the settle call itself. Preconditions. A copy of the payload. Impact. None: refused. Mitigations
  • Requirements whose facilitatorAddress is not this facilitator’s authority are refused; the contract requires terms.facilitator’s authorization. (packages/upto/src/errors.ts, invalid_upto_stellar_requirements_facilitator_mismatch)
Tests Conformance runs. rejection-audit case upto-terms-authority, rejection-audit case upto-authority-not-ours. Residual risk. None.

U5. The allowance left by a partial settlement

Mitigated · Elevation of privilege · boundary TB7 (Contracts) · asset: Payer funds Threat. After a partial settlement, the remaining allowance (cap minus amount) is spent by someone else. What Stellar makes different. The signed approve grants the settlement contract an allowance of the full cap until the expiration ledger; transfer_from spends only the settled amount. Preconditions. A partial upto settlement. Impact. None: only the contract can spend the allowance, and it spends only inside a settlement. Mitigations
  • The allowance’s spender is the settlement contract; it expires with the terms and the next settlement’s approve overwrites it. (contracts/stellar/upto/src/lib.rs, transfer_from)
Tests Residual risk. Wallets show an allowance to the settlement contract until the expiration ledger.

U6. Zero settlements paid by the sponsor

Accepted risk · Denial of service · boundary TB2 (Seller and facilitator) · asset: Sponsor XLM Threat. Anyone settles many upto payments for zero; each on-chain zero settlement costs the sponsor a fee and moves nothing. A zero needs no token balance or trustline, so the caller needs only an account that can sign. What Stellar makes different. An on-chain zero consumes the nonce (so the authorization cannot be reused) but costs a Soroban transaction. Preconditions. Sellers or buyers that trigger zero settlements. Impact. Sponsor fees for payments that earn nothing. Mitigations
  • UPTO_ZERO_SETTLEMENT=offchain records a zero as a terminal success without a transaction, in the durable settlement ledger (STORE=postgres is required for it). Pubnet defaults to offchain; testnet stays on-chain for a public on-chain record. (apps/rail402/src/config.ts, zeroSettlement)
  • Pubnet refuses to start without an explicit hourly sponsor budget, which bounds on-chain zeros with every other settlement. (apps/rail402/src/config.ts, PUBNET_MAX_SPONSOR_SPEND_XLM_PER_HOUR)
  • Zero settlements are never cataloged, on-chain or off-chain. Content planted with a settlement of one base unit is not published either: listings with an origin publish only what the origin answers (P1, P9). (packages/bazaar/src/codes.ts, bazaar_settlement_zero)
Tests Conformance runs. live-matrix case upto-zero, live-bazaar case upto-offchain-zero. Residual risk. On the keyless testnet service, zeros settle on-chain and each costs one fee, bounded by the per-client rate limit (IPv6 clients are grouped by /64) and, where configured, the hourly budget. A client with many addresses passes the rate limit, so the budget is the real bound, after which every settlement is refused for the rest of the hour. On pubnet zeros settle off-chain by default and all spend is bounded by the required hourly budget.

U7. The settlement contract archived

Mitigated · Denial of service · boundary TB7 (Contracts) · asset: Availability Threat. The upto contract’s instance or code entry reaches the end of its TTL and is archived, so every upto payment fails. What Stellar makes different. Persistent entries are archived at liveUntilLedgerSeq; any invocation needs them restored. The contract keeps no storage of its own, so only the instance and code entries pay rent. Preconditions. Nobody extends the entries for months. Impact. upto payments unavailable; restoring inside a payment would bill the buyer’s sponsor (S7). Mitigations Tests Residual risk. None while the keeper runs; extension and restoration are permissionless, so anyone can also keep the contract live.

U8. A different or changed settlement contract

Mitigated · Tampering, Elevation of privilege · boundary TB7 (Contracts) · asset: Payer funds Threat. Requirements name a hostile contract as the settlement contract, or the canonical contract’s code is replaced. What Stellar makes different. Contract addresses derive from the deployer and a salt; the deployed WASM hash is readable from the instance. A contract without an admin or upgrade function cannot change its code. Preconditions. A seller or configuration pointing at another contract. Impact. A contract that spends the approved allowance differently. Mitigations
  • The contract has no admin, no storage and no upgrade path. (contracts/stellar/upto/src/lib.rs, cannot be upgraded)
  • Payments naming another contract than the network’s configured one are refused; the service refuses to start when the configured contract runs other code. (packages/upto/src/errors.ts, invalid_upto_stellar_payload_wrong_contract)
Tests Residual risk. An operator can configure a contract of their own (UPTO_TESTNET_DEPLOYMENT); buyers see it in /supported.

U9. Token differences between SAC and SEP-41 contracts

Mitigated · Tampering · boundary TB7 (Contracts) · asset: Payer funds Threat. A token whose events or allowance semantics differ from a Stellar Asset Contract is mis-read, so a wrong transfer passes the checks or a right one is refused. What Stellar makes different. Stellar Asset Contracts publish [name, from, to, asset] topics; OpenZeppelin SEP-41 tokens publish [name, from, to] with a bare amount, and their approve data is a map with live_until_ledger. Decimals are read from the token. Preconditions. A custom SEP-41 asset. Impact. False acceptance or refusal of upto settlements. Mitigations
  • Both event shapes are accepted and checked field by field; exactly one transfer of the amount from the payer to payTo, and no balance event involving a facilitator account. (packages/upto/src/facilitator/simulation.ts, checkSimulationEvents)
  • Only the tokens the operator lists for the network are settled; any other token is refused before simulation, because a token contract can report a transfer it never made. (packages/upto/src/facilitator/rules.ts, isAssetAccepted)
Tests Conformance runs. live-bazaar case second-asset. Residual risk. Tokens with fees on transfer or rebasing balances are not supported; their settlements fail the event check.

U10. The settlement authority’s key is compromised

Accepted risk · Elevation of privilege · boundary TB4 (Facilitator and its state) · asset: Payer funds Threat. The authority’s key, which is derived from the sponsor secret, leaks. What Stellar makes different. The authority chooses the amount of any upto payment that names it, up to each payment’s cap, within the payment’s validity window; it holds no funds and cannot change recipient or token. Preconditions. Leak of the sponsor secret. Impact. Payloads the attacker obtains could be settled for up to their caps, to their named recipients, until they expire; the sponsor’s XLM is at risk. Mitigations
  • The authority is derived per network with HKDF from the sponsor secret, distinct from the sponsor and the channels, and holds a zero balance. (packages/facilitator/src/authority.ts, deriveAuthorityKeypair)
  • Rotation with the sponsor: payments naming the old authority are refused by the new one and expire within the maximum timeout (300 s by default). (docs/operations.md, Rotating the sponsor key)
Tests Residual risk. Within the maximum timeout after a leak, captured payloads can be charged up to their caps. Keep caps near expected prices and timeouts short.

U11. A served buyer defaults before settlement

Accepted risk · Repudiation · boundary TB2 (Seller and facilitator) · asset: Seller revenue Threat. An upto seller serves first and settles afterwards. Between /verify and the seller’s /settle the buyer moves its funds, uses its authorization nonce in another transaction, or settles the payload itself for zero, and the seller’s settlement fails for work already done. What Stellar makes different. /verify simulates the settlement for the full cap, so the signature, balance and trustline hold at that moment, but a Soroban authorization is not an escrow: nothing is locked until the settlement transaction applies. Preconditions. A buyer willing to default, and a seller that releases output before its own settlement succeeds. Impact. One request served unpaid. A streaming or metered seller cannot withhold what it already sent. Mitigations
  • Short maxTimeoutSeconds, settling immediately after serving, withholding buffered output until settlement succeeds (the stock Express middleware does), and refusing payers whose settlements fail. (docs/facilitator/upto.mdx, Payment is not guaranteed after verification)
Tests. None: this is a documented limit, not a behaviour Rail402 implements. Residual risk. Accepted: upto is post-paid by design; the loss is bounded by one request’s cap.

U12. Rotation strands or reopens upto authorizations

Mitigated · Denial of service, Elevation of privilege · boundary TB7 (Contracts) · asset: Seller revenue Threat. After a sponsor rotation the new authority refuses payloads that name the old one, so sellers cannot settle work already served; or the old authority is kept valid longer than needed and a leaked old seed keeps settling captured payloads. What Stellar makes different. The payer names the authority in the signed terms; the contract keeps no storage and has no admin, so the grace lives in the facilitator. Preconditions. A sponsor rotation with upto payments in flight. Impact. Unsettled work, or captured payloads settled by a leaked old seed. Mitigations
  • The previous authority stays loaded for settlement only until PREVIOUS_AUTHORITY_UNTIL, at most TIMEOUT_MAX_SECONDS after startup; /supported advertises only the new one. (packages/facilitator/src/upto-scheme.ts, authorityFor)
  • The configuration refuses a longer grace and ignores one already over. (apps/rail402/src/config.ts, PREVIOUS_AUTHORITY_UNTIL)
Tests Residual risk. During the grace (at most TIMEOUT_MAX_SECONDS, 300 s by default) a leaked old seed can still settle captured payloads up to their caps.

U13. The mainnet contract is deployed wrong

Mitigated · Tampering, Spoofing · boundary TB15 (Source, release and deploy) · asset: Seller revenue Threat. The mainnet deployment uses bytes other than the attested release, the wrong network, or a record that does not match the chain, so clients pin a contract nobody verified. What Stellar makes different. The contract has no admin and cannot be upgraded, so a wrong deployment cannot be fixed in place; it must be replaced and every pin updated. Preconditions. An operator deploying by hand, or a tampered build. Impact. Payments run code nobody reviewed. Mitigations
  • deploy.sh —network pubnet deploys only the release wasm that equals the committed fixture and carries stellar.expert’s attestation, simulates the upload first and needs the typed contract address before sending. (scripts/contracts/deploy.sh, refusing to deploy other bytes to pubnet)
  • verify.sh pubnet and the release workflow check the rebuilt, recorded and deployed bytes of every deployment record. (scripts/contracts/verify.sh, pubnet.json)
  • Pubnet refuses to serve upto (holds the network) when the configured contract is absent or runs other code. (apps/rail402/src/runtime.ts, is not on the network)
Tests Residual risk. None once verified; a replaced contract needs a new pin release.

exact payments

The exact scheme is verified by the upstream @x402/stellar verifier, which Rail402 wraps with its own checks before any RPC work and with its settlement engine after.

E1. Tampering with amount, recipient or asset

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Payer funds Threat. A seller or intermediary changes the amount, payTo or asset of an exact payment after the payer signed it. What Stellar makes different. The payer signs transfer(from, to, amount) on the asset contract; any change alters the invocation the host checks the signature against. Preconditions. A copy of the payload. Impact. None: refused at verify, or fails signature verification. Mitigations
  • The transfer must match the requirements; the payer’s entry must authorize exactly the operation’s invocation. (packages/facilitator/src/preflight.ts, invalid_exact_stellar_payload_auth_invocation_mismatch)
Tests Conformance runs. live-matrix case tamper-amount, live-matrix case tamper-recipient, rejection-audit case tampered-amount. Residual risk. None.

E2. The facilitator made a party to the payment

Mitigated · Elevation of privilege · boundary TB2 (Seller and facilitator) · asset: Sponsor XLM Threat. A payload names a facilitator account (sponsor, channel or upto authority) as payer, transaction or operation source, or co-signer, so the facilitator’s signature would move its own funds. What Stellar makes different. The facilitator signs the envelope and the fee bump; if one of its accounts were the source of a transfer or the subject of an auth entry, its signature would authorize it. Preconditions. Knowledge of the facilitator’s public addresses (they are in /supported). Impact. Loss of the facilitator’s funds; custody. Mitigations Tests Conformance runs. rejection-audit case facilitator-as-cosigner, rejection-audit case facilitator-as-payer, rejection-audit case facilitator-as-source. Residual risk. None.

E3. Extra invocations riding on the payment

Mitigated · Tampering, Elevation of privilege · boundary TB2 (Seller and facilitator) · asset: Payer funds Threat. The authorization tree carries sub-invocations, or the transaction carries more operations or preconditions, so that settling the payment does more than one transfer. What Stellar makes different. An authorization entry authorizes a tree of calls; a transaction may carry preconditions and several operations. Preconditions. A crafted payload. Impact. Side effects signed by the payer and paid for by the sponsor. Mitigations
  • Exactly one invokeHostFunction transfer, no sub-invocations, no unsupported preconditions, bounded size. (packages/stellar/src/payload.ts, inspectExactTransaction)
Tests Conformance runs. rejection-audit case sub-invocations, rejection-audit case multiple-operations, rejection-audit case fee-bump-envelope. Residual risk. None.

E4. An authorization valid for too long

Mitigated · Tampering · boundary TB2 (Seller and facilitator) · asset: Payer funds Threat. A payload signed with a far-future expiration stays spendable long after the purchase. What Stellar makes different. The expiration ledger is chosen by the signer; x402 derives it from maxTimeoutSeconds as ceil(T / ledger seconds) past the latest ledger. Preconditions. A client that signs long-lived authorizations. Impact. A payment that can be settled much later. Mitigations Tests Conformance runs. rejection-audit case expires-too-far, rejection-audit case timeout-out-of-range, live-matrix case expiry-window. Residual risk. None.

E5. Misreading a custom token’s failures and decimals

Mitigated · Tampering · boundary TB3 (Facilitator and Stellar) · asset: Payer funds Threat. A token whose error numbers or decimals differ from a Stellar Asset Contract is priced or explained as if it were one. What Stellar makes different. Classic assets are always 7 decimals through their SAC; SEP-41 contract tokens choose their decimals and their own error numbers. Preconditions. A custom SEP-41 asset configured. Impact. Wrong prices by orders of magnitude, or wrong refusal reasons. Mitigations Tests Residual risk. None.

Operations

Crashes, outages, sequence numbers, retention windows and keys: what happens to a payment when the service itself fails.

O1. A crash after submission

Mitigated · Denial of service, Repudiation · boundary TB4 (Facilitator and its state) · asset: Payer funds Threat. The process dies after signing or broadcasting a settlement and before recording its outcome; a restart submits a replacement and the payer is charged twice, or the seller is never told. What Stellar makes different. A signed envelope stays valid until its time bound; the network may include it after the process died. Preconditions. A crash, deploy or kill at the wrong moment. Impact. Double charge (without protection) or a lost success. Mitigations Tests Conformance runs. fault-recovery case k0-exact, fault-recovery case k1-exact, fault-recovery case k3-exact, fault-recovery case k0-upto, fault-recovery case k1-upto. Residual risk. A settlement whose ledgers the RPC no longer retains stays unresolvable and is reported (O4).

O2. Channel sequence collisions

Mitigated · Denial of service · boundary TB4 (Facilitator and its state) · asset: Availability Threat. Two settlements use the same channel account at once, or something else uses a channel’s key, and transactions fail with a bad sequence number. What Stellar makes different. An account’s transactions are ordered by sequence number; one in-flight transaction per source is the rule. Preconditions. Concurrency, several replicas, or external use of a channel key. Impact. Failed settlements and wasted fees. Mitigations
  • Channels are leased exclusively through Postgres across replicas. (packages/store-postgres/src/channel-pool.ts, PostgresChannelPool)
  • Sequence conflicts are counted so external use is visible. (apps/rail402/src/metrics.ts, rail402_sequence_conflicts_total)
  • Every call of the service’s own RPC clients fails after 10 seconds; upstream’s exact verifier, whose client has no timeout, is cut off after the same 10 seconds with a retryable unexpected_verify_error; and a settlement that has signed nothing by the end of its 30-second claim window signs nothing afterwards, which also bounds upstream’s settlement client, so a hung provider can never let a lease expire under a settlement that may still sign. (packages/facilitator/src/engine.ts, SIGN_WINDOW_ELAPSED)
  • RPC clients carry a call timeout below the claim and lease windows. (packages/facilitator/src/rpc-pool.ts, DEFAULT_RPC_TIMEOUT_MS)
  • A channel referenced by an open settlement is never leased again, whether its lease was released or expired, unless the settlement gave it back because its bytes can never apply. (packages/store-postgres/src/channel-pool.ts, AND NOT EXISTS)
  • A settlement refused with txBadSeq gives its channel back at once, once the channel’s sequence number on the network has reached the transaction’s and neither its hash nor its inner hash landed (read from an RPC that has ingested that ledger and retains every ledger since the claim): its bytes can never apply, so the channel is quarantined for SETTLE_CHANNEL_QUARANTINE_MS, doubled for each further conflict in a row, instead of being held until the payment expires or reused at once. The settlement is marked as having given the channel back, so the channel pool may lease it again while the settlement’s outcome waits, and finishing the settlement releases nothing. An upto settlement then finishes with nothing charged; an exact one when the payer’s authorization expired unused, or as settled through a copy of it (F2). (packages/facilitator/src/engine.ts, sequenceTaken)
  • A quarantined channel is not leased by any replica until its cooldown passes, and when it is, a channel whose account sequence number moved since the conflict is quarantined again instead of settling. (packages/store-postgres/src/channel-pool.ts, quarantined_until)
  • A conflict decided at once reads the payer’s nonce, and when a send may have been accepted or the payment is exact the inner hash too, from an RPC at or past the ledger of the sequence proof; a lagging or switched provider leaves the settlement waiting (rpc_behind), so an authorization another transaction carried is never reported as unused. (packages/facilitator/src/engine.ts, is behind the ledger the sequence proof was read at)
Tests Conformance runs. concurrency case distinct-sequences. Residual risk. Reusing the sponsor seed in another deployment derives the same channels; do not. After another transaction took its sequence number, an exact settlement’s outcome still waits until the payer’s authorization expires, since another transaction may carry that authorization; its channel is given back at the proof. Only with a settlement ledger that cannot mark a channel given back (no releaseChannel) does the settlement keep its channel until it finishes.

O3. The RPC or the settlement store is unavailable

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Availability Threat. The Stellar RPC or Postgres stops answering while payments arrive. What Stellar makes different. Without the RPC nothing can be simulated, submitted or confirmed. Preconditions. An outage. Impact. Payments refused, or worse, settled without a record. Mitigations
  • /ready fails while the RPC is unreachable; refusals carry retryable codes. (apps/rail402/src/health.ts, HealthMonitor)
  • Nothing is broadcast unless its envelope was recorded; verify stays available when the ledger cannot be read. (packages/facilitator/src/scheme.ts, alreadySubmitted)
  • A simulation the RPC failed without running the host, or that passes when asked again, is answered with a retryable code that says the payment was not judged, never as an invalid payment; nothing is signed or submitted. (packages/facilitator/src/explain.ts, simulationRanOnHost)
Tests Residual risk. None beyond downtime.

O4. Settlements past the RPC’s retention

Mitigated · Repudiation · boundary TB3 (Facilitator and Stellar) · asset: Seller revenue Threat. A recorded settlement is examined after the RPC no longer keeps the ledgers that could prove it included or absent, or by an RPC that has not ingested them yet. What Stellar makes different. An RPC keeps only a limited window of recent ledgers and transactions; older ones cannot be read from it. Providers, and the backends behind one provider’s balancer, reach each ledger at different times, so consecutive reads can come from different heights. Preconditions. A long outage or a restored backup; or a lagging provider, a backend behind a balancer or a provider switch while a settlement passes its bounds. Impact. A payment wrongly declared expired while it did settle. Mitigations
  • Such settlements stay unresolved and are reported, never expired; every RPC that answered not found, for the transaction’s hash or its inner hash, must retain every ledger since the claim. (packages/facilitator/src/engine.ts, historyCovers)
  • A settlement whose own hash reads not found is finished as expired, or refused, only on an inner-hash lookup and a payer’s nonce read from an RPC at or past the ledger of that lookup, which for an expiry is the ledger at which its bounds were seen to pass; a lagging provider, a backend behind a balancer or another provider after a failover leaves it waiting for a later read, so a transaction that landed inside someone else’s fee bump is never reported as expired. (packages/facilitator/src/engine.ts, behind the ledger its proof holds at)
Tests Residual risk. An operator resolves unresolved settlements from an archive or an indexer. A settlement whose reads stay behind keeps its channel until they catch up.

O5. All channels busy

Mitigated · Denial of service · boundary TB4 (Facilitator and its state) · asset: Availability Threat. More settlements arrive than there are channel accounts. What Stellar makes different. Each channel carries one in-flight transaction. Preconditions. A burst of payments. Impact. Slow or refused settlements. Mitigations
  • A request waits at most SETTLE_CHANNEL_WAIT_MS for a channel and is refused with a retryable code, leaving no record. (packages/facilitator/src/channels.ts, MemoryChannelPool)
  • An exact payment whose operation sets its own source account is refused before anything is claimed: the payer’s authorization does not cover the operation source, and settlement keeps it but cannot sign for it, so such a payment could never land and would hold a channel until its authorization expired. (packages/facilitator/src/preflight.ts, invalid_exact_stellar_payload_operation_source_set)
  • A first submission the network refuses for good finishes as a submission failure, with nothing charged, and frees its channel and fee budget: an upto one at once, an exact one once the payer’s authorization expired unused (anyone holding the payment can carry it until then, F2); a refusal that may pass (fee, balance, sequence, time bound) keeps the settlement open. (packages/facilitator/src/engine.ts, firstSubmissionRefused)
Tests Residual risk. Throughput is bounded by the channel count; raise CHANNEL_COUNT. A settlement whose submission the network accepted, or whose exact first submission was refused, holds its channel until it is final, at most until its authorization expires; one whose channel sequence number another transaction took gives it back at once.

O6. The sponsor secret is compromised

Accepted risk · Elevation of privilege, Information disclosure · boundary TB4 (Facilitator and its state) · asset: Secrets Threat. The sponsor seed leaks from the platform, a log or a backup. What Stellar makes different. The sponsor seed derives the channels and the upto authority; none of them can move a payer’s funds. Preconditions. A leak. Impact. Loss of the sponsor’s XLM; U10 for upto payloads in flight. Mitigations
  • The seed is never logged or echoed; configuration errors name the variable, not the value. (apps/rail402/src/logger.ts, REDACTED_PATHS)
  • Documented rotation: retire channels, move funds, provision with the new seed. (docs/operations.md, Rotating the sponsor key)
Tests Residual risk. Keep only a working balance on the sponsor.

O7. Degraded search indexing

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Catalog and search integrity Threat. The embedding model fails or is slow, or its files are tampered with. What Stellar makes different. None. Preconditions. A model failure or a changed model file. Impact. Wrong or missing search results. Mitigations Tests Residual risk. None.

O8. The pubnet RPC quota is exhausted

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Availability Threat. Every /verify simulates; a /verify flood, other lookups or harness runs exhaust a keyless provider’s quota and settlement stops. What Stellar makes different. Public keyless mainnet RPCs limit requests per IP (one documents 60 per 10 seconds) without an SLA. Preconditions. A single provider with a quota. Impact. Settlements and verifications fail until the quota resets. Mitigations
  • An ordered provider list per network: after two unhealthy polls the next healthy provider takes over, with per-provider metrics and the active provider in /health; pubnet requires two providers when several networks are served. (packages/facilitator/src/rpc-pool.ts, RpcPool)
  • Pubnet /verify needs a key and each key has its own request limit. (apps/rail402/src/app.ts, keyRequestsPerMinute)
Tests Residual risk. All providers down stops pubnet (O3).

O9. A lying or compromised RPC

Accepted risk · Spoofing, Tampering · boundary TB3 (Facilitator and Stellar) · asset: Seller revenue Threat. A provider returns false simulations, fee stats, balances, ledger numbers or transaction status: it can push the fee oracle to its cap, report success for a failed settlement or failure for a success. What Stellar makes different. The provider cannot change what the payer signed (recipient, amount, cap) or move funds; it controls liveness, fees within the ceilings, and what the facilitator believes happened. Preconditions. A compromised or faulty provider. Impact. Fees up to the ceilings; a seller told a payment settled that did not, or the reverse. Mitigations Tests. None: this is a documented limit, not a behaviour Rail402 implements. Residual risk. Accepted: providers are trusted for liveness and transaction status; a settlement reported successful is not confirmed by a second provider.

O10. Failover resubmits a settlement

Mitigated · Denial of service · boundary TB3 (Facilitator and Stellar) · asset: Sponsor XLM Threat. A provider times out after accepting a transaction; failover sends the same or a rebuilt envelope through another provider. What Stellar makes different. The payer’s nonce makes a second inclusion fail; a rebuilt envelope would cost a second fee. Preconditions. A provider switch while a settlement is in flight. Impact. At most a second fee per settlement. Mitigations
  • Each settlement simulates and submits through the provider active when it was claimed; the pool switches only between polls. (packages/facilitator/src/engine.ts, pinned)
  • Only the recorded envelope bytes are ever rebroadcast, through any provider; a different transaction is never built for a recorded settlement. (packages/facilitator/src/engine.ts, rebroadcast)
Tests Residual risk. At most one wasted fee.

O11. Alerts never arrive

Mitigated · Denial of service, Repudiation · boundary TB14 (Monitoring and status) · asset: Alerting and status Threat. The alerting stack runs on the host it watches; a host outage, a stopped Alertmanager or a broken notification channel means a sponsor drain or an outage goes unnoticed. What Stellar makes different. A sponsor drain spends real XLM within the hour, and an unnoticed stale RPC stops settlement; both need a person within minutes. Preconditions. A host, Prometheus or Alertmanager failure, or a misrouted channel. Impact. Failures continue without anyone being told. Mitigations
  • Alertmanager sends an always-firing Watchdog alert every minute to an off-host dead-man’s switch, which alerts by itself when the heartbeat stops. (deploy/monitoring/alertmanager.yml, receiver: deadman)
  • Every alert in the catalog has a severity, an owner role and a runbook section; pages go to both on-call roles. (deploy/monitoring/alerts.ts, owner)
  • Prometheus scrapes each Explorer indexer, the Explorer web role and the hosted MCP endpoint by fixed target, so a stopped one stays a target; indexer down, indexing failures or chain breaks, lag, web down, MCP down and MCP upstream-budget refusals each raise a ticket. (deploy/monitoring/prometheus.yml, rail402-explorer-indexer)
  • A page silences only the tickets of its own cause on its own network (every channel busy covers channel lease timeouts, a stale RPC covers the failover away from it); every other alert is always sent, so an unrelated page never hides an independent failure. (deploy/monitoring/alertmanager.yml, equal: [network, cause])
  • The sponsor balance alert fires below each network’s readiness floor and, on every network but testnet, below 100 XLM whatever the floor; pubnet refuses a floor below 1 XLM at startup, so a low, zero or missing floor never switches the page off. (apps/rail402/src/config.ts, config_pubnet_sponsor_floor_invalid)
Tests Residual risk. Notification latency; the dead-man’s switch itself is an outside service.

O12. Monitoring components exposed, reached from the service, or used as a probe

Mitigated · Information disclosure, Elevation of privilege · boundary TB14 (Monitoring and status) · asset: Operator infrastructure Threat. A reachable Prometheus or Alertmanager leaks every series and lets anyone silence alerts; the blackbox exporter’s /probe?target= becomes a request-forgery primitive into internal networks. The attacker who matters most is already inside: code execution in the facilitator, the process that holds the hot sponsor seed, could drain the sponsor and post a silence to Alertmanager’s unauthenticated API so that no page fires, while the Watchdog heartbeat keeps the dead-man’s switch green. What Stellar makes different. The private metrics carry pubnet sponsor balances and budget figures, which tell an attacker when a drain would go unnoticed. Preconditions. A published port or a route from the edge proxy to a monitoring service, or code execution in a container that shares a network with Alertmanager. Impact. Information disclosure, silenced alerts, or requests to internal services. Mitigations
  • Monitoring services publish no port and sit only on internal networks; only Alertmanager has an outbound network, for notifications. (deploy/monitoring/compose.example.yaml, internal: true)
  • The networks are split by who may talk to whom: the facilitator replicas share only the scrape network with Prometheus and the blackbox exporter; Alertmanager sits on an alerting network with Prometheus alone, and node_exporter on its own network, so the service can reach neither. (deploy/monitoring/compose.example.yaml, networks: [alerting, alerting-egress])
  • Prometheus runs without its admin and lifecycle APIs, so whoever reaches it on the scrape network can read series but cannot delete them, reload rules or stop it. (deploy/monitoring/compose.example.yaml, No --web.enable-admin-api)
  • The blackbox exporter allows only two modules without redirects, and Prometheus fixes every probe target. (deploy/monitoring/blackbox.yml, follow_redirects: false)
Tests Residual risk. The facilitator can read Prometheus’ series over the scrape network (no secrets: metrics only, which it largely produces itself) and send blackbox probes to the other members of that network. Root on the host bypasses every network boundary (K6).

O13. The public status page misstates availability

Open · Tampering, Repudiation · boundary TB14 (Monitoring and status) · asset: Alerting and status Threat. The status page is measured from the host it reports on, counts only easy endpoints, or accepts an error page as up, so it shows availability the service did not have. What Stellar makes different. Sellers and buyers decide whether to rely on a facilitator from its published availability; a network-wide RPC outage must not be hidden or blamed on the wrong component. Preconditions. Checks run on the host, cover only some endpoints, or assert status codes only. Impact. A false availability record. Mitigations
  • Read-only checks from outside the host about every 5 minutes against every public endpoint of both networks, each with a content assertion; each network’s readiness (/ready/testnet, /ready/pubnet) is its own component, and /health never stands for one network. (deploy/status/upptimerc.yml, __dangerous__body_down_if_text_missing)
Tests Residual risk. Open until the status repository is published and has recorded its first window; until then availability is measured only by the internal monitoring. Outages shorter than the check interval are not seen by the page.

O14. A self-hosted facilitator depends on Rail402’s hosted service

Mitigated · Denial of service · boundary TB5 (Facilitator and the open internet) · asset: Availability Threat. A self-hosted or in-process facilitator quietly calls a Rail402 host (for configuration, verification, metering or telemetry), so an outage, block or takeover of Rail402’s hosted service stops or influences settlement for operators who never chose to depend on it. What Stellar makes different. n/a. Preconditions. An operator self-hosts the image or runs the facilitator in-process. Impact. Settlement stops with Rail402’s hosted service, or a Rail402 host learns about another operator’s payments. Mitigations
  • The facilitator reaches only the Stellar RPC providers it is configured with (and public Horizon through the upstream verifier, with a fallback); the service adds only its own database. No runtime code names a Rail402 host. (packages/facilitator/src/rpc-pool.ts, RpcPool)
Tests Residual risk. None for Rail402 hosts. The upstream verifier’s Horizon read depends on Stellar’s public Horizon and falls back to a 5-second ledger estimate when it fails.

O15. Script injected into the status page through its check history

Mitigated · Tampering, Elevation of privilege · boundary TB14 (Monitoring and status) · asset: Alerting and status Threat. The status page renders the check history (history/summary.json), written by the status repository’s workflow, into its HTML. Whoever can write that file (a leaked workflow token, a bad checker release) could run script on the status page and show any availability. What Stellar makes different. n/a. Preconditions. Write access to the status repository’s history files. Impact. Without protection: script on the status host and a forged availability record. Mitigations
  • Every value from the history and the incident list is escaped, and a day’s downtime is read as a whole number of minutes, so data never becomes markup. (deploy/status/site/index.html, only a count of minutes is used)
  • The page carries a Content-Security-Policy that allows only its one inline script, by SHA-256, and the served header is built from the same script at install, so an injected script or event handler cannot run on either path. (deploy/status/site/index.html, http-equiv="Content-Security-Policy")
Tests Residual risk. The page loads nothing from another origin (its styles, fonts and images come from the status host, and the policy allows no other), so a visit reaches no third party. A forged history can still show wrong figures, as text.

The Playground

A testnet key in a browser page, and a server that relays the page’s seller requests: what a visitor, another site or a seller could do with either.

PG1. The relay used to reach private networks or as an open proxy

Mitigated · Spoofing, Information disclosure, Denial of service · boundary TB8 (Playground page and server) · asset: Operator infrastructure Threat. A visitor, or a script calling the Playground’s API, asks the relay to fetch a loopback, private or cloud-metadata address, a name that resolves to one, or a seller that redirects to one; or uses the relay to send volume to third parties from the Playground’s address. What Stellar makes different. Nothing Stellar-specific: the relay exists because Rail402 and most x402 sellers answer no CORS headers, so a page cannot call them itself. A paid request through it carries a PAYMENT-SIGNATURE the visitor’s own key made. Preconditions. Network access to the Playground server. Impact. Without protection: requests into the server’s network, or the Playground’s address used for abuse. Mitigations
  • The relay sends with safe-fetch under a fixed policy: https on port 443 to public addresses only, DNS answers checked and pinned, redirects refused except same-origin hops for unpaid probes, request and answer size limits. (apps/playground/src/relay/egress.ts, RelayEgress)
  • By host name, it never contacts the Playground itself (its public host and the platform’s generated domain), the facilitator, the Bazaar, the other host names of that service (a facilitator at testnet.<domain> also denies mainnet., pubnet. and explorer.<domain>) or an operator-denied host. (apps/playground/src/relay/egress.ts, operatorSiblings)
  • Per-client, global, per-host, in-flight and daily byte limits, with Retry-After, and a switch to turn the relay off. (apps/playground/src/limits.ts, DailyBudget)
  • Global limits are fair-shared: one network (an IPv4 address or an IPv6 /48) holds at most an eighth of a pool, or its per-client limit when that is larger; clients are keyed by IPv4 address or IPv6 /56. (apps/playground/src/limits.ts, SharedRate)
  • Only a payment that decodes as an x402 payment counts against the paid limits, whether it travels in PAYMENT-SIGNATURE or in an MCP tool call’s _meta; anything else is refused before a token is taken. (apps/playground/src/payment-header.ts, mcpPaymentOf)
  • The demo seller has a paid pool of its own, a paid request that reached no seller gives the shared pool its token back, and the lab sellers return it when the facilitator was never asked, so payments that only have the right shape cannot use up the pools the demo flows need. (apps/playground/src/relay/relay.ts, trustedPaidGlobal)
  • Unpaid requests wait no longer than the SDK’s probe timeouts; bodies pass only as JSON, text or octet-stream; slots of an abandoned upload or an unread answer are released; connections to hosts other than the demo seller are closed as soon as each answer’s body ends, even when the seller never read the upload or keeps sending after a compressed body, and a redirect’s without waiting for its body. (apps/playground/src/relay/relay.ts, timeoutsFor)
  • Unpaid requests and answer bytes are also limited per network, bytes for all clients per day, requests in flight per destination host, and each network gets at most its share of a host’s budget. (apps/playground/src/limits.ts, KeyedSharedRate)
Tests Conformance runs. live-playground case ssrf-literal, live-playground case ssrf-metadata, live-playground case redirect. Residual risk. For a client that is not a browser, the relay is an open https egress to public hosts at the Playground’s address, bounded only by the limits; IP-keyed limits cannot stop a client with many addresses or networks. The payment check stops only malformed payments: a payment that merely has the right shape is counted as paid, so enough addresses can still use up a shared paid pool for a minute at a time. Loop and deny lists match host names: another name of a denied host (beyond the derived sibling names) is caught only when the operator lists it in RELAY_DENY_HOSTS. Its user agent names the Playground, and the operator can deny hosts or switch the relay off.

PG2. Another site drives the relay from a visitor’s browser

Mitigated · Spoofing, Information disclosure · boundary TB8 (Playground page and server) · asset: Operator infrastructure Threat. A page on another origin makes a visitor’s browser send requests through the Playground’s relay or proxies, or reads their answers. What Stellar makes different. The relay holds no key and no session, so a forged request carries no authority the attacker lacks; a payment needs a signature from the key in the Playground’s own page. Preconditions. A visitor with the Playground open, or not, visits the attacker’s page. Impact. Without protection: the Playground’s relay used through visitors’ browsers. Mitigations
  • The relay needs its own request headers, which a cross-site form cannot set; a browser’s Sec-Fetch-Site must be same-origin and its Origin the Playground’s public origin. (apps/playground/src/security.ts, sameOrigin)
  • The relay answers no CORS headers, so no other origin can read an answer. (apps/playground/src/shared/relay-protocol.ts, x-relay-target)
  • The Bazaar and /supported proxies refuse another site’s requests the same way, so no page can spend their shared upstream budget through visitors’ browsers. (apps/playground/src/proxy/bazaar.ts, proxyOrigin)
Tests Residual risk. Clients that are not browsers send neither header and pass. They get nothing a browser visitor lacks, but they can use the relay as an https egress at the Playground’s address, bounded only by the limits (PG1).

PG3. Script injected into the page uses the testnet key

Mitigated · Tampering, Elevation of privilege · boundary TB8 (Playground page and server) · asset: Secrets Threat. Seller-supplied text (a description, an error, a response body) or a third-party script runs in the page and signs with, or reads, the wallet’s key. What Stellar makes different. The key signs Soroban authorization entries through the SDK’s signing guard; a script in the page could ask it to sign within the visitor’s caps. Preconditions. A seller or listing the visitor’s page displays. Impact. Without protection: testnet funds spent within the caps, or the testnet key read out. Mitigations
  • A content security policy without inline or third-party script, styles or frames from the Playground’s origin only, and connections only to the configured Stellar endpoints. The one exception is opt-in: with ANALYTICS_SITE_ID set, the page loads one pinned analytics tracker release whose tag carries its integrity value, so the browser runs no other file, and the policy adds that tracker’s gateway to script-src and connect-src. (apps/playground/src/security.ts, contentSecurityPolicy)
  • Seller text is rendered as text, and an untrusted URL becomes a link only when it is https and parses; no view renders raw markup. (apps/playground/web/src/ui/links.tsx, safeHttpsUrl)
  • The stored seed is encrypted under a key WebCrypto generated as non-extractable; only the wallet modules touch the key. (apps/playground/web/src/wallet/keystore.ts, non-extractable)
Tests Conformance runs. live-playground case secret-scan. Residual risk. A script that did run in the page would not be bound by the caps: it could open the page’s IndexedDB, decrypt the stored seed with the stored key (non-extractable protects the key, not what it decrypts) and send the seed out. The CSP and the absence of markup sinks make that unlikely. The key is meant for testnet only: the page makes it for the visitor and never shows it. With ANALYTICS_SITE_ID set, the pinned tracker file runs in the page and is trusted like the page’s own code; its integrity value keeps the gateway from changing it.

PG4. The lab sellers take real payments or pollute the catalog

Mitigated · Tampering, Denial of service · boundary TB8 (Playground page and server) · asset: Payer funds Threat. The Playground’s misbehaving sellers (the offers, the greedy upto route) take a payment that sticks, or every visitor’s sandbox sale adds a listing to the public Bazaar. What Stellar makes different. An upto authorization caps what any settlement can move; Rail402 refuses a settlement above it, and the settlement contract enforces the cap on chain too. Preconditions. A visitor running the lab. Impact. Without protection: visitors charged more than they authorized, or a catalog flooded with sample listings. Mitigations
  • The offers answer a 402 only and never verify or settle. (apps/playground/src/lab/offers.ts, offerHandler)
  • The greedy route asks to settle twice its cap, which Rail402’s upto rules refuse; it declares no discovery metadata. (packages/upto/src/facilitator/rules.ts, invalid_upto_stellar_payload_settlement_exceeds_amount)
  • The sandbox route answers the same 402 for every city and visitor, so it is one listing paid to one operator account. (apps/playground/src/lab/sell.ts, declareSellRoute)
  • Its discovery metadata always carries the declared example city, never the one a request names, and a path that is not a city name gets no 402, so no payer writes text into the shared listing. (apps/playground/src/lab/sell.ts, sellBazaarExtension)
Tests Conformance runs. live-playground case overcharge, live-playground case refusal-network, live-playground case refusal-asset, live-playground case refusal-amount. Residual risk. None for funds. The sandbox listing is public and permanent, as one listing; its resource URL names the city of the payment that created it.

PG5. The stored wallet read or overspent

Mitigated · Information disclosure, Elevation of privilege · boundary TB8 (Playground page and server) · asset: Agent budgets Threat. The wallet’s stored record is swapped or tampered with, or two tabs spend one session budget at the same time. What Stellar makes different. The budget ledger reserves each payment before it is signed; two writers of one stored ledger could each see room the other already used. Preconditions. Access to the browser profile, or two open tabs. Impact. Without protection: a different key loaded, or the session budget exceeded. Mitigations Tests Conformance runs. live-playground case refusal-session. Residual risk. The record is encrypted under a key kept in the same browser profile, not under a passphrase: anyone using that profile can use the wallet through the page. It is a testnet key with testnet funds.

PG6. Payments or the key leak into logs, traces or storage

Mitigated · Information disclosure · boundary TB8 (Playground page and server) · asset: Secrets Threat. A PAYMENT-SIGNATURE, a signed authorization or the key ends up in the server’s logs or traces, an error, the page’s storage, a run report or a request to a third party. What Stellar makes different. A signed authorization is spendable by whoever holds it until it expires. Preconditions. Any run. Impact. Without protection: an authorization replayable by whoever reads the channel, or the key exposed. Mitigations Tests Conformance runs. live-playground case secret-scan. Residual risk. The relay holds a payment header in memory for the one request that carries it, as any seller does.

Upstream watch

A scheduled workflow reads upstream x402 and npm, and writes one public tracking issue with a token that can write issues: what upstream text, a forged issue or a failed fetch could do with it. Mitigated · Tampering, Spoofing · boundary TB16 (Upstream watch) · asset: Project tracker Threat. Upstream commit titles and diffs carry @mentions that ping people, HTML, Markdown links to phishing pages or hidden comments that imitate the tracking marker, and the watcher copies them into a public issue. What Stellar makes different. Nothing Stellar-specific: the watched text comes from the x402 repository and npm, which anyone can contribute to. Preconditions. An upstream commit or file whose text the watcher reports. Impact. Without escaping: people pinged from the project’s tracker, rendered markup or links under the project’s name, or a forged marker that misleads the next run. Mitigations
  • Upstream text is only placed in code spans (one line, backticks replaced, control and format characters removed) or in fences longer than any backtick run inside; comment openers are broken up, so the marker only ever appears on the first line, where the next run reads it. (tools/upstream-watch/src/render.ts, escapeUpstream)
  • Links are built by the watcher, to github.com and npmjs.com only; pull request numbers in commit titles become links to the upstream repository. (tools/upstream-watch/src/render.ts, pullLinks)
  • The body is capped at 60,000 characters: diffs and commit lists shrink first, then the body is cut. (tools/upstream-watch/src/render.ts, MAX_BODY)
Tests Residual risk. None.

SW2. The workflow token can do more than write issues

Mitigated · Elevation of privilege · boundary TB16 (Upstream watch) · asset: Project tracker Threat. A broad token, an unpinned action, a script built from workflow inputs, or a step that checks out and runs upstream code turns the scheduled job into a way to write the repository or read secrets. What Stellar makes different. Nothing Stellar-specific. Preconditions. A compromised action tag, a malicious upstream change, or a crafted dispatch input. Impact. Without the limits: repository writes or secret disclosure from a job that runs every week unattended. Mitigations
  • The workflow grants contents read and issues write only, pins every action by commit SHA, uses no secret but its own token, does not keep the checkout’s credentials, installs only the watcher’s own dependencies without install scripts, passes inputs through the environment, never checks out or runs upstream code, and runs in this repository only. (.github/workflows/upstream-watch.yml, issues: write)
Tests Residual risk. The job trusts GitHub’s runner, the pinned actions and the npm packages in the lockfile it installs (zod).

SW3. Someone else’s issue taken for the tracking issue

Mitigated · Spoofing, Tampering · boundary TB16 (Upstream watch) · asset: Project tracker Threat. Anyone can open an issue with the label and a copy of the hidden marker, so the watcher edits or closes it, or ignores the real tracking issue. What Stellar makes different. Nothing Stellar-specific. Preconditions. Permission to open issues in the public tracker. Impact. Without the check: a person’s issue rewritten or closed by the workflow, or real upstream drift hidden behind a forged fingerprint. Mitigations
  • Only issues opened by the workflow’s own identity, with the label and the marker on the first line, count as tracking issues. (tools/upstream-watch/src/issues.ts, isTrackingIssue)
Tests Residual risk. None.

SW4. A fetch failure closes the drift issue

Mitigated · Tampering, Repudiation · boundary TB16 (Upstream watch) · asset: Project tracker Threat. A rate limit, an error or an empty answer reads as “no drift”, so the issue is closed as resolved while upstream still differs, or a run that checked nothing renders as a pass. What Stellar makes different. Nothing Stellar-specific. Preconditions. GitHub or npm unavailable, rate-limited or answering without the expected fields. Impact. Without the check: upstream changes silently dropped from review. Mitigations Tests Residual risk. None.

One service, two networks

One facilitator process serves the keyless testnet and pubnet: what one network’s traffic, faults or access could do to the other.

N1. A testnet flood takes pubnet’s request capacity

Mitigated · Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Availability Threat. Free testnet traffic from many addresses saturates the shared limiter, the event loop and the CPU, so pubnet /verify and /settle time out. What Stellar makes different. n/a. Preconditions. One service serving both networks. Impact. Pubnet refusals or timeouts caused by testnet load. Mitigations
  • Before the body is read, a /verify or /settle with a usable access key is charged to a bucket of that key on every host, never to its client address: keyless traffic of either network, unknown paths and refused requests from the same address or IPv6 /64 never spend it. The bucket holds what the key may send a minute on all its networks, and at least RATE_LIMIT_PER_MINUTE, so the key’s own per-network limits are what refuse it. A request whose network does not admit the key pays its address’s bucket as well, so a key never carries keyless payments past the address’s limit. (apps/rail402/src/app.ts, callerLimit)
  • Once the network and caller are known, each network applies its own limit: per key on pubnet, never the testnet address bucket. (apps/rail402/src/app.ts, networkLimiter)
  • A held or starting network refuses only its own requests. (apps/rail402/src/network-state.ts, NetworkGate)
  • The responses of a connection, including those the server gives without reaching the app, must be handed to the operating system’s socket buffer within RESPONSE_WRITE_TIMEOUT_MS of being ready, and one connection may have at most MAX_PIPELINED_REQUESTS requests waiting for their answers, on every route; otherwise the connection is reset and every response it held released. A response’s clock starts once it and every response before it on the connection are ready, so a pipelined backlog shares one deadline and the time handlers take to answer never counts. (apps/rail402/src/server.ts, deadlineOf)
  • A discovery request keeps its admission slot until its response has been handed to the client’s connection, so the slots bound the discovery pages the process keeps for clients that have not taken them, and one client (an address, or a forwarded client of a discovery-internal key) holds at most DISCOVERY_MAX_IN_FLIGHT_PER_CLIENT requests of a lane. (apps/rail402/src/app.ts, afterSent)
Tests Residual risk. A flood above the container’s raw capacity still degrades both networks; a dedicated pubnet process or host is the later option. Clients from enough addresses can fill a discovery lane’s slots, slow readers included, for as long as they keep asking. Open connections are bounded only by the proxy in front and the process’s file-descriptor limit: each holds at most MAX_PIPELINED_REQUESTS answers for at most RESPONSE_WRITE_TIMEOUT_MS.

N2. Search embedding on testnet starves pubnet settlement

Mitigated · Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Availability Threat. Every search runs the embedding model in the facilitator process; a testnet search flood or an index rebuild after testnet churn uses the CPU that pubnet settlement needs. What Stellar makes different. One process serves keyless testnet discovery and pubnet settlement on the same CPUs. Preconditions. Many distinct searches, or frequent catalog changes. Impact. Without protection: pubnet verify and settle slow down or time out. Mitigations
  • Embedder concurrency cap shared by queries and index builds; a query that finds the model busy is answered lexical-only, as partial results. (packages/search/src/service.ts, EmbedGate)
  • Query-embedding LRU cache and a cost-weighted per-client discovery bucket. (apps/rail402/src/discovery.ts, searchCost)
Tests Residual risk. Search quality degrades to lexical under load. Settle latency under a search flood is measured with the load package’s settle probe (tools/loadtest, local private network); the measurement against the production-config release stack is still to be recorded.

N3. The shared database pool is exhausted by testnet work

Mitigated · Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Availability Threat. Testnet settlements, cataloging and limiter writes hold every connection in the one pool, so pubnet settlement claims wait or fail. What Stellar makes different. n/a. Preconditions. Heavy testnet load on Postgres. Impact. Pubnet settlements wait or fail. Mitigations
  • With several networks served, pubnet’s settlement ledger and channel leases use a connection pool of their own. (apps/rail402/src/database-pools.ts, PUBNET_POOL_SIZE)
  • Pubnet’s request limit, per-payer and per-payTo limits and metering use that pool too, routed by network. (apps/rail402/src/network-stores.ts, createAccessStores)
  • On the pubnet host (PUBLIC_HOSTS), and in a process that serves pubnet alone, the service-wide limit decides the key in memory first: a key pubnet admits is limited on pubnet’s pool (the one pool when pubnet is served alone), every other caller in the process only, so no pubnet /verify or /settle on the pubnet host waits for a shared connection to be admitted and no anonymous caller’s per-address limit there takes a connection of the pool pubnet’s settlements use; where pubnet requires keys, such a caller is refused before any database work. With the Bazaar the discovery routes keep their limits on the discovery pools; without it a /discovery/ path is limited like any other. (apps/rail402/src/app.ts, callerLimit)
  • Pubnet’s account provisioning and upto contract TTL rounds take their sponsor lock through pubnet’s pool. (apps/rail402/src/runtime.ts, pubnetLock)
  • The public, unlimited /metrics answers from memory: channels in use is counted every second in the background, one count per network at a time, so scrapes never take a database connection. (apps/rail402/src/metrics.ts, refreshChannelsInUse)
  • The runtime role’s connection limit must hold every pool of every replica: the service reads it at startup, logs how many replicas it holds, and with pubnet refuses to start below one process’s pools, so anonymous load on the shared and discovery pools never takes the role’s slots that pubnet’s pool and readiness need. (apps/rail402/src/database-checks.ts, checkConnectionBudget)
  • A client already over its limit is refused from memory, without another write, until its window ends (measured from a monotonic clock read before the refused write, so never longer); only requests already on their way to the database when its first refusal comes back still write. (packages/store-postgres/src/access.ts, overLimit)
  • Every pool fails a query after DATABASE_ACQUIRE_TIMEOUT_MS without a connection, so pubnet’s fail-closed limiters refuse with a code instead of queueing without end. (packages/store-postgres/src/database.ts, acquireTimeoutMs)
  • Reconciliation runs per network, one round at a time per network; a network whose ledger or RPC fails or hangs never holds up another network’s round. (packages/facilitator/src/facilitator.ts, reconcileNetwork)
  • The public /ready probes the database through one connection of its own, at most once every 2 seconds, and concurrent requests share the running probe, so a readiness flood never takes a connection from settlements and a queue for the shared pool is never reported as an outage. (apps/rail402/src/runtime.ts, readinessProbe)
Tests Residual risk. The database server itself is shared; an outage or saturation of the server stops both networks (O3). On a host not listed in PUBLIC_HOSTS the network is known only from the body, so a pubnet key holder’s service-wide limit there stays on the shared pool: serve pubnet callers through the pubnet host. /usage and cataloging a pubnet settlement’s discovery metadata read the shared pool (the one pool when pubnet is served alone; there, /usage with a key pubnet does not admit, such as a discovery-internal key, is limited per process only), so while it is saturated /usage fails and a pubnet /settle that carries discovery metadata answers after at most the 2-second catalog budget (a /verify preview after 250 ms), reporting the cataloging as processing. The process cannot know how many replicas run, so a role connection limit that holds one replica’s pools but not two is only logged (replicas: 1), not refused.

N4. One network’s failure marks the other unready

Mitigated · Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Availability Threat. /ready is all-or-nothing, so an underfunded pubnet sponsor, a pubnet RPC outage or missing pubnet channels pull the whole service out of a load balancer, and the reverse. What Stellar makes different. n/a. Preconditions. Any per-network fault. Impact. Both networks taken out of service. Mitigations
  • Readiness per network (/ready/testnet, /ready/pubnet) and a per-network serving gate that refuses only that network’s /verify and /settle with a coded 503; the aggregate /ready gates on no network when several are served. (apps/rail402/src/network-state.ts, NetworkGate)
  • The aggregate /ready checks the database through a connection of its own that gives up after DATABASE_ACQUIRE_TIMEOUT_MS, so neither network’s load on the shared pool or on pubnet’s fails it, while a database that refuses the connection or stops answering does; the role’s connection limit is sized so that connection always has a slot. (apps/rail402/src/runtime.ts, readinessProbe)
  • Chain checks at startup run per network, concurrently, and hold instead of exiting when several networks are served; whatever a failing RPC throws (an error, a JSON-RPC error object, a string or nothing), it holds only that network with a code, in either mode, and only a check the chain contradicts stops a single-network process. (apps/rail402/src/runtime.ts, contradictionOf)
Tests Residual risk. None.

N5. Testnet listings use up pubnet’s cataloging quota

Mitigated · Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Catalog and search integrity Threat. A catalog-wide new-listing quota or origin-check queue would serve listings of both networks together, so free testnet settlements could block or delay pubnet sellers from being cataloged, or a facts refresh queue shared by both networks would let slow testnet hosts delay pubnet trust. What Stellar makes different. Testnet payments are free; pubnet payments cost real money. Preconditions. A flood of testnet settlements with bazaar extensions. Impact. Without protection: pubnet sellers refused with bazaar_rate_limited, or left pending behind a testnet origin-check backlog. Mitigations
  • Every catalog budget (global, per owner, per payer, per origin host) is kept per network, with stricter pubnet defaults that testnet settings never loosen. (packages/bazaar/src/policy.ts, catalogBudgetFor)
  • Origin checks are claimed and run in one lane per network, a bounded number at a time; a network whose lane is busy is skipped, so a testnet backlog never delays pubnet listings. (packages/bazaar/src/catalog.ts, checkOrigins)
  • The network-wide hourly quota counts only listings published now, so pending listings from dust payments never block another seller; Stellar facts and domain trust are refreshed in one lane per network. (packages/bazaar/src/catalog.ts, enrichNetwork)
Tests Residual risk. A testnet backlog delays other testnet listings only.

N6. Public metrics and health reveal pubnet budget state

Mitigated · Information disclosure · boundary TB9 (Testnet and pubnet inside one service) · asset: Sponsor XLM Threat. /metrics is public for testnet’s published report, and one process exposes pubnet series too: sponsor balance, budget refusals, per-key counters; readiness shows the balance. What Stellar makes different. Sponsor balances are public on chain; budget and refusal timing are not. Preconditions. Anyone reading /metrics or /health. Impact. An attacker times a drain and watches its effect. Mitigations
  • The public /metrics keeps only allow-listed pubnet series and no series labelled with an access key; /metrics/private and /health/private need a token. (apps/rail402/src/metrics-exposure.ts, PUBLIC_PUBNET_METRICS)
  • Pubnet series on the public /metrics lose their reason label (series that differ only in it are added up), so a budget or limit refusal looks like any other failure; the private view keeps it. (apps/rail402/src/metrics-exposure.ts, publicLabels)
  • Public /health shows whether the pubnet sponsor is funded, never its balance or budget figures, and leaves out pubnet’s sponsor_budget_high warning; pubnet readiness details carry no balance. (apps/rail402/src/health.ts, publicHealth)
  • The public /health shows no access-key counts or reload state, and its reload warning names no error. (apps/rail402/src/health.ts, access: _access)
Tests Residual risk. Sponsor balances are public on chain anyway, and public failure counts still rise during a drain, indistinguishable from other failures; a caller sees the refusal codes of its own requests. Budget figures, budget warnings and refusal reasons are private.

N7. A testnet-path flaw reaches the pubnet seed in the same process

Accepted risk · Information disclosure, Elevation of privilege · boundary TB9 (Testnet and pubnet inside one service) · asset: Secrets Threat. The process that holds the pubnet sponsor seed also serves the keyless public testnet, makes outbound origin checks, parses seller schemas and runs the embedding model; a code-execution or memory-disclosure bug on any of those paths reads the seed. What Stellar makes different. n/a. Preconditions. A code-execution or disclosure bug. Impact. The pubnet seed exposed. Mitigations
  • With pubnet enabled every secret comes from a file read once at start, never the environment, and never appears in configuration digests, health or errors. (apps/rail402/src/secrets.ts, readSecretFile)
  • The sponsor’s signer set keeps a cold signer above the hot key, so a leaked seed spends only the hot balance. (packages/facilitator/src/signers.ts, assertSignerSet)
Tests Residual risk. Accepted: a process compromise still exposes the pubnet seed; the bound is the hot balance plus in-flight upto caps. A dedicated pubnet process or host is the next step if needed.

N8. A superuser database role shared by both networks

Mitigated · Elevation of privilege, Tampering · boundary TB4 (Facilitator and its state) · asset: Secrets Threat. The service connects as the Postgres superuser; a SQL injection or a compromised dependency on the keyless testnet path can rewrite the pubnet settlement ledger, keys and listings, or run COPY … TO PROGRAM for code execution in the database container. What Stellar makes different. The settlement ledger decides whether a recorded Stellar transaction is answered as settled; rewriting it can make a seller serve unpaid requests or misreport pubnet payments. Preconditions. A SQL injection, or code execution in the service process. Impact. Tampered settlement and catalog records for both networks, and code execution in the database container. Mitigations
  • With pubnet enabled the service and check-config refuse a superuser or role-creating connection, a member of such a role or of the server-file and server-program roles, and a role that owns the schema or its tables. (packages/store-postgres/src/roles.ts, assertRuntimeRole)
  • Pubnet never applies migrations through the service’s connection, which would make it the tables’ owner; they run as the schema owner through the migrate command. (apps/rail402/src/database-checks.ts, config_pubnet_migration_role_missing)
  • Separate owner and runtime roles: migrations run as the owner; the runtime role reads and writes rows and cannot create, alter, drop or truncate tables, create roles or run server programs; the database and the maintenance databases are revoked from PUBLIC. (deploy/postgres/roles.sql, REVOKE CONNECT ON DATABASE postgres FROM PUBLIC)
  • The runtime role’s privileges are re-applied after every migration and restore; the migration bookkeeping is read-only to it and the listing history append-only. (deploy/postgres/grants.sql, REVOKE UPDATE, DELETE ON public.listing_versions)
  • A logical restore creates every object as the owner role and re-applies the grants, so a restore never leaves the tables owned by the superuser. (deploy/postgres/restore-dump.sh, SET ROLE :"owner")
  • With pubnet the service refuses DATABASE_MIGRATION_URL: the process that holds the sponsor seed never holds the schema owner’s credentials; the migrate command reads them on its own. (apps/rail402/src/config.ts, config_pubnet_migration_url_in_service)
  • A deploy checks a release that adds a migration before touching the database with CHECK_CONFIG_PENDING_OK=true, which skips only the pending-migration refusals and still refuses a privileged or owning role; the migrations then run as the schema owner, never through the service’s role. (apps/rail402/src/database-checks.ts, pendingOk)
Tests Residual risk. The runtime role can still write both networks’ rows; rows are separated by their network column.

N9. A setting tuned for testnet weakens pubnet

Mitigated · Tampering, Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Sponsor XLM Threat. Process-wide settings tuned for a public testnet silently apply to pubnet, or a testnet default (auto-provisioned channels, on-chain zeros, USDC by default) is assumed on pubnet. What Stellar makes different. n/a. Preconditions. An operator enabling pubnet. Impact. Pubnet runs with limits meant for a free network. Mitigations
  • Every money- or abuse-relevant setting has a pubnet rule, pubnet refuses to start when a required one is missing, and startup logs a digest of each network’s effective settings. (apps/rail402/src/config.ts, networkSettingsDigest)
  • An in-process facilitator on pubnet refuses to start without a sponsor guard, explicit fee ceilings, an inclusion floor of at least 200 stroops and explicit accepted assets, each with a stable code; testnet’s USDC default never applies to pubnet. (packages/facilitator/src/facilitator.ts, config_pubnet_assets_missing)
Tests Residual risk. None.

N10. Restarts for one network interrupt the other

Mitigated · Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Availability Threat. A deploy for a testnet change, an out-of-memory kill or a crash on a testnet path restarts the one process and drops pubnet requests in flight. What Stellar makes different. A settlement in flight when its process stops is finished from its recorded envelope, but the seller waits; during the gap no new payment can be verified on either network. Preconditions. A deploy, a crash, or a resource limit hit by load on either network. Impact. Both networks stop answering until the process is back. Mitigations
  • Two replicas behind a proxy that routes only to a replica whose /ready answers; deploys restart them one at a time. (deploy/proxy/Caddyfile.example, health_uri /ready)
Tests Residual risk. A crash loop on both replicas stops both networks.

N11. A testnet discovery flood sheds pubnet discovery

Mitigated · Denial of service · boundary TB9 (Testnet and pubnet inside one service) · asset: Availability Threat. Keyless testnet discovery requests from many addresses fill the discovery admission slots and queue, or every connection of the discovery pool, so pubnet discovery requests are refused with 503 discovery_overloaded. What Stellar makes different. n/a. Preconditions. One service serving both networks; enough parallel slow discovery requests, such as uncached searches or seller usage aggregates. Impact. Without protection: the pubnet Bazaar’s read surface unavailable while testnet is flooded. Mitigations
  • Discovery admits in two lanes with their own gates: requests scoped to pubnet (network parameter or a pubnet host) and everything else; a full shared lane never refuses a pubnet-scoped request. (apps/rail402/src/discovery.ts, export class DiscoveryAdmissions)
  • With pubnet served next to another network, pubnet-scoped discovery reads the catalog and keeps its per-address and identity limits through a discovery pool of its own. (apps/rail402/src/runtime.ts, pubnetDiscoveryDb)
  • Stores and limiters pick the lane’s connections from the request’s lane, and background work keeps the shared pool. (apps/rail402/src/discovery.ts, export function laneRouted)
  • Search index builds, which searches of both lanes join, and the background index refresh read the catalog through a pool of their own that no request takes. (apps/rail402/src/database-pools.ts, SEARCH_INDEX_POOL_SIZE)
  • A search whose index build cannot read the catalog answers from the previous index instead of failing. (packages/search/src/service.ts, private async recent)
Tests Residual risk. Discovery routes without a network parameter (listing detail, versions) share the testnet lane unless asked on a pubnet host; a flood above the process’s raw capacity still degrades both networks (N1).

Access keys and quotas

Pubnet callers present an API key with its own rate and sponsor budget: what a leaked, shared or misused key, or a failing limiter, could do.

Q1. The rate limiter fails open

Mitigated · Denial of service · boundary TB4 (Facilitator and its state) · asset: Availability Threat. A database error, slow query or exhausted pool makes the limiter throw; requests are then served without any limit, exactly when the service is under load. What Stellar makes different. n/a. Preconditions. A limiter outage. Impact. Unlimited requests reach verification and settlement. Mitigations
  • On pubnet the per-network limiter fails closed: requests are refused with a retryable 503 while it cannot answer. (apps/rail402/src/app.ts, Rate limiting is unavailable)
  • The address limiter falls back to a per-process bucket while the shared limiter is down, so no route goes unlimited. (apps/rail402/src/app.ts, fallbackLimiter)
Tests Residual risk. During a limiter outage pubnet settlement stops; that is intended.

Q2. An API key is read from logs or reused by someone else

Mitigated · Spoofing, Information disclosure · boundary TB17 (The host and co-located services) · asset: Access keys and quotas Threat. A key sent in X-API-Key is written to an access log, an application log or a shared example, and a third party settles with it, spending its holder’s budget. What Stellar makes different. n/a. Preconditions. A key in a log or a leaked file. Impact. Settlements and fees charged to the key’s holder. Mitigations
  • The application logger redacts X-API-Key and Authorization headers; refusals never echo a key. (apps/rail402/src/logger.ts, x-api-key)
  • Keys expire and are revocable without a restart: the key file is re-read when it changes, and a broken file keeps the last good keys. (apps/rail402/src/access.ts, reload)
  • The operations guide tells operators to keep X-API-Key out of the edge proxy’s logs. (docs/operations.md, X-API-Key)
  • The proxy example deletes X-API-Key and the payment headers (X-Relay-H-Payment-Signature, the Playground relay’s, included) in every logger: the sites’ access logs, the handler-error logger, and the default logger, which takes Caddy’s other entries about a request (a response cut off mid-body, a Host matched only without case or not at all, debug output). (deploy/proxy/Caddyfile.example, log default)
  • Keys can be read from a mounted directory (API_KEYS_DIR): the file is looked up by path each round and compared by inode, size and time, so a revocation renamed into place is seen without a restart; /health/private shows the digest of the file in force and a failed reload raises a critical warning and a counter. (apps/rail402/src/config.ts, API_KEYS_DIR)
Tests Residual risk. A stolen key can spend its own budget until it is revoked or expires.

Q3. One key’s budget starves the others

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Availability Threat. The sum of per-key budgets exceeds the network budget, so one heavy or compromised key consumes the network budget before other keys reach theirs. What Stellar makes different. n/a. Preconditions. A key with a large budget. Impact. Other keys’ settlements are refused until the hour moves on. Mitigations
  • Admission checks the caller’s budget and the network budget atomically with the claim; each key is capped by its own. (packages/facilitator/src/guard.ts, refusedByLedger)
  • A /health warning (operator-only for pubnet) and a metric report when the committed fees reach SPONSOR_BUDGET_WARN_PERCENT of the hourly budget. (apps/rail402/src/health.ts, sponsor_budget_high)
Tests Residual risk. Keys together can still exhaust the network budget; it is the outer bound by design.

Q4. A testnet key opens pubnet

Mitigated · Elevation of privilege · boundary TB9 (Testnet and pubnet inside one service) · asset: Access keys and quotas Threat. API keys are one process-wide set, so a key issued for testnet harnesses, CI or a tester also passes the pubnet gate. What Stellar makes different. n/a. Preconditions. Any testnet key. Impact. Mainnet settlements and fees under a key never meant for them. Mitigations
  • Each key record names the networks it may use; a request with a key not scoped to its network is refused with 403 where keys are required. (apps/rail402/src/access.ts, is not allowed on)
  • API_KEY_SHA256, whose keys are valid on every network, is refused once pubnet is enabled. (apps/rail402/src/config.ts, config_legacy_api_keys_with_pubnet)
Tests Residual risk. None.

Q5. Usage and service fees read, inflated or repriced

Mitigated · Information disclosure, Repudiation, Tampering · boundary TB2 (Seller and facilitator) · asset: Access keys and quotas Threat. A key holder reads another key’s usage through /usage, or a price change is applied retroactively to past settlements, or usage is lost so a charge cannot be justified. What Stellar makes different. n/a. Preconditions. A key; or an operator changing the price. Impact. Wrong or unjustifiable charges. Mitigations Tests Residual risk. None.

Q6. The internal discovery identity is used to pay or to dodge limits

Mitigated · Elevation of privilege, Denial of service · boundary TB2 (Seller and facilitator) · asset: Availability Threat. The key a hosted discovery front end uses to call the discovery routes with a large bucket is stolen or misused: to call /verify and /settle, to search without limits, or to charge its traffic to other users by forging the forwarded client header. What Stellar makes different. n/a. Preconditions. A leaked discovery-internal key, or any caller sending X-Rail402-Client. Impact. Payments by an identity never meant to pay; discovery load beyond the per-address limits. Mitigations
  • A discovery-internal key names no network and is refused on /verify and /settle everywhere. (apps/rail402/src/access.ts, This key may call the discovery routes only)
  • It draws on its own bounded bucket, and the forwarded client header is trusted only from it, each client with its own limit. (apps/rail402/src/app.ts, discoveryWait)
  • The discovery cost bucket honours the identity too: a request is charged to its forwarded client’s bucket and to the identity’s, never to the identity’s address. (apps/rail402/src/discovery.ts, limits.charges)
Tests Residual risk. A leaked key spends its own discovery bucket until revoked; discovery moves no money.

Key custody

How the pubnet sponsor’s keys are made, stored, controlled and funded.

K1. The sponsor seed is visible in the environment

Mitigated · Information disclosure · boundary TB10 (Operator key custody) · asset: Secrets Threat. An environment-variable seed is readable through container inspection by anyone with access to the container runtime, through the process environment by root, and in configuration dumps. What Stellar makes different. n/a. Preconditions. Access to the host’s container runtime. Impact. The pubnet sponsor seed exposed. Mitigations
  • Every secret can come from a file; with pubnet enabled the environment form is refused, files writable by group or others are refused, and the pubnet sponsor seed files must be readable by their owner only (0400 or 0600; group-readable is refused). (apps/rail402/src/secrets.ts, readSecretFile)
  • With pubnet, database URL and cursor secret files readable by others are refused, and pubnet RPC URLs that carry credentials must come from a file. (apps/rail402/src/config.ts, refuseCredentialsInEnv)
Tests Residual risk. Root on the host can still read the file or the process memory.

K2. One leaked seed controls the sponsor, every channel and the authority

Mitigated · Elevation of privilege · boundary TB10 (Operator key custody) · asset: Sponsor XLM Threat. Channels and the upto authority derive from the sponsor seed, so a leak gives control of all of them, and a single-signer sponsor lets the attacker change signers or merge the account. What Stellar makes different. Fee bumps need only the low threshold; create-account, payment and invoke need medium; signer changes and account merge need high. Preconditions. A leaked hot seed. Impact. The sponsor account taken over. Mitigations
  • Pubnet startup reads the sponsor’s signers and thresholds and refuses (or holds pubnet) unless the hot key meets medium but not high and the configured cold signer (PUBNET_SPONSOR_COLD_SIGNER) alone reaches high. (packages/facilitator/src/signers.ts, assertSignerSet)
  • The cold signer must be the only way to high: keys derived from the sponsor seed (channels, the upto authority) may not be signers, and the hot key with every other signer, pre-authorized transaction, hash-x and signed-payload signers included, stays below high. (packages/facilitator/src/signers.ts, derived from the sponsor seed)
  • Pubnet refuses to start without PUBNET_SPONSOR_COLD_SIGNER while the signer check is on, and refuses the sponsor’s own key as the cold signer. (apps/rail402/src/config.ts, config_pubnet_cold_signer_missing)
  • The leak response starts with the cold key: a reviewed, unsigned transaction from the cold account (its source and fee payer) sets the hot key’s weight to 0 on the sponsor (high threshold, cold key only), so the leaked key cannot block it through the sponsor’s sequence; a separate cold-signed sweep follows. The testnet rehearsal and the local drill bump the sponsor’s sequence with the hot key first and show the freeze applying and the hot key refused afterwards. (deploy/keys/ceremony.ts, buildFreeze)
Tests Residual risk. A leaked hot seed spends the hot balance and can settle in-flight upto payloads up to their caps until the cold key’s freeze applies.

K3. A testnet seed reused on mainnet

Mitigated · Information disclosure, Elevation of privilege · boundary TB10 (Operator key custody) · asset: Secrets Threat. An operator uses a seed that was handled with testnet care (env files, fixtures, CI) as the pubnet sponsor. What Stellar makes different. n/a. Preconditions. Seed files mixed up. Impact. The mainnet sponsor protected only as well as a test key. Mitigations
  • A pubnet sponsor key file must carry the pubnet network tag, and a file tagged for another network is refused on any network. (apps/rail402/src/secrets.ts, sponsorSeedFrom)
  • One process refuses the same sponsor for two networks. (apps/rail402/src/config.ts, each network needs its own sponsor account)
Tests Residual risk. An operator who copies a seed across tags by hand defeats the check.

K4. The cold treasury is misused or a top-up is misdirected

Accepted risk · Spoofing, Tampering · boundary TB10 (Operator key custody) · asset: Cold treasury Threat. A mistyped or substituted destination, a compromised workstation preparing the transaction, or a lost hardware wallet; the cold key also signs threshold changes. What Stellar makes different. The cold key is the sponsor’s high-weight signer: it alone can change signers or merge the account, and a payment it signs to a wrong address is final. Preconditions. Operator error, a phished address or a compromised workstation. Impact. Treasury XLM sent to the wrong account, or the sponsor’s signer set changed. Mitigations
  • Top-ups are built only to the sponsor address recorded at creation and come with a review of network, source, operations and transaction hash to compare on the device. (deploy/keys/ceremony.ts, recordedSponsor)
  • The signer setup is reviewed the same way, and check-signers confirms that only the cold key meets the high threshold. (deploy/keys/ceremony.ts, signerSetProblems)
Tests Residual risk. Operator error on the hardware wallet remains possible; amounts are small by design.

K5. Database backups leak, are altered or cannot be restored

Mitigated · Information disclosure, Tampering, Denial of service · boundary TB10 (Operator key custody) · asset: Availability Threat. Off-host copies of the database carry key digests, settlement and usage records; a backup readable or writable by the wrong party leaks data or plants records on restore, and a backup that was never restored may not restore at all. What Stellar makes different. The settlement ledger holds the recorded envelopes the reconciler needs to finish settlements after a loss; a database restored from a good point is safe because a payment already on chain can never settle again (its nonce is spent). Preconditions. Access to the backup storage or its credentials, or a host loss. Impact. Disclosure of usage and key digests, tampered records after a restore, or a database that cannot be recovered. Mitigations
  • Continuous WAL archiving with pgBackRest, encrypted with AES-256 before upload; the repository key and passphrase reach pgBackRest as a file secret, never as environment variables. The restore drill finds a marker row in the data files and nowhere in the repository. (deploy/postgres/restore-drill.sh, plaintextMarker)
  • Off-host copies are kept in two tiers that fit pgBackRest’s rewrites and expiry: versioning with a host key that cannot delete versions, and object lock on the versions. (deploy/postgres/pgbackrest.conf.example, Immutability, in two tiers)
  • A restore drill restores to a point in time, compares every table’s row count and checksum with the target, and checks that the runtime role still works. (deploy/postgres/restore-drill.sh, fingerprint)
  • Archiving failures, a growing archive backlog, a stale backup and a filling disk page the on-call. (deploy/monitoring/alerts.ts, Rail402WalArchiveFailing)
  • With archiving on for 6 hours and no completed backup listed (none taken, or the repository unreadable), the stale-backup alert pages too. (deploy/monitoring/alerts.ts, firstBackupGraceHours)
Tests Residual risk. Whoever holds the repository passphrase can read the backups. The drill uses a local repository: the off-host store and its locked retention must be exercised with the same steps before relying on them.

K6. The host’s administrator path or DNS automation token is abused

Accepted risk · Elevation of privilege, Spoofing · boundary TB17 (The host and co-located services) · asset: Secrets Threat. A container escape from a co-located service, the host administrator path, or a DNS automation token that can edit every record lets an attacker read the pubnet seed or point the facilitator’s host name at an impostor. What Stellar makes different. A hot seed spends the sponsor’s balance; an impostor facilitator can answer /supported with its own signers and refuse or misreport payments, but cannot move a payer’s funds beyond what the payer signed. Preconditions. Root on the host, or the DNS automation token. Impact. Loss of the hot balance, or buyers and sellers talking to an impostor. Mitigations
  • The pubnet seed is a file secret readable only by the service user, and the cold key keeps sole control of the sponsor account, so a stolen hot seed cannot change signers. (deploy/keys/ceremony.ts, SIGNER_PLAN)
Tests. None: this is a documented limit, not a behaviour Rail402 implements. Residual risk. Accepted while services share a host: root on the host can read the process memory, and the DNS token must be scoped and given an expiry by the operator; a dedicated host is the upgrade.

K7. The sponsor seed handled on a networked machine during setup

Mitigated · Information disclosure · boundary TB10 (Operator key custody) · asset: Secrets Threat. The one-time signer setup is signed with the hot seed; doing that on a networked workstation with the full dependency tree lets a compromised dependency capture the seed before the account has its cold signer. What Stellar makes different. Until the setup applies, the seed is the account’s only signer and meets every threshold, so whoever holds it can take the account over. Preconditions. A compromised development dependency or workstation at setup time. Impact. The new sponsor account taken over before the cold signer exists. Mitigations
  • The setup is built unsigned on the networked machine (optionally with the sequence given, without any network) and signed on the offline machine by the zero-dependency key tool, which refuses a key tagged for another network and an envelope that is already signed; only the signed XDR crosses back. (deploy/stellar-keys.ts, signEnvelope)
  • The unsigned setup and its review come from the ceremony tool without the seed. (deploy/keys/cli.ts, --unsigned)
Tests Residual risk. The offline machine and the copy of the key tool carried to it must be checked as the ceremony describes.

Releases and deploys

How code, images and packages get from the repository to production and to buyers: what a stolen credential, a careless deploy or a compromised dependency could ship.

C1. A release published without passing CI

Mitigated · Tampering · boundary TB15 (Source, release and deploy) · asset: Release integrity Threat. A version tag publishes a container image built from a commit that never passed the checks, or from a commit outside main, with nothing that proves how the image was built. What Stellar makes different. The image holds the code that sponsors fees from a funded Stellar account and decides which authorizations it submits; a broken or altered build moves the operator’s XLM and can misreport settlements. Preconditions. Push access to the repository, or a tag pushed by mistake on an untested commit. Impact. An untested or unreviewed image reaches the registry under a release version. Mitigations
  • The release workflow builds the image only after a verify job runs the full checks on the tagged commit and confirms the commit is on main. (.github/workflows/release.yml, needs: verify)
  • The published image carries a build provenance attestation and an SBOM, and its digest is written to the job summary. (.github/workflows/release.yml, actions/attest-build-provenance)
  • The service, the Explorer and the hosted MCP endpoint are released as three images from the same verified commit, each with its own provenance attestation and SBOM, and CI builds every deployable image on every change. (.github/workflows/release.yml, matrix.image.dockerfile)
Tests Residual risk. A maintainer who can change the workflow itself can still weaken it; workflow changes go through review on main.

C2. Unsigned release tags

Mitigated · Spoofing, Tampering · boundary TB15 (Source, release and deploy) · asset: Release integrity Threat. A stolen push credential creates a release tag that looks like the maintainers’ and is deployed. What Stellar makes different. Nothing Stellar-specific: the tag decides which code holds the sponsor seed of a funded account. Preconditions. A leaked push credential or a compromised workstation. Impact. An attacker’s commit is deployed as a release. Mitigations
  • A release tag is deployable only with an SSH signature from a key listed in the committed deploy/release-signers, verified with ssh-keygen against that file alone; git’s tag verification is not used, so an OpenPGP or X.509 signature that the operator’s keyring would accept is refused. (deploy/check-deployable.ts, verifySshTagSignature)
Tests Residual risk. Branch protection and required signatures are repository settings outside the code.

C3. Production deployed from a local working tree

Mitigated · Tampering · boundary TB15 (Source, release and deploy) · asset: Release integrity Threat. A deploy ships whatever is checked out on the operator’s machine: unpushed, unreviewed or CI-red code, or uncommitted edits. What Stellar makes different. Nothing Stellar-specific: the deployed process holds the sponsor seeds of both networks. Preconditions. Operator error, or a compromised operator workstation. Impact. Code that never passed review or CI serves payments on mainnet. Mitigations
  • A committed gate that the production deploy runs first: HEAD is a signed vX.Y.Z tag on origin/main, the tree is clean, every check run for the commit is green, and images are named by digest, optionally with a verified attestation. (deploy/check-deployable.ts, deployProblems)
  • The tag must be on origin as the same tag object, and every image must carry an attestation from the release workflow run for that tag. (deploy/check-deployable.ts, --source-ref)
  • A deployment can require every image it runs (facilitator, Explorer, hosted MCP endpoint) to pass the gate, and the gate prints the digest of the deploy kit kept outside the release, which the host recomputes and records with the release. (deploy/check-deployable.ts, kitDigest)
Tests Residual risk. The deploy scripts and the files a deployment keeps outside the release (compose files, host scripts and the service settings, including a pubnet network’s fee ceilings, budgets, asset minimums and cold signer) are not reviewed by the gate: it names exactly which kit shipped (its digest), and the service logs a digest of each network’s effective settings, so two deploys can be compared.

C4. A tampered npm package drains agents

Accepted risk · Tampering, Elevation of privilege · boundary TB15 (Source, release and deploy) · asset: Payer funds Threat. The SDK, CLI and MCP server hold buyer keys and enforce spending caps; a package published with a leaked token could ship a signer that ignores the caps. What Stellar makes different. A Stellar buyer key signs Soroban authorization entries directly; a malicious signer can authorize any transfer the key’s account can make. Preconditions. A leaked npm publishing token or account. Impact. Agents that install the tampered version can lose funds beyond their caps. Mitigations
  • Packages are published by hand from the tagged commit, by an npm account with two-factor authentication for publishing, after the full checks and the tarball check. (docs/operations.md, two-factor authentication)
Tests. None: this is a documented limit, not a behaviour Rail402 implements. Residual risk. Accepted for now: packages carry no npm provenance until publishing moves to CI with trusted publishing; registry compromise is out of scope.

C5. A vulnerable dependency or a re-tagged base image

Mitigated · Tampering, Elevation of privilege · boundary TB15 (Source, release and deploy) · asset: Secrets Threat. A dependency in the process that holds the sponsor seeds, or a base image whose tag was moved, carries a known vulnerability or malicious code. What Stellar makes different. The facilitator process signs fee bumps with the sponsor seed of a funded account, so code execution there is direct access to XLM. Preconditions. A published advisory in a dependency, or a compromised image registry tag. Impact. Known-vulnerable code ships, or the image changes without a commit. Mitigations
  • CI scans every lockfile with osv-scanner and the contract crates with cargo-audit; ignored advisories need a reason and an expiry. (.github/workflows/ci.yml, osv-scanner)
  • Base images and the Dockerfile syntax image are pinned by digest in every Dockerfile git tracks (an explicit list, with reasons, exempts the standalone example seller and the docs check), and every workflow action by commit. (Dockerfile, @sha256:)
Tests Residual risk. Zero-day vulnerabilities, and advisories published between scans.

Discovery cost and size limits

The Bazaar’s public read routes run searches, page through the catalog and keep index snapshots for cursors: what expensive or oversized requests could cost the shared process.

D1. Expensive searches

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Availability Threat. Unauthenticated searches each run an embedding on the CPU that settlement also needs; a flood of distinct queries, within the service-wide request limit, keeps the model busy. What Stellar makes different. Pubnet settlements share the process, so search load delays real-money payments. Preconditions. Many distinct queries from one client or many clients. Impact. Without protection: slow searches and settlements for everyone. Mitigations
  • A per-client cost bucket for discovery: an uncached search costs more than a cached one, deep offsets cost more than the first page. (apps/rail402/src/discovery.ts, searchCost)
  • A bounded least-recently-used query-embedding cache, so repeated queries run no model. (packages/search/src/service.ts, queryCacheSize)
  • An embedder concurrency cap: a query that finds the model busy is answered lexical-only, as partial results, instead of queueing. (packages/search/src/service.ts, EmbedGate)
Tests Residual risk. Results degrade to lexical under sustained load; each replica keeps its own buckets.

D2. Search index snapshots exhaust memory

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Availability Threat. Catalog growth on either network, catalog changes and cursor requests make the search index hold more memory than the process has: every listing’s content in every snapshot, many snapshots alive for their cursor lifetime, or listings written to maximise the index’s size. What Stellar makes different. Testnet catalog churn is free, and the process also serves pubnet. Preconditions. Many listings (free on testnet for originless mcp:// tools), frequent catalog changes, and a search with a cursor after each. Impact. Without protection: memory growth until the process is killed, interrupting both networks. Mitigations
  • A snapshot keeps only what ranking and filters read; a result page reads its listings from the catalog. The catalog is read in batches with a statement timeout, so a build never holds every listing’s content. (packages/search/src/service.ts, function indexed)
  • Each field indexes a bounded number of terms, and each network’s listings may take a bounded share of a snapshot (unverified listings at most half), so free testnet listings never push pubnet out of search. (packages/search/src/service.ts, maxIndexBytesPerNetwork)
  • Count and byte caps on kept snapshots, oldest superseded first (their cursors expire), with estimates calibrated against measured heap, and metrics for the snapshots and for listings left out. (packages/search/src/service.ts, maxSnapshots)
  • Each network holds a bounded number of published listings, and listings no origin confirmed (and, where set, idle ones) expire after their last settlement. (packages/bazaar/src/catalog.ts, async expire()
Tests Residual risk. Under a flood, the newest listings of the flooded network are left out of search (discovery still lists them) until older ones expire; old cursors expire early under churn.

D3. Discovery pages too large for stock clients

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Availability Threat. Listings near their per-field caps, or with many payment options, make a page exceed the 4 MiB that upstream’s withBazaar client accepts, so every stock client’s catalog listing fails, and large pages cost memory. What Stellar makes different. None. Preconditions. A seller publishing large info, schema or many options, through its own 402. Impact. Without protection: stock clients cannot read the catalog. Mitigations
  • A per-listing published-size cap and at most 8 options per listing, enforced at cataloging and at origin checks. (packages/bazaar/src/catalog.ts, listingBytes)
  • A page byte budget that ends a list or search page early; its limit, or its cursor, continues where it ended. (apps/rail402/src/discovery.ts, itemsWithin)
Tests Residual risk. None.

D4. Deep offsets and long histories scan the catalog

Mitigated · Denial of service · boundary TB4 (Facilitator and its state) · asset: Availability Threat. /discovery/resources accepts offsets up to 1,000,000, so repeated deep pages make the database scan and sort far; a listing’s version history grows with every confirmed change, so reading it whole returns tens of megabytes. What Stellar makes different. None. Preconditions. Many deep-offset requests, or a listing whose owner keeps changing it. Impact. Without protection: database load that slows settlement, which shares the database. Mitigations
  • Deep offsets cost more of the client’s discovery budget. (apps/rail402/src/discovery.ts, offsetCost)
  • A 5-second statement timeout on every list page and every page of version history. (packages/store-postgres/src/catalog-store.ts, statement_timeout)
  • Version history is read a page at a time (at most 100 versions, ended early at the page byte budget); listings and history pages spend the client’s discovery budget, and every cost-limit refusal is counted by route. (apps/rail402/src/discovery.ts, versionsCost)
Tests Residual risk. None.

D5. Discovery beyond capacity starves settlement and health checks

Mitigated · Denial of service · boundary TB2 (Seller and facilitator) · asset: Availability Threat. Discovery requests arriving faster than the process completes them (uncached searches over a large catalog, from many addresses, each within its own cost budget) pile up inside the process: every one waits for a database connection of the pool settlement uses, the event loop falls behind, and /health, /ready and /settle wait behind them; searches fail with 500 after the pool’s acquire timeout or hang until the client gives up. What Stellar makes different. One process serves testnet and pubnet: free testnet discovery load must never delay real-money pubnet settlements or take a network out of its load balancer. Preconditions. A request rate above the discovery throughput the process reaches (measured with the load-test package), spread over enough addresses to stay within the per-client limits. Impact. Without protection: settlement, health and readiness slow down or time out for every network, and discovery answers with uncoded 500s. Mitigations
  • Load shedding ahead of every limit and database read: at most DISCOVERY_MAX_IN_FLIGHT discovery requests run at once and DISCOVERY_QUEUE_LENGTH wait, each at most DISCOVERY_QUEUE_TIMEOUT_MS; the rest are refused at once with 503 discovery_overloaded and Retry-After, counted in rail402_discovery_shed_total. (apps/rail402/src/discovery.ts, class DiscoveryAdmission)
  • Discovery reads the catalog and keeps its per-address and internal-identity limits through a database pool of its own (DISCOVERY_DATABASE_POOL_SIZE connections, DISCOVERY_DATABASE_ACQUIRE_TIMEOUT_MS), so it never holds a connection settlement, limits, metering or readiness need. (apps/rail402/src/runtime.ts, discoveryDb)
  • The search index is built through a pool of its own (SEARCH_INDEX_POOL_SIZE connections, DISCOVERY_DATABASE_ACQUIRE_TIMEOUT_MS) that no request takes, so discovery load never holds a connection an index build needs. (apps/rail402/src/database-pools.ts, SEARCH_INDEX_POOL_SIZE)
  • A busy or unreachable catalog database is answered with a coded 503 (discovery_overloaded, discovery_catalog_unavailable) and Retry-After, never a 500. (apps/rail402/src/discovery.ts, discoveryFailure)
  • A result page reuses listings read within the revision read interval at the same catalog revision, so repeated results cost no database read. (packages/search/src/service.ts, pageCacheSize)
  • /health never does I/O, /ready/<network> answers from the last poll, and /ready answers from the last database probe while a new one runs. (apps/rail402/src/cached-probe.ts, staleWhileRunning)
  • Sustained shedding raises a ticket (Rail402DiscoveryShedding) naming the reason, so refused searches do not go unnoticed. (deploy/monitoring/alerts.ts, Rail402DiscoveryShedding)
Tests Residual risk. Beyond capacity, a share of discovery requests is refused with 503 and must be retried; the limits are per replica.

The hosted MCP endpoint

A public MCP endpoint offers discovery tools to remote agents, without a signing key: what a client could make it fetch, flood or carry into an agent.

H1. The hosted MCP used as a fetch proxy

Mitigated · Information disclosure, Elevation of privilege · boundary TB13 (Hosted MCP and remote agents) · asset: Operator infrastructure Threat. A remote agent asks the hosted endpoint to fetch or quote a URL, reaching internal services from inside the host’s network. What Stellar makes different. The endpoint sits next to the facilitator that holds each network’s fee sponsor key; a request it could be made to send would come from that network position. Preconditions. A public hosted endpoint. Impact. Requests to internal services or metadata endpoints. Mitigations
  • Hosted tools only search and read listings through a discovery client whose fetch refuses every origin but the configured Bazaar; no fetch, quote or pay tool is registered. (packages/mcp/src/hosted.ts, upstreamFetch)
Tests Residual risk. None.

H2. The hosted MCP started with a signing key

Mitigated · Elevation of privilege · boundary TB13 (Hosted MCP and remote agents) · asset: Secrets Threat. A deployment mistake gives the public endpoint a buyer key or token, turning it into a public wallet. What Stellar makes different. Any Stellar seed in reach of a public tool would sign authorization entries for anyone who calls it. Preconditions. A misconfigured deployment. Impact. Anyone could spend from the key. Mitigations
  • Hosted mode refuses to start (exit 78) when RAIL402_SECRET_KEY, RAIL402_SECRET_KEY_FILE or RAIL402_MCP_TOKEN is set, even empty. (packages/mcp/src/hosted.ts, resolveHostedConfig)
  • Hosted mode is dispatched before anything else loads and is built only on @rail402.dev/sdk/discovery: a running hosted process never loads the SDK’s key loading, signing guard, budget ledgers, payment flows or scheme clients, nor the local server’s payment tools; a test records the process’s module graph and fails if any appears. (packages/mcp/src/bin.ts, hostedMain)
Tests Residual risk. None.

H3. Hosted MCP calls used to flood discovery

Mitigated · Denial of service · boundary TB13 (Hosted MCP and remote agents) · asset: Availability Threat. A remote client loops tool calls, each a search, to load the Bazaar and the host shared with settlement. What Stellar makes different. Search runs in the service that also verifies and settles Stellar payments, so its cost competes with settlement. Preconditions. A public hosted endpoint. Impact. Slower or refused discovery and settlement. Mitigations
  • Per-client limit (IPv4 address or IPv6 /64), an in-flight cap answered with rpc_overloaded, a 64 KiB body limit, at most 10 results per search, a 3 s upstream timeout, and no sessions. (packages/mcp/src/hosted.ts, ClientLimiter)
  • One request carries one JSON-RPC message: a batch is refused with rpc_batch_unsupported before any tool runs, so the per-client limit and the in-flight cap bound tool calls, not just HTTP requests. (packages/mcp/src/hosted-server.ts, createHostedHandler)
  • A process-wide budget of tool calls per minute (RAIL402_MCP_UPSTREAM_PER_MINUTE, default 300, each at most one Bazaar request) answers rpc_upstream_budget itself. (packages/mcp/src/hosted-server.ts, createHostedHandler)
  • With a Bazaar discovery-internal access key (read from the file named by RAIL402_MCP_UPSTREAM_KEY_FILE, never from the environment, never logged), every upstream request carries the key and an X-Rail402-Client identifier per remote client (an HMAC of its address key under the access key), so the Bazaar budgets each remote client apart instead of charging every hosted user to the endpoint’s address. (packages/mcp/src/hosted.ts, upstreamFetch)
  • At the Bazaar, a hosted endpoint that calls with a discovery-internal key and its client in X-Rail402-Client is charged per client: each remote client has its own discovery cost budget (SEARCH_RATE_LIMIT_PER_MINUTE units, as large as a direct client’s) within the identity’s own, so one client cannot use up the others’ searches. (apps/rail402/src/app.ts, discoveryCharges)
  • TRUSTED_PROXY_HOPS has no default, so a deployment must state its proxy chain; X-Forwarded-For arriving while it is 0 is logged once and counted in rail402_mcp_warnings_total. (packages/mcp/src/hosted.ts, resolveHostedConfig)
Tests Residual risk. The limits live in one process’s memory (run one replica, or divide them by the replica count). Without an access key, all hosted users are one client of the endpoint’s address at the Bazaar and share its discovery budget; with one, each remote client is budgeted under the key’s identity, and the identity’s own limit still bounds the endpoint as a whole. A client with many addresses gets many budgets.

H4. Browsers and rebinding drive the hosted MCP

Mitigated · Spoofing · boundary TB13 (Hosted MCP and remote agents) · asset: Availability Threat. A page in a visitor’s browser calls the endpoint through DNS rebinding or with a foreign Host header. What Stellar makes different. Nothing Stellar-specific is reachable: the endpoint holds no key and no state. Preconditions. A browser visiting a hostile page. Impact. Requests counted against the visitor’s address. Mitigations
  • The Host header must be one of PUBLIC_HOSTS; there are no credentials or state, so any Origin is harmless. (packages/mcp/src/hosted-server.ts, createHostedHandler)
Tests Residual risk. None.

H5. Seller text injected into remote agents through the hosted MCP

Accepted risk · Spoofing, Tampering · boundary TB13 (Hosted MCP and remote agents) · asset: Agent budgets Threat. Listing text served by the hosted endpoint carries instructions aimed at the remote agent. What Stellar makes different. An agent steered by listing text may pay a Stellar account it should not, with its own key elsewhere. Preconditions. A seller with a listing in the Bazaar. Impact. A misled agent, within its own caps. Mitigations
  • The hosted tools use the same bounded result shapes as the local server, and their descriptions and instructions mark seller text as untrusted data. (packages/mcp/src/results.ts, searchResult)
Tests Residual risk. Agents still read seller text (M5).

Explorer indexing

The Explorer reads public ledgers and counts x402 settlements under published indexing rules: what forged events, spoofed attribution or bad ledger data could do to its numbers.

I1. A fake upto_settled event counted as a payment

Mitigated · Spoofing, Tampering · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Explorer and report integrity Threat. Any contract can emit an event with the upto_settled topic and plausible data, or emit it during a call to the real settlement contract. What Stellar makes different. Contract events carry the emitting contract’s id, but nothing stops another contract from choosing the same topic and data. Preconditions. Any account that can deploy a contract. Impact. Without protection: invented upto payments, payers and sellers in the Explorer and the report. Mitigations
  • R-UPTO counts only a settle call on a registry contract, reads only the upto_settled event that contract emitted, refuses a registry contract whose instance runs other WASM, and checks the token transfer against the event. (packages/x402-index/src/rules/upto.ts, fromRegistryContract)
Tests Residual risk. None.

I2. A fake SAC asset topic

Mitigated · Spoofing · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Explorer and report integrity Threat. A custom SEP-41 token emits transfer events whose fourth topic says USDC with Circle’s issuer. What Stellar makes different. The asset topic is data the token contract chooses; only a Stellar Asset Contract’s id is derived from its asset. Preconditions. Any account that can deploy a token contract. Impact. Without protection: worthless tokens shown and totalled as USDC. Mitigations
  • An asset is verified only when Asset(code, issuer).contractId(passphrase) equals the emitting contract; otherwise it is a custom token with no code or issuer. (packages/x402-index/src/asset.ts, verifySacAsset)
Tests Residual risk. None.

I3. Attribution spoofed or inflated

Mitigated · Spoofing, Repudiation · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Explorer and report integrity Threat. Accounts get into the registry without evidence, a shared relayer’s other traffic is counted as x402, attribution follows discovery time instead of the ledger, or unattributed look-alikes are added to the headline. What Stellar makes different. The exact scheme leaves no x402 marker on chain: any sponsored single transfer with the payer’s address authorization has the same shape. Preconditions. A registry change, or transactions shaped like x402 settlements. Impact. Without protection: facilitators credited with payments they did not settle, and inflated network totals. Mitigations
  • Registry entries need public evidence archived under its SHA-256 and an epoch and ledger range; one address belongs to one facilitator per ledger; the shaped tier is never a registry tier. (packages/x402-index/src/registry.ts, registrySchema)
  • Attribution looks accounts up by epoch and ledger, never by when an entry was added; unmatched settlements are labelled shaped. (packages/x402-index/src/attribution.ts, attribute)
  • Settlements through the concluded beta’s contracts (rule R-UPTO-BETA, WASM checked on chain) are labelled beta history whoever submitted them, so Rail402’s own beta never lands on the unattributed line; every beta contract’s range ends at the beta’s end, so later calls through the still-callable contracts are not beta history. (packages/x402-index/src/attribution.ts, betaAttribution)
  • Rows of a facilitator marked sharedRelayer carry attribution.sharedRelayer, and the totals show that part of the headline on its own line (headlineSharedRelayer), on the report and in aggregates.json. (apps/explorer/src/rebuild/aggregates.ts, headlineSharedRelayer)
  • Totals keep the rail402 and facilitator tiers in the headline and report shaped matches, the concluded beta and self-payments apart. (apps/explorer/src/rebuild/aggregates.ts, HEADLINE_TIERS)
  • Every account the hosted service’s /supported advertises (signers and the upto settlement authority) must have an open entry of the rail402 facilitator before it settles; registry-check —hosted-<network> checks it at launch and after every rotation. (apps/explorer/src/registry-check.ts, checkHostedAccounts)
Tests Residual risk. Shaped matches stay heuristic and are labelled as such; a shared relayer’s rows can include transfers that were not x402 payments, which each row and the totals’ own line say.

I4. Tampered or truncated ledger data

Mitigated · Tampering · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Explorer and report integrity Threat. Ledger bytes from the public data lake or Lumeus RPC are altered, swapped, replayed or invented, planting or hiding settlements. What Stellar makes different. Each ledger header commits to the previous ledger’s hash, to its transaction set and to its results. Metas are not hashed by the header, but a successful contract call’s result records the SHA-256 of its return value and events, so events are bound to consensus through the result. Preconditions. Control of, or a man in the middle on, a ledger source. Impact. Without protection: invented or missing settlements that look rebuildable. Mitigations
  • Every ledger read must hash to its own header, its transaction set and results must match the header’s hashes, and it must be the ledger asked for; a failure marks the ledger failed and stops the indexer. The full-scan rebuild also requires each ledger’s previous hash to be the last verified ledger’s hash. (apps/explorer/src/pipeline.ts, indexSingle)
  • Before reading a successful candidate’s events, the classifier recomputes SHA-256 of InvokeHostFunctionSuccessPreImage { returnValue, events } from the meta and requires the operation result’s success hash; a mismatch stops the indexer (events_unbound). The upto event must also equal the signed settle(payer, terms, amount) arguments. (packages/x402-index/src/integrity.ts, assertEventsBound)
  • Independent anchors: the indexer commits a ledger, so serves and reports its rows, only after its hash matched a Horizon with full history (required on pubnet); a different hash marks the ledger failed and stops the indexer, and the anchors checked are stored and listed in the published manifest. The rebuild checks every anchor it is given and refuses one it cannot check. (apps/explorer/src/indexer/ingester.ts, async #anchor()
  • Lumeus RPC getLedgers answers are checked ledger by ledger: each ledger’s own header must name the sequence it is listed under. (packages/ledger-source/src/rpc.ts, headerSequence(meta) !== sequence)
  • The data lake reader is pinned to one https host, refuses redirects, caps object and decompressed sizes, and checks each object holds exactly the ledger asked for. (packages/ledger-source/src/lake.ts, decodeLakeObject)
  • The report covers the range only up to the first candidate ledger that is not indexed yet or failed, says where and why it stops, and is not marked reproducible while a ledger is failed. (apps/explorer/src/api/report.ts, coverageOf)
  • A live lookup is answered only when the RPC’s envelope hashes (outer, or inner for a fee bump) on the network include the requested hash; otherwise explorer_lookup_unavailable. (apps/explorer/src/web/live-lookup.ts, answersFor)
Tests Residual risk. Ledger-entry changes in the meta (used only for the upto WASM check) are not bound by the result hash; a registered upto contract cannot be upgraded, so a forged instance entry can only exclude a row, never add one. Live single-transaction lookups come from one RPC answer bound to the requested hash, whose result is not checked against a ledger header. Registry-scope ledgers are verified one by one and not chained to each other: on testnet with anchors turned off, a dishonest byte source could serve an invented, self-consistent ledger; pubnet refuses to run without anchors.

I5. Hostile XDR crashes or stalls the classifier

Mitigated · Denial of service · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Availability Threat. Corrupt or unusual envelopes, results or metas make the classifier throw, allocate without bound, or read an unknown meta version as an empty transaction and skip it. What Stellar makes different. A protocol upgrade can introduce a new transaction meta version that an older XDR library does not know. Preconditions. Any transaction on the network, or a corrupted ledger object. Impact. Without protection: a stalled indexer, or settlements silently missing after an upgrade. Mitigations
  • The classifier returns malformed for base64 that does not decode and none for an envelope that does not read, bounds its output, and throws only coded errors that stop the indexer at that ledger: an unknown meta version, an undecodable ledger, or events that do not hash to their result. (packages/x402-index/src/classify.ts, classifyTransaction)
  • A ledger whose candidate transactions have no result, or that does not decode, raises a coded error instead of being skipped. (packages/x402-index/src/ledger.ts, LedgerDecodeError)
  • Bytes an attacker chooses never reach a row as they are: a CAP-67 to_muxed_id is taken only as a u64 (a text or hash memo form is transfer_event_mismatch in every rule), and every row field must have its expected shape and be text without NUL, valid as UTF-8 and bounded, or the transaction is excluded as malformed, so a hostile transaction is counted and never stops a commit. (packages/x402-index/src/storable.ts, unstorableFields)
Tests Residual risk. None.

I6. Gaps, epochs and lag hide or duplicate rows

Mitigated · Repudiation, Tampering · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Explorer and report integrity Threat. A missed range, a testnet reset that reuses ledger numbers, a replayed or broken discovery walk, a bounded run that ends before ledgers already found, a rebuilt discovery index, or a stalled tail makes the Explorer silently incomplete, double-counts rows or merges two epochs. What Stellar makes different. Testnet resets start ledger numbers again; transaction hashes include the network passphrase, which testnet keeps. Preconditions. A testnet reset, a crash or failure mid-walk, a second indexer on the same database, a bounded run, a registry change, or a discovery index rebuild. Impact. Without protection: wrong totals with no visible sign. Mitigations
  • Rows are keyed by (network, epoch, transaction hash) and written as upserts. A testnet reset is a new discovery generation whose head is more than 1,000 ledgers behind the indexed candidates: it stops the indexer before anything of the new network is stored, until the new epoch is registered; a head that is only behind (a lagging replica, or a source without a new generation) and anything on pubnet is counted and logged, never a stop. A bounded run that cannot discover or read a ledger through its end exits non-zero (range_incomplete). (apps/explorer/src/epoch.ts, export function isReset)
  • Every discovery page’s candidate ledgers and the checkpoint it vouches for (the ledger before its last record, or scanned_through_ledger at the end of a window; records must come in ascending order) are stored in one transaction, so a failure loses at most the page under way; candidates are upserts, the checkpoint only moves forward, and a ledger is committed only while it is pending, so a restart or a second indexer never loses or repeats one. (apps/explorer/src/store.ts, async recordWindow)
  • Routes keep their registry bounds only: a bounded run’s last ledger bounds its walks and is never stored, so a later run resumes where it stopped; a registry range that ends before a route’s checkpoint moves the checkpoint back to its end, so a widened range is walked again. (apps/explorer/src/store.ts, Walked past)
  • A discovery answer under another generation or decoder than the route’s last page walks the route again from its first ledger, so records the source added or corrected in a rebuild are found. (apps/explorer/src/indexer/ingester.ts, async #newReadView)
  • Routes follow the registry: added accounts are walked from their first ledger, removed ones are dropped with the ledgers only they listed and those ledgers’ rows; ledgers indexed under older rules or upto contracts are read again, and rows under an older registry version are re-attributed in place with the classifier’s own attribution function. (apps/explorer/src/store.ts, reconcileRegistry)
  • Lag (the discovery source’s head minus the ledger every route has walked), Lumeus request and error counts, candidate ledgers by status and failure metrics; health is degraded while behind and stopped after a failure. (apps/explorer/src/metrics.ts, rail402_explorer_lumeus_requests_total)
  • Commits refresh the daily and per-account totals under a transaction-scoped advisory lock per network and epoch, so commits and removals that touch the same seller or day take turns. (apps/explorer/src/store.ts, lockTotals)
Tests Residual risk. None.

I7. A compromised Explorer reaches the facilitator

Mitigated · Elevation of privilege, Information disclosure · boundary TB9 (Testnet and pubnet inside one service) · asset: Secrets Threat. The Explorer is public and parses attacker-chosen data; if it shared the facilitator’s database or role, a compromise would read the settlement ledger and API keys or alter them. What Stellar makes different. Every byte the indexer parses comes from public ledgers, where anyone can place transactions. Preconditions. A code-execution or SQL bug in the Explorer. Impact. Without protection: the facilitator’s records and keys exposed through the public Explorer. Mitigations
  • A separate database with an owner, a writer and a reader role; the reader is SELECT-only with read-only transactions and a statement timeout; no Explorer role may connect to the facilitator’s database. (apps/explorer/sql/roles.sql, REVOKE CONNECT ON DATABASE)
  • Each process checks its role at startup and refuses superusers, role creators and any role that can reach the facilitator’s database; the reader check also requires read-only, SELECT-only access with a timeout. The indexer holds no keys. (apps/explorer/src/roles.ts, assertReaderRole)
  • The reader’s statement timeout is enforced by the client: each statement carries statement_timeout, and one still running after it is cancelled with pg_cancel_backend, so SET statement_timeout = 0 does not lift it. The writer cannot modify schema_migrations, and the indexer refuses a writer that can. (apps/explorer/src/db.ts, cancelBackend)
Tests Residual risk. Both databases share one Postgres cluster, so a cluster-level exploit crosses them.

I8. Published totals cannot be reproduced

Mitigated · Repudiation · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Explorer and report integrity Threat. Report numbers change between runs or are edited, and nobody can show how they were derived. What Stellar makes different. Public ledgers are permanent and readable by anyone, so every number can be derived again from them. Preconditions. Any published total. Impact. Without protection: totals that have to be taken on trust. Mitigations
  • The rebuild command writes canonical NDJSON sorted by position, aggregates and a manifest with the rules and registry versions, the ledger range and hashes, per-partition row hashes and file hashes; the same inputs give the same manifest hash. (apps/explorer/src/rebuild/rebuild.ts, writeManifest)
  • A registry-scope report’s manifest lists every ledger it read with its hash; `pnpm explorer:rebuild —ledgers-from manifest.json` reads those ledgers from the public data lake, with no discovery source, and writes the same manifest. (apps/explorer/src/rebuild/rebuild.ts, rebuildLedgers)
  • The report’s network-wide block is a full-scope rebuild of a recent window by the same code; it prints its `pnpm explorer:rebuild —from —to` command (with `—anchor-horizon` when anchored) and its manifest is served at /api/v1/{network}/network-window/manifest, so anyone can rebuild that exact window and compare the hash. (apps/explorer/src/window/window.ts, runNetworkWindow)
Tests Residual risk. None.

I9. Indexing load starves the facilitator

Mitigated · Denial of service · boundary TB17 (The host and co-located services) · asset: Availability Threat. Indexing every ledger (hundreds of gigabytes of downloads and tens of CPU-hours for pubnet history) runs on the host and database cluster the facilitator uses. What Stellar makes different. Settlement latency matters: an x402 payment waits for the facilitator’s answer. Preconditions. An indexer running beside the facilitator. Impact. Without protection: slower or failing settlements while history is indexed. Mitigations
  • The indexer never reads every ledger: discovery selects the ledgers that hold transactions of registry accounts and upto contracts, and only those are read, one object or one getLedgers page at a time. The full scan is a separate command run where its load does no harm. (apps/explorer/src/indexer/discovery.ts, discoveryPlan)
  • Discovery and ledger reads share one limit of at most 8 requests in flight, as Lumeus asks for history walks; settings above it are refused. (packages/ledger-source/src/lumeus.ts, LUMEUS_MAX_CONCURRENCY)
  • Ledger reads hold at most EXPLORER_BYTES_IN_FLIGHT_MIB (64 MiB) of raw fetched bytes, size getLedgers pages to half of it and decode one ledger at a time, releasing it before the next, so a busy stretch of large ledgers cannot exhaust the indexer’s memory; the bytes held are exported as rail402_explorer_ledger_bytes_in_flight. (apps/explorer/src/indexer/bytes.ts, maxBytesInFlight)
  • The network-wide window is its own process, off unless EXPLORER_NETWORK_WINDOW_HOURS is set (at most 168 hours). Each run has a time budget, a download budget (required explicitly on pubnet) and a row budget, reads the data lake within a byte budget with one decoded ledger at a time and rows streamed to files it removes, and keeps the last published window when a budget stops it. It reads no Lumeus product and nothing of the facilitator. (apps/explorer/src/config.ts, networkWindowConfig)
Tests Residual risk. A registry facilitator with very busy accounts (a shared relayer) makes discovery read more ledgers; CPU and memory limits for the indexer’s container are set where it is deployed.

I10. Discovery leaves out or invents candidate ledgers

Mitigated · Tampering, Repudiation · boundary TB19 (The Lumeus discovery source) · asset: Explorer and report integrity Threat. The discovery source, or someone between it and the indexer, leaves ledgers out of an account’s or contract’s activity, lists ledgers that hold nothing, or answers for another route, window or network. What Stellar makes different. Activity records are decoded data a service computes from ledgers; nothing on chain commits to them. The ledgers themselves are bound by their hashes. Preconditions. A faulty or dishonest discovery source, or control of the connection to it. Impact. Without protection: invented settlements, settlements silently missing from pages and totals, or unbounded reads (billed on mainnet) of ledgers a source lists. Mitigations
  • Discovery only selects ledgers: every row comes from a ledger read in full, verified against its own hashes (and anchors where configured) and classified by the unchanged rules, so discovery cannot create a settlement that is not on chain. A listed ledger that holds no registry transaction adds only that ledger’s own real rows (unattributed look-alikes, failed attempts, exclusion counts); the manifest lists it and the report counts such ledgers (ledgersWithoutAttributedRow). (apps/explorer/src/pipeline.ts, indexSingle)
  • Activity pages are checked: the first page pins the read view and later pages must keep it, every record must lie inside the requested window, the page must be for the indexer’s network, and next links must stay on the same origin and route. (packages/ledger-source/src/lumeus.ts, function parsePage)
  • The report states its scope and lists every ledger read; the full-scan audit command reads every ledger of the range from the public data lake, and its attributed rows must equal the report’s, which shows an omission. (apps/explorer/src/api/report.ts, auditCommand)
  • Each upto contract whose settlements emit an event has its own contract route; a concluded beta contract, which emits no event and moves no funds itself (its contract activity is empty), is found through topic search for the token approve events that name it as the spender, which each of its settlements carries in the same transaction. (apps/explorer/src/indexer/discovery.ts, R-UPTO-BETA)
  • A route adds at most EXPLORER_MAX_CANDIDATES_PER_ROUND new candidate ledgers per round and continues next round, counted in rail402_explorer_candidates_capped_total; candidates with no attributed row are counted in rail402_explorer_candidates_unattributed_total. (apps/explorer/src/indexer/ingester.ts, maxCandidatesPerRound)
  • The report counts only rows of the ledgers its manifest lists, whatever else the tables hold, and the move to registry scope removes every row, total and report of the earlier full scan; a stored report of another scope or manifest version is never served. (apps/explorer/src/api/report.ts, Only rows of the listed ledgers count)
Tests Residual risk. An omission shows only in the full-scan audit. A settlement whose fee payer is no registry account and that does not go through a registry upto contract is not discovered (indexing rules §12); a beta settlement whose transaction carries no approve event naming its contract is found only when another route lists its ledger (none in a sample of 16 of the 105 known); network-wide exact-scheme look-alikes are not measured live.

I11. The Lumeus key leaks or reaches another host

Mitigated · Information disclosure · boundary TB19 (The Lumeus discovery source) · asset: Secrets Threat. The Lumeus server key is set inline in the environment, logged, sent to a host that is not Lumeus (a configured URL, a next link, a redirect), or a testnet key is used against mainnet hosts or the reverse. What Stellar makes different. Lumeus keys are per network: lum_test_ for testnet, lum_live_ for mainnet; one key covers Activity and RPC. Preconditions. A misconfiguration, a hostile next link or redirect, or access to logs or the process environment. Impact. Without protection: a stolen key spends the organisation’s Lumeus credits. Mitigations
  • The key is read only from a file (EXPLORER_LUMEUS_KEY_FILE, EXPLORER_<NETWORK>_LUMEUS_KEY_FILE); an inline key is refused, and no error repeats it. (apps/explorer/src/config.ts, export function lumeusKey)
  • The key is sent only to the network’s own Lumeus host for that product: Activity and RPC URLs are checked against an allow-list, and a key’s prefix must match the network. (packages/ledger-source/src/lumeus.ts, export function lumeusEndpoint)
  • RPC clients (the ledger source and the web live lookup) attach the key only for the Lumeus RPC host of its network and refuse any other pairing; next links to another origin and redirects are refused. (packages/ledger-source/src/rpc.ts, a Lumeus key is sent only to the Lumeus RPC host of its network)
  • The internet-facing web role takes its own key for live lookups: a read-access server key or a publishable key (lum_pub_…, read-only RPC, sent with the Explorer’s origin), so a web compromise does not expose the indexer’s key; the indexer refuses publishable keys. (apps/explorer/src/web/live-lookup.ts, a publishable Lumeus key needs the https origin it is allowed for)
Tests Residual risk. Anyone who can read the key file on the host can use the key; keep a monthly credit cap on the Lumeus organisation and rotate the key there.

I12. The discovery source is unavailable, throttled or reindexed

Mitigated · Denial of service · boundary TB19 (The Lumeus discovery source) · asset: Availability Threat. Lumeus Activity or RPC answers 429 or 5xx, asks to wait until a daily cap resets, times out on a heavy window, rebuilds its index under a new generation, or puts arbitrary codes and error text in its answers. What Stellar makes different. Discovery reads history by ledger range; a testnet reset also changes the generation and starts ledger numbers again. Preconditions. Any outage, rate limit or index rebuild of the discovery source. Impact. Without protection: a stalled or crashing indexer, hammering a throttled service, or a walk stitched from two read views. Mitigations
  • 429 and 5xx answers are retried a bounded number of times after Retry-After; a Retry-After over 60 s stops the walk instead of waiting; query_timeout is never repeated unchanged (the window narrows and resumes after the last page stored); generation_changed restarts there without the old read view. (packages/ledger-source/src/lumeus.ts, async *walkRange()
  • A transient discovery failure keeps the route’s checkpoint and is retried in the next round (after the Retry-After the source asked for); the report and health show the lag meanwhile. (apps/explorer/src/indexer/ingester.ts, discovery failed for now)
  • Ledger reads through Lumeus RPC follow Retry-After too, never wait more than 60 s, and a longer one pauses every ledger read until then instead of retrying each round. (packages/ledger-source/src/http.ts, export function retryAfter)
  • Metric labels for Lumeus failures come from a fixed set of documented codes (anything else is other), and health shows only the stable code of a stop, never remote error text. (packages/ledger-source/src/lumeus.ts, export function lumeusCodeLabel)
  • A candidate whose bytes or anchor are not available yet waits (15 s, doubling, at most an hour) without holding back newer candidates, and anchors are read in Horizon /ledgers pages for runs of nearby ledgers; the report still stops before a waiting ledger. (apps/explorer/src/store.ts, async deferLedger)
  • At the head, channel and settlement-authority routes, which Lumeus lists only when they pay a fee or move funds, are walked every EXPLORER_SLOW_ROUTE_ROUNDS rounds instead of every round, bounding empty polls (billed on mainnet). (apps/explorer/src/indexer/discovery.ts, FEE_PAYING_ROLES)
Tests Residual risk. While discovery is down the Explorer falls behind and its health is degraded; new payments still open through live lookups while the RPC answers. Discovery resumes from every checkpoint, so nothing is lost.

I13. A payer named for a transfer it never authorized

Mitigated · Spoofing, Repudiation · boundary TB11 (Ledger sources and the Explorer indexer) · asset: Explorer and report integrity Threat. Someone deploys a token whose transfer never calls from.require_auth() and lands a sponsored transfer whose one authorization entry names a chosen account, unsigned or with a signature that does not verify, so that the Explorer shows that account paying a chosen seller. What Stellar makes different. The host authenticates an address authorization entry, and consumes its nonce, only when a contract calls require_auth for that address; no check covers entries that no contract asked for. A Stellar Asset Contract’s transfer always calls from.require_auth(); any other token’s own code decides. Preconditions. Any account that can deploy a token contract and pay a transaction fee. An indexed row also needs its ledger read (a registered facilitator relaying it, or registry activity in the same ledger); a live lookup reads it directly. Impact. Without protection: an arbitrary account shown as the payer on its account page, the payment page and the API and, through a facilitator that relays any asset, counted in the headline payments and distinct payers. Mitigations
  • R-EXACT names a payer only when consensus-bound data proves its authorization (check E7): the token is a verified Stellar Asset Contract, or the payer’s own key signed the entry; anything else is excluded as unproven_authorization, and E3 and E4 describe only the entry’s fields. (packages/x402-index/src/rules/exact.ts, unproven_authorization)
  • The signature check rebuilds the payload the network signs (the HashIdPreimage of Address or AddressV2 credentials on this network), requires the form the network checks for an account (1 to 20 signatures, strictly ascending keys) with the payer’s own key among them and an expiration ledger not before the transaction’s, verifies that key’s signature only (one check per transfer, whatever the entry carries), and never proves a contract payer. (packages/x402-index/src/authorization.ts, export function signedByPayer)
  • The rules version moved to 2, and the indexer reads every ledger indexed under another rules version again when it starts, so no row of the earlier rules stays in the index. (apps/explorer/src/store.ts, async resetStale)
  • Until then, and for epochs the indexer no longer reads, the Explorer’s reads leave out rows of other rules, its account totals while the epoch holds such ledgers, and reports or network windows of other rules; a transaction of such a row is looked up and classified again. (apps/explorer/src/api/queries.ts, #settlements())
  • The SDK’s inspectTransaction and rail402 tx say an exact payer authorized the transfer only when a Stellar Asset Contract’s transfer or the payer’s own signature proves it. (packages/x402-index/src/shape.ts, not proven by the chain)
Tests Residual risk. A Stellar account’s signers, weights and thresholds are ledger state the classifier does not read: in a token other than a Stellar Asset Contract the payer’s own key counts whatever its weight, and accounts that authorized only through other signers, like contract payers of such tokens, are excluded rather than shown. Such a token never consumes the nonce either, so an entry the payer really signed can land again until it expires, and each copy is a row.

Explorer public pages

The Explorer’s pages and read API show on-chain data to anyone: what hostile strings, expensive queries, live lookups or caching could do to visitors and to the service.

W1. Script injected through on-chain strings

Mitigated · Tampering, Elevation of privilege · boundary TB12 (Explorer public pages and read API) · asset: Explorer and report integrity Threat. Token asset topics, contract arguments, result codes and registry text reach the pages; an attacker who controls them tries to inject HTML or script into a visitor’s browser. What Stellar makes different. Anyone can deploy a token whose events carry arbitrary strings, and memos and arguments are chosen by whoever builds the transaction. Preconditions. A transaction the indexer or a live lookup classifies, or a crafted request path. Impact. Without protection: script running on the Explorer’s origin, rewriting what an auditor sees. Mitigations
  • Pages are built only from escaping Hono JSX nodes, with no raw-HTML helper anywhere in the web sources; links are rendered only for https URLs; every response carries a strict Content-Security-Policy (own script and stylesheet only, no inline code, no plugins, no framing) and no-transform; no third-party script, unless EXPLORER_ANALYTICS_SITE_ID is set, which adds only one pinned analytics tracker release, with its integrity value, and its gateway in script-src and connect-src. The one raw text is the compile-time stylesheet inlined into the standalone snapshot, through a function that takes no input. (apps/explorer/src/web/csp.ts, CONTENT_SECURITY_POLICY)
Tests Residual risk. None.

W2. Look-alike addresses, bidirectional text and fake assets

Mitigated · Spoofing · boundary TB12 (Explorer public pages and read API) · asset: Explorer and report integrity Threat. Addresses that share prefixes and suffixes, bidirectional or zero-width characters in strings, a token that names itself USDC, or an upto_settled event from an unregistered contract make one party or asset look like another. What Stellar makes different. Vanity strkeys with matching ends can be ground; asset topics and event topics are data the emitting contract chooses. Preconditions. Any account that can submit transactions or deploy a contract. Impact. Without protection: an auditor credits the wrong seller, facilitator or asset. Mitigations
  • Control, zero-width, bidirectional, Hangul filler and tag characters are stripped from every displayed string; full strkeys are shown on detail pages and carried in the title, label and copy button wherever a table shortens them; the verified badge comes only from the SAC contract-id rule and fake upto events are shown as not a settlement, through the same classifier as the index. (apps/explorer/src/web/text.ts, displayText)
  • Account totals list at most 100 assets per side (paid and received apart), verified Stellar assets first, then by payments, and say how many more each side has, so payments in throwaway tokens cannot hide the other side or a verified asset without notice. (apps/explorer/src/api/queries.ts, TOTALS_PER_SIDE)
Tests Residual risk. None.

W3. Expensive queries against the Explorer API

Mitigated · Denial of service · boundary TB12 (Explorer public pages and read API) · asset: Availability Threat. Deep pages, unindexed filters and floods of requests load the database the indexer also writes. What Stellar makes different. Not Stellar-specific: the Explorer is a public, unauthenticated service. Preconditions. Network access to the Explorer. Impact. Without protection: slow pages for everyone and a stalled indexer. Mitigations
  • Keyset pages only (offset refused), limit at most 100, unknown parameters refused so filters stay on indexed columns, cursors bound to their list, a per-client rate limit with Retry-After, and the reader role’s statement timeout, checked at startup. (apps/explorer/src/api/paging.ts, keyset)
  • Bounded database use: a 2 s wait for a pool connection and at most 32 requests in flight, beyond which the answer is 503 explorer_unavailable with Retry-After; account totals are read from per-account totals the indexer maintains, never aggregated per page view; the report is computed once per interval by the indexer and only read by web processes; /health shares one database check, given one second, among all requests in any two seconds. (apps/explorer/src/web/app.ts, maxInFlight)
Tests Residual risk. The rate limit is per process (keyed by IPv4 address or IPv6 /64) and resets on restart; the edge proxy’s limits stay in front.

W4. Live lookups amplify RPC use

Mitigated · Denial of service · boundary TB12 (Explorer public pages and read API) · asset: Availability Threat. Each hash the index does not hold triggers an RPC getTransaction; random hashes would turn the Explorer into an RPC load generator. What Stellar makes different. Public RPC providers rate-limit per caller; the facilitator’s own settlement provider must not share that load. Preconditions. Network access to the Explorer. Impact. Without protection: the Explorer’s RPC quota exhausted, or a shared provider throttled. Mitigations
  • Hash syntax checked first, a negative cache for unknown hashes and a 60 s cache for found ones, concurrent lookups of one hash share one call, a per-client budget (IPv4 address or IPv6 /64) checked before the network’s global budget and refunded when the global budget refuses, a quarter of the global budget kept for clients’ first lookup in a minute, and a lookup RPC configured apart from any settlement provider (off on pubnet unless set). (apps/explorer/src/web/live-lookup.ts, lookupBudget)
Tests Residual risk. Many distinct clients together can still use up the global budget for a minute; live lookups then degrade to 429 while indexed pages keep working.

W5. A live or outdated page cached as final

Mitigated · Tampering, Repudiation · boundary TB12 (Explorer public pages and read API) · asset: Explorer and report integrity Threat. A live-lookup answer, a not-found answer or a page rendered under an older rules or registry version is cached for a year by browsers and proxies. What Stellar makes different. Closed ledgers are final, so indexed settlements may be cached for long; live answers are not indexed yet. Preconditions. A caching proxy or browser between the Explorer and its visitors. Impact. Without protection: stale attribution or a missing payment shown long after it changed. Mitigations
  • No page is immutable: an indexed settlement is cached for an hour only when its row carries the served registry version, and briefly otherwise; a row of other rules is not shown at all; its ETag names the row’s own versions, so a re-attribution is seen on revalidation. Lists and the report get short lifetimes; live lookups, not-found answers and errors are no-store and labelled. (apps/explorer/src/web/cache.ts, cacheHeaders)
Tests Residual risk. A browser or proxy may show an attribution up to an hour old after a registry change.

W6. The Explorer used as an open redirect

Mitigated · Spoofing · boundary TB12 (Explorer public pages and read API) · asset: Explorer and report integrity Threat. A redirect that copies part of the request path into Location sends visitors from the trusted Explorer domain to a look-alike site, for example through /public//evil.example/. What Stellar makes different. Not Stellar-specific: auditors follow Explorer links from CLIs, SDK output and payment receipts. Preconditions. A link to the Explorer with a crafted path. Impact. Without protection: a phishing page that looks like the audit aid. Mitigations
  • Alias redirects strip every leading slash and backslash and always answer a same-origin path; other redirects are built only from validated hashes and strkeys. (apps/explorer/src/web/app.ts, Only a same-origin path)
Tests Residual risk. None.

W7. One visitor’s refused Bazaar call blanks Bazaar data for everyone

Mitigated · Denial of service · boundary TB12 (Explorer public pages and read API) · asset: Availability Threat. The Explorer’s Bazaar calls are charged to each visitor’s forwarded budget, but its answers are cached for every visitor. A visitor who spends their own budget would turn each refusal into a cached ‘Bazaar down’ that every other visitor then sees. What Stellar makes different. n/a. Preconditions. A visitor over their forwarded discovery budget who keeps requesting pages. Impact. Without protection: pages without listings, services or paid-for links for every visitor. Mitigations
  • A 429, or a 503 with Retry-After, is an answer for this visitor only: the page renders without Bazaar data and nothing is cached, like a call cut short by the page’s deadline. (apps/explorer/src/web/bazaar.ts, a refusal of this visitor's budget)
Tests Residual risk. A real Bazaar outage (5xx without Retry-After) is still kept for 5 seconds for everyone, so a down Bazaar is not asked once per visitor.

Pubnet conformance runs

The conformance harnesses can run against pubnet with a treasury that funds per-run accounts: what a harness, a crash or the third-party suite it starts could do with real funds.

CF1. Run funds stranded in accounts nobody can sign for, or that a stranger can sign for

Mitigated · Denial of service, Elevation of privilege · boundary TB18 (Conformance harness and the treasury) · asset: Harness treasury Threat. A pubnet run funds smart accounts whose owner key is random and dropped, merges nothing, or stops on an exception or Ctrl-C before returning funds, and still reports the sweep as done; or a run account that whoever holds its key merged away is skipped as if it had never been created. Or a stranger makes itself the owner of a funded smart account (one whose owner is set by a call after it is created, which anyone can repeat), signs a transfer of its USDC to itself, and the sweep finds nothing to return. What Stellar makes different. A contract account moves its USDC only with its owner’s signature through __check_auth, and its own code decides whose signature that is; a constructor runs inside the transaction that creates the contract, so no other transaction can come first. A G account keeps its reserves until it is merged. Preconditions. Any pubnet run with smart-account cases, an RPC error, a suite crash or an interrupt. Impact. Without the controls: USDC and reserves lost on every run, or taken by a stranger, while the evidence claims they came back. Mitigations
  • Every run account and smart-account owner key is derived from the treasury seed and a role, and written to the run’s owner-only registry (addresses and derivation paths, no secret) before it is funded; a contract account the run does not track, or whose owner it did not derive, is never funded. (tools/conformance/src/network.ts, contractOwner)
  • The smart-account payer is a contract built in this repository whose constructor binds the derived owner key in the transaction that creates it; it exports no other function that writes state, so the key cannot be set first or changed afterwards. (contracts/testing/ed25519-account/src/lib.rs, __constructor)
  • Before the treasury sends USDC to a contract account, the run reads the account on chain and refuses it unless it runs the fixture account’s code with the run’s derived key as owner, or the OpenZeppelin smart account’s code; a ledger it cannot read refuses too. (tools/conformance/src/network.ts, pubnet_contract_owner_unverified)
  • Sweep-back returns the USDC of every run account and smart account (authorised by the derived owner), merges the run accounts, then reads every balance again and fails the sweep-back case when anything is left, naming how much. (tools/conformance/src/network.ts, SWEEP_DUST)
  • A run account the run saw on the network that is gone at the sweep (merged by whoever holds its key) fails the sweep; only an account the run never created is passed over. (tools/conformance/src/network.ts, merged outside the run)
  • Sweep-back runs once whatever happens: after the body, after an exception (rethrown afterwards) and on SIGINT or SIGTERM before the process exits. (tools/conformance/src/network.ts, withRun)
  • After a crash, the registry is enough to return the funds of every account of the run. (tools/conformance/src/pubnet-run.ts, recover)
Tests Residual risk. A smart account’s deployment fees and storage rent are spent by design. A SIGKILL skips the sweep; the registry then lets the operator recover the funds. An OpenZeppelin smart account is checked by its code, not its signers: they are the ones its constructor set, which only its own authorization can change.

CF2. Third-party code a pubnet run starts reads the operator’s secrets

Mitigated · Information disclosure, Elevation of privilege · boundary TB18 (Conformance harness and the treasury) · asset: Harness treasury Threat. The upstream e2e suite (third-party clients, servers and scripts) and the packages the live agent run installs with npm, with every dependency npm resolves for them, inherit the harness’s environment: the treasury, sponsor and API key file paths, the run’s ledger and its confirmation. npm runs the dependencies’ install scripts, the installed SDK runs in the process that holds the treasury key, and the keys handed to that code (the suite’s buyer, the agent’s payer) keep receiving top-ups on later runs. What Stellar makes different. A leaked Stellar seed moves the account’s funds at once; nothing on chain can stop it. Preconditions. A compromised or malicious commit in the suite checkout a mainnet run uses, or a compromised version of a package npm resolves for the live agent run. Impact. Without the controls: the treasury drained, outside every cap. Mitigations
  • The suite runs with an allow-listed environment (toolchain variables minus anything that looks like a secret, token, key, confirmation or ledger) plus its own reviewed variables; a new suite variable is refused until it is added to the list. (tools/conformance/src/upstream-e2e-env.ts, suiteEnvironment)
  • The live agent run and pack-check install the packages with npm’s lifecycle scripts off, so no dependency runs code while it installs, and with the same allow-listed environment; the code they install runs only in child processes that get that environment or less. (tools/conformance/src/upstream-e2e-env.ts, NPM_INSTALL_FLAGS)
  • The live agent run never runs the installed packages in the process that holds the treasury: it starts an agent process with the allow-listed environment, which installs and runs them, and answers only its requests for the payer and for counting each payment. (tools/conformance/src/live-agent.ts, startAgentProcess)
  • On a host that allows it the agent process is launched in its own user, mount and PID namespaces (unshare): its /proc holds only its own processes, so it cannot read the treasury process’s environment or memory, and the treasury secret file, the API key file and the runs directory are masked by an unreadable tmpfs. On pubnet, where the run holds a mainnet treasury, this is required: a run refuses to start before anything is spent on a host without it, unless the operator asserts, through a documented opt-out, that the agent runs under a separate OS user. (tools/conformance/src/live-agent.ts, agentCommand)
  • On pubnet the suite’s buyer is derived from the treasury seed and the run id, fresh for each run and funded with 1 USDC, then swept and merged; the seller is a treasury-derived account, never the operator’s sponsor. (tools/conformance/src/upstream-e2e.ts, suite-buyer)
  • On pubnet the live agent’s payer is derived the same way, fresh for each run, so a seed the installed packages saw never controls a later run’s payer. (tools/conformance/src/live-agent.ts, perRun: true)
Tests Residual risk. npm resolves the live agent run’s dependencies at run time within the packages’ declared ranges, not from the reviewed lockfile. Where the host cannot provide user, mount and PID namespaces, the agent process is only isolated on pubnet through the operator’s opt-out (asserting it runs under a separate OS user); a testnet run there, which holds no treasury, runs third-party code as the same OS user. Run mainnet evidence on a host that allows namespaces, or under a separate OS user that cannot read the treasury file.

CF3. A pubnet run spends past its caps

Mitigated · Denial of service, Elevation of privilege · boundary TB18 (Conformance harness and the treasury) · asset: Harness treasury Threat. The caps see estimates instead of the fees the network charges, miss contract deployments, count settlements once from a hand-made bound, apply to each harness process alone, and one confirmation authorises any number of reruns. What Stellar makes different. Soroban fees come from simulation and include resource fees and rent; each settlement costs the facilitator’s sponsor up to its fee ceiling. Preconditions. A run with more cases, more settlements or higher fees than its estimates, or a rerun with the same confirmation. Impact. Without the controls: real XLM and USDC spent beyond what the operator confirmed. Mitigations
  • Every transaction a harness submits passes one choke point: nothing is sent before the run’s meter is attached, a fee the treasury pays is debited at its maximum before it is sent and lowered to the fee charged, and a fee source outside the run is refused. (tools/conformance/src/network.ts, spend_unmetered)
  • Every /settle request to the target is debited at the facilitator’s fee ceiling before it is sent, including those of the upstream suite through the harness’s forwarder. (tools/conformance/src/facilitator-guard.ts, guardedFetch)
  • One ledger per evidence run, shared by every harness process under a lock, caps the run’s net XLM and net USDC loss; its id includes a fresh nonce, it is claimed once and closed at the end. (tools/conformance/src/run-ledger.ts, pubnet_run_reused)
  • Caps and fee ceilings are required on pubnet and refused when malformed or zero. (tools/conformance/src/network.ts, positiveInteger)
Tests Residual risk. A step debited before its transaction is refused stays counted, so a run can stop slightly below its caps.

CF4. A pubnet run pays through the wrong contract or without access

Mitigated · Spoofing, Tampering · boundary TB18 (Conformance harness and the treasury) · asset: Harness treasury Threat. Pubnet upto clients ignore the configured contract, a contract setting points at code other than the published one, or a run against a keyed facilitator funds its accounts and then has every request refused. What Stellar makes different. An upto payer authorises the settlement contract it is given; another contract with the same interface would receive the authorisation. Preconditions. A pubnet run with upto cases or against a facilitator that requires keys. Impact. Without the controls: authorisations signed for unverified code, or funds spent on a run that cannot pass. Mitigations
  • The upto contract and its WASM hash are taken together, checked against the published pubnet deployment record when it exists, and the contract’s instance is read on chain before anything is spent; every pubnet harness passes it to its upto clients. (tools/conformance/src/network.ts, checkUptoContract)
  • Before anything is spent, an empty /verify shows whether the facilitator serves the run; a missing or refused key stops it, and the key is then sent with every facilitator request. (tools/conformance/src/facilitator-guard.ts, checkFacilitatorAccess)
Tests Residual risk. None.

Out of scope

  • Whether a seller delivers what it sells, or charges a fair upto amount within the cap the buyer signed.
  • The security of buyers’ wallets and of the machines agents run on.
  • The integrity of the Stellar RPC provider beyond what simulation and the ledger prove; the RPC URL is operator configuration.
  • Attacks on the hosted testnet instance’s infrastructure; see SECURITY.md for how to report a vulnerability.