diff --git a/SECURITY.md b/SECURITY.md index 6cdcb3d..efe0960 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -31,6 +31,15 @@ payer key if that account holds mainnet funds (read from the SDK's source, not run). Use a payer key that has never held mainnet funds. The advisory is [GHSA-wm3g-w88q-73xx](https://github.com/wasit-dev/wasit/security/advisories/GHSA-wm3g-w88q-73xx). +In 0.7.0, `MPP-01` paid on `stellar:pubnet` when the run named it, with no cap, +and a channel commitment was signed without checking the bytes the RPC returned +for it, so a run on the test network pointed at a mainnet RPC signed a +commitment valid on mainnet. Both are fixed in 0.8.0-beta.1 (npm tag `beta`): +every network but the test networks is refused before a key is read, and a +commitment is signed only when it names the run's channel, amount and network. +The advisory is +[GHSA-7c36-rg54-r3v8](https://github.com/wasit-dev/wasit/security/advisories/GHSA-7c36-rg54-r3v8). + ## Authorization **Only run Wasit against a service you own, or one whose operator has given you @@ -181,6 +190,13 @@ would not appear in that file until it was resolved. ## Known advisories in a clean install +In 0.8.0-beta.1 (npm tag `beta`), `npm run verify:clean-install` found no +advisory in a fresh install of all three packages (2026-11-20). During that +install npm prints two `ERESOLVE overriding peer dependency` warnings: +`@stellar/mpp` 0.7.1 declares the peer range `@stellar/stellar-sdk ^15.1.0`, +and Wasit uses 16.4.1, with which its MPP checks passed on the Stellar test +network (2026-11-16). The rest of this section describes 0.7.0. + `npm audit` on a fresh install of all three packages (0.7.0, measured 2026-10-08) reports nine packages: eight high, one moderate. Installing `@wasit-dev/cli` alone reports eight (seven high, one moderate), since it pulls @@ -201,8 +217,10 @@ arrive by two routes: `@stellar/mpp`, `@x402/stellar` and the three `@wasit-dev/*` packages appear in that count only because npm marks a package that depends on an affected one. -There is no advisory against Wasit 0.7.0's own code; versions up to 0.6.0 have -the `MPP-01` network issue described under [Testnet only](#testnet-only), +Wasit 0.7.0's own code has the two MPP defects of +[GHSA-7c36-rg54-r3v8](https://github.com/wasit-dev/wasit/security/advisories/GHSA-7c36-rg54-r3v8), +fixed in 0.8.0-beta.1; versions up to 0.6.0 have the `MPP-01` network issue +described under [Testnet only](#testnet-only), [GHSA-wm3g-w88q-73xx](https://github.com/wasit-dev/wasit/security/advisories/GHSA-wm3g-w88q-73xx). There is no downstream fix. The levers are `@stellar/mpp`'s two peer ranges, diff --git a/docs/CHECKS.md b/docs/CHECKS.md index 964c943..06aabaa 100644 --- a/docs/CHECKS.md +++ b/docs/CHECKS.md @@ -347,6 +347,20 @@ The transaction `PAYMENT-RESPONSE` names must have succeeded and moved exactly that cites another transaction fails, even a real and successful one ([0.6.0 verification run](evidence/2026-09-30-x402-0.6.0-verification-run.md)). +### A Solana settlement is reported as failing although it settled (`X402-06`) + +Known limit, reported in [issue #22](https://github.com/wasit-dev/Wasit/issues/22) +and not yet fixed. On Solana, Wasit reads the settlement transaction with +`getTransaction(..., { maxSupportedTransactionVersion: 0 })` +(`packages/core/src/x402/chains/svm.ts`). The report says that an RPC answers +that call with error -32015 when the settlement was sent as a version 1 +transaction, so a compliant settlement would be reported as failing. The cap is +in the code (two calls, lines 255 and 307 in 0.7.0 and in 0.8.0-beta.1); the RPC +behaviour is the reporter's, and we have not yet reproduced it. If a Solana run +fails at the settlement read and the RPC's answer mentions the transaction +version, read the transaction on an explorer before taking the FAIL as the +target's defect. + ### A forged signature is accepted (`X402-07`) The target served a payment whose authorization signature was corrupted: it @@ -373,6 +387,18 @@ An authorization past its window (`validBefore` on EVM, the auth entry's expirat ledger on Stellar, the recent blockhash on Solana) can never settle, so a target that serves it serves for nothing. Verify with the facilitator before serving; it refuses expired authorizations. +### No verdict on `X402-11` where ledgers close in 4 seconds or less + +`X402-11` does not send an authorization that stays valid more than 62 ledgers +past the latest one: 300 seconds at 5 seconds a ledger, plus 2 ledgers of slack +(0.8.0-beta.1). The x402 Stellar client turns the advertised lifetime into +ledgers with its own estimate of the ledger time, the recent ledgers' average +rounded up (`@x402/stellar` 2.28.0; 5 seconds when it cannot read them). On the +test network the recent ledgers averaged 5.00 seconds on 2026-11-17, so a +300-second lifetime is 60 ledgers. If they average 4 seconds or less, the same +lifetime becomes 75 ledgers or more, and `X402-11` discards the payment unsent, +with no verdict. It never passes because of it. + ### A charge to a muxed recipient is refused (`MPP-01`) A charge server on `@stellar/mpp` 0.7.1 configured with a muxed (`M...`) diff --git a/packages/cli/README.md b/packages/cli/README.md index a78569a..4d9f10c 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -109,7 +109,7 @@ wasit run --start # the payment tier, on a test network `wasit.config.json` (version 1) holds a service's endpoints, methods, request bodies and environments. The loader is strict: an unknown key is an error, and secrets, the mainnet opt-in and per-payment caps have no place in it. `wasit run` runs every endpoint (`--env`, `--endpoint`) and writes one report (`--json`, `--out`); it can start the service itself (`--start`, `--start-if-local`) and compare with the report of the default branch (`--baseline`). -Without `--read-only` or `--dry-run` the run is the payment tier. It pays on test networks only, when the environment has `operatedByMe: true` and the chain's key variable is set: at most $1.00 a payment and $5.00 a run (`maxRunUsd` can only lower it), only to the `payTo` and asset the config pins. In GitHub Actions it pays only on a push to the default branch, a schedule and `workflow_dispatch`; a pull request runs the read-only checks. In another CI the payment tier is refused with exit 2: use `--read-only` there. `--mainnet` is refused in this version. `wasit run --help` lists every option. +Without `--read-only` or `--dry-run` the run is the payment tier. It pays on test networks only, when the environment has `operatedByMe: true` and the chain's key variable is set: at most $1.00 a payment and $5.00 a run (`maxRunUsd` can only lower it), only to the `payTo` and asset the config pins. In GitHub Actions it pays only on a push to the default branch, a schedule and `workflow_dispatch`; a pull request runs the read-only checks. In another CI the payment tier is refused with exit 2: use `--read-only` there. `--mainnet` is refused in this version. A run that will pay checks its RPC before it starts the service, so an RPC that `service.start` itself starts is not up yet and the run stops with exit 2: start such an RPC before `wasit run`. `wasit run --help` lists every option. For an endpoint with a `reject` case in the config, on Stellar, the payment tier also runs `X402-11`: a valid payment is sent with the request the service must refuse, and the chain is read until that payment's authorization has expired, up to six minutes.