{"id":"XE-13364","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"506","source_url":"https://github.com/xeprotocol/xe/issues/506","reporter_id":2485,"title":"Multisig lease-lifecycle operations require only any single signer, not the keyset threshold","area":"leasing-ledger","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0001","tracked":true,"internal_ref":"#1062","internal_url":"https://github.com/xeprotocol/core/issues/1062","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:12.089983+00:00","updated_at":"2026-11-20T00:25:45.624208+00:00","source_created_at":"2026-11-12T15:15:06+00:00","told_at":"2026-11-20T00:25:09+00:00","status_changed_at":"2026-11-20T00:24:51.909595+00:00","url":"https://bounty.xe.network/XE-13364","body":"## Summary\n\nLease-lifecycle operations on a multisig account — `lease_accept`, `lease_settle`, `lease_cancel`, and `lease_force_settle` — only require **any single** keyset member's signature, not the keyset threshold. A single member of a 2-of-3 multisig provider can unilaterally accept a lease (committing the provider), and a single member of a multisig consumer can unilaterally cancel or force-settle a lease. This is an authorization asymmetry: creating a lease (`lease`) and renewing one (`lease_renew`) correctly require threshold, but the lifecycle operations that commit, settle, or unwind a lease do not.\n\n**Severity: Low.** This is **not** fund theft. The lease escrow, stake refund, and any XE emission always land in the shared multisig account, never in the individual member's account. The realistic harm is unilateral commitment / griefing — e.g. one member accepts a lease the other members did not approve, or cancels a lease the provider already provisioned for.\n\n## Code references\n\n- `core/multisig.go:140-149` — `IsSpendingOp` returns `true` only for `send, burn, lease, lease_renew, multisig_open, multisig_update, mint`. `lease_accept`, `lease_settle`, `lease_cancel`, and `lease_force_settle` are **not** in the list.\n- `core/ledger.go:1416-1447` — `verifyBlockCredential`: for a multisig account, spending ops use `VerifyMultisig` (threshold signatures); all other block types use `VerifyMultisigAny`, which succeeds if **any one** keyset member's signature is valid (`core/multisig.go:112-126`).\n- `core/ledger.go:1607` (`validateAndAddLeaseAccept`), `2117` (`lease_settle`), `1792` (`lease_cancel`), `1879` (`lease_force_settle`) — these validators check lease state, certificates, attestations, and balances, but none re-checks the multisig threshold, because the credential check already passed under the any-signer rule.\n\n## Proof of concept (local, in-memory ledger only)\n\nVerified locally against the real `AddBlock` path. No node was run, no public testnet was touched, no transaction was sent on any live network.\n\n**Setup:** local in-memory ledger (`store.NewMemStore` + `core.NewLedger`), Go 1.25.0. Provider is a 2-of-3 multisig (keys k1, k2, k3), opened via a real `multisig_open` block signed by k1+k2. Consumer is a single-key account funded with test XUSD. Lease params: 1 vCPU / 1024 MB / 10 GB / 3600 s, cost 40,000 micro-XUSD, stake 0.\n\n**Results (three arms, same lease params):**\n\n| Arm | `lease_accept` signatures | Outcome |\n|---|---|---|\n| Control | k1 + k2 (2-of-3, threshold) | **ACCEPTED** — lease state `accepted`. Proves the setup is valid. |\n| Test | **k1 only (1-of-3)** | **ACCEPTED** — lease state `accepted`. Finding confirmed. |\n| Negative control | outsider key (not in keyset) | **REJECTED** — `multisig: no valid signature from any keyset member`. Proves signature verification is enforced; the 1-of-3 acceptance is the any-signer rule, not a verification bypass. |\n\n**Note:** only `lease_accept` was tested end-to-end. `lease_settle`, `lease_cancel`, and `lease_force_settle` share the same any-signer branch in `verifyBlockCredential`, so the same weakness applies to them by code inspection, but they were not individually exercised.\n\n## Suggested fix\n\nInclude the lease-lifecycle operations in `IsSpendingOp` (or otherwise require threshold for them), so `lease_accept`, `lease_settle`, `lease_cancel`, and `lease_force_settle` on a multisig account require the keyset threshold — matching `lease` and `lease_renew`. If the any-signer behaviour is intentional (e.g. these are considered non-spending), document it, since it contradicts what a multisig user would expect.\n\n## XE address for payment\n\n69fe2d58161ce03e56fd596b1559b49836c5e0563a92cf3ecf823fb1c7628273","patch_refs":[{"id":559,"repo":"xeprotocol/xe","kind":"pr","ref":"513","title":"fix(core): require multisig threshold for lease lifecycle operations (fixes #506)","url":"https://github.com/xeprotocol/xe/pull/513","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-11-14T20:42:20.120113+00:00"}],"thread":[{"id":12409,"source":"github","source_ref":"7011962972","author":"Alfonova-Node","team":false,"body":"# [Re-verification] Multisig lease-lifecycle threshold bypass — full end-to-end force_settle PoC at HEAD 8cc209d\n\n**Status of this comment:** verification evidence for an already-reported finding, NOT a new\nsubmission and NOT a payout claim. Dedup baseline below; the first verifiable reports\n(XE-0001 / xe#6, XE-0068 / xe#93) own this finding.\n\n## Summary\n\nRe-verified at `master` HEAD `8cc209d` (\"release: testnet-0006 build\"): the four lease-lifecycle\noperations (`lease_accept`, `lease_cancel`, `lease_force_settle`, `lease_settle`) on a threshold\nmultisig account still require only **any single** keyset signature, because `IsSpendingOp`\n(`core/multisig.go`) excludes them and `verifyBlockCredential` routes non-spending ops to\n`VerifyMultisigAny`. PR #7 (which adds all four ops to `IsSpendingOp`) remains open/unmerged.\n\nPrior reports cover the mechanism; #506 exercised only `lease_accept` end-to-end and noted the\nother three legs were code-inspection only. This comment closes that gap for `lease_force_settle`\nwith a full ledger-level PoC (real `NewLedger` + `MemStore`, real block lifecycle, no source\nmodifications, no testnet transactions).\n\n## End-to-end PoC (force_settle leg)\n\nHarness: separate package `poc/e2e` importing `core` + `store`; Go 1.25.0; virtual clock\n(`core.Now` override) advanced past `expiry + LeaseSettleGrace + LeaseForceSettleGap`.\n\nChain executed:\n1. Mint funder (1,000,000 XE) and provider (100 XE) accounts (open blocks declare `PubKey`).\n2. Funder sends XCU to a **3-of-5 multisig** account opened via real `multisig_open` (3 signatures).\n3. Multisig account creates a lease (`lease`, threshold-signed) → provider `lease_accept`.\n4. Clock advances past expiry + grace + gap; timekeeper attestation signed for the attack time.\n5. **Rogue single key holder** submits `lease_force_settle` with ONE signature.\n\nResult: block admitted, lease → `LeaseUnfulfilled`, **40,000 XCU escrow returned to the multisig\nfunder chain without co-signer consent**.\n\nControl assertion (same harness, same keyset): a 1-of-5 `send` is correctly rejected with\n`multisig: insufficient signatures: got 1, need 3` — proving the gap is op-specific routing,\nnot a broken harness or a general signature-verification failure.\n\nRaw output (`go clean -testcache && go test ./poc/e2e/ -run TestPoCForceSettleMultisigEndToEnd -v -count=1`):\n\n```\n=== RUN   TestPoCForceSettleMultisigEndToEnd\n2026/11/19 22:25:35 Genesis block applied: 42000000000000 XE to 378d0f5c2063...\n    force_settle_e2e_test.go:227: control: 1-of-5 send correctly rejected: multisig: insufficient signatures: got 1, need 3\n    force_settle_e2e_test.go:230: ATTACK SUCCESSFUL: rogue key holder recovered 40000 XCU escrow from 3-of-5 multisig with a single signature\n    force_settle_e2e_test.go:231: multisig=3299a09aede551a1 lease=bad14b3a3648be10 force_settle=7e62bb9e2cc96f75\n--- PASS: TestPoCForceSettleMultisigEndToEnd (0.01s)\nPASS\nok  \tgithub.com/xeprotocol/xe/poc/e2e\t0.011s\n```\n\nUnit-level companion (`go test ./core/ -run TestForceSettleBypassesThreshold -v`):\n\n```\nVerifyMultisig correctly rejects: insufficient signatures: got 1, need 3\nVerifyMultisigAny accepts single sig — BYPASS CONFIRMED\nIsSpendingOp(BlockLeaseForceSettle) = false → routes to VerifyMultisigAny\n--- PASS: TestForceSettleBypassesThreshold (0.00s)\n```\n\n## Impact classification (honest)\n\nGovernance/authorization bypass, not theft: escrow returns to the shared multisig account's\nchain, never to the rogue signer's personal account. Harm is unilateral settlement control —\none minority key holder can force-settle/cancel/settle leases the other members did not approve\n(e.g. killing a provider's active service commitment, or unwinding a lease at a moment chosen\nby the attacker). Consistent with the Low/Medium calibration in #506 and XE-0068.\n\n## Dedup baseline\n\n- XE-0001 / xe#6 (2026-10-18, Accepted) — first report; explicitly lists cancel/force-settle/settle missing from `IsSpendingOp`.\n- XE-0068 / xe#93 (2026-10-26, Accepted Medium) — accept leg.\n- XE-0093 / xe#157 (2026-10-29) — closed as duplicate of XE-0068 by the desk.\n- xe#506 (2026-11-12) — accept leg e2e; this comment supplies the missing force_settle e2e leg.\n- Fix: PR #7 (open, unmerged at time of writing); also #784, #513, #110, #209.\n\nNo new bounty claim is made by this comment.","created_at":"2026-11-19T14:26:42+00:00"},{"id":13058,"source":"github","source_ref":"7026270459","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0001, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13364 and says what differs; it is read like any other.","created_at":"2026-11-20T00:25:09+00:00"}]}