Unguarded pk[:12] slice in VerifyMultisig panics the verifying node
Report
Unguarded pk[:12] slice in VerifyMultisig panics the verifying node
Summary
VerifyMultisig formats error strings with unguarded pk[:12] slices. A
crafted multisig block carrying a short signer public key panics the
verifying goroutine. What that panic does to the node depends on the
delivery path, and the paths were tested separately (see Proof of concept):
the HTTP path recovers per connection, the gossip path filters this block
shape before it reaches verification, and the sync path has no recover at
all.
Impact
An unauthenticated, crafted multisig_open block (no victim account needed
for the open variant; the block is never stored) panics verification. Via
HTTP the panic kills only that connection — the node survives. Via sync,
which a node triggers automatically when it peers with anyone, the panic
runs in an unrecovered goroutine and would kill the process; that path is
traced through the code, not live-executed (see Caveats). This is targeted
denial of service, not a compromise, which is why it is filed as High
rather than Severe.
Suggested program tier: High (targeted DoS).
Root cause
core/multisig.goVerifyMultisig:pk[:12]appears in three error paths — duplicate signer, signer not in keyset, and bad signature. Any signer public key shorter than 12 characters panics with a slice-bounds error instead of returning an error.net/gossip_validate.gonever checks signature-entry public key length, and the block hash does not cover signatures, so a short key reaches verification intact.- Path-by-path recover status, all read from the code: the HTTP path
(
api/handler.gosubmitBlock→node.SubmitBlock→AddBlock) has no recover of its own, but the standard library HTTP server recovers panics per connection, so an HTTP-delivered panic kills the connection, not the process (proven live, below). The gossip subscribe loop (net/gossip.go) drops blocks whose singleSignaturefield is not 128 characters before they reachhandleIncoming, so this multisig block shape — which carries only theSignatureslist — never reaches verification over gossip. The sync path (net/sync.go:ConnectedF→spawnGate.spawn→requestSync→AddSyncedBlock) has no recover anywhere on it; the onlyrecover()innet/is the Messenger handler, which is not on this path. - The sibling code is safe, which confirms this is an oversight rather than a
pattern:
VerifyMultisigAnyand the statechain verifier use a length-safe short-key helper.
Proof of concept
Target: xeprotocol/xe @ 978785929bc17a2f4ab30c383e5fc9cf4d634512
(2026-10-15). Two harnesses, both against the real core package; the
repository itself is not modified.
Attached PoCs: pocs/harness-slice1-main.go.txt (the C5 sections, unit
plus subprocess AddBlock crash) and pocs/slice3-poc-main.go.txt
(independent second harness), both byte-identical copies of the runnable
sources.
Run (Go 1.25.14):
export PATH="$HOME/.local/go/bin:$PATH"
cd harness-slice1
GOPROXY=off go run .
Observed output (verbatim):
1-char pubkey: PANIC: runtime error: slice bounds out of range [:12] with length 1
11-char pubkey: PANIC: runtime error: slice bounds out of range [:12] with length 11
control full-length unknown pubkey: returned err=signer cdcdcdcdcdcd not in keyset (no panic)
subprocess exit err=exit status 2
RESULT: process crashed with slice-bounds panic as predicted
The boundary is exact: 11 characters panic, 12 characters error cleanly.
A subprocess running a crafted multisig_open through Ledger.AddBlock
died with exit status 2 on the slice-bounds panic.
Live local node, HTTP path (executed 2026-10-29)
A node built from the same HEAD was run locally and isolated (no bootstrap
peers, no discovery, loopback API only — no testnet traffic). A control
block with a full-length unknown signer key was rejected cleanly
(signer cdcdcdcdcdcd not in keyset, node unaffected). The 1-character-key
block then produced this in the node's log (verbatim excerpt):
http: panic serving 127.0.0.1:35394: runtime error: slice bounds out of range [:12] with length 1
github.com/xeprotocol/xe/core.VerifyMultisig(...)
/home/hatch/workspace/xe/repo/core/multisig.go:99
github.com/xeprotocol/xe/core.(*Ledger).verifyBlockCredential(...)
/home/hatch/workspace/xe/repo/core/ledger.go:1436
github.com/xeprotocol/xe/core.(*Ledger).addBlock(...)
/home/hatch/workspace/xe/repo/core/ledger.go:801
github.com/xeprotocol/xe/node.(*Node).SubmitBlock(...)
/home/hatch/workspace/xe/repo/node/node.go:1283
github.com/xeprotocol/xe/api.(*Handler).submitBlock(...)
/home/hatch/workspace/xe/repo/api/handler.go:507
github.com/xeprotocol/xe/api.(*Handler).handleSubmitMultisigOpen(...)
The node process survived: its API answered afterwards. So over HTTP the panic is real but recovered per connection — it kills the connection, not the node. The process-kill claim rests on the sync path, traced above and not live-executed.
Reproduction steps
- Craft a
multisig_openblock with a keyset and a signature entry whose public key is a single character, with a correct block hash (the hash must be computed with the target network's network-ID prefix). - Submit via
POST /blocks/multisig_open: the verifying goroutine panics (visible in the node log); the connection dies; the node survives. - For the process-kill variant, deliver the same block over sync (a peer
connection triggers
requestSyncautomatically): the panic runs in an unrecovered goroutine. This variant is traced through the code, not executed against a live node in this report.
Recommended fix
Use a length-safe short-key helper (as the statechain verifier already does) at all three sites, and add length validation for signature entries at ingestion.
Severity
- CVSS 3.1: 7.5 —
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CWE-248 (Uncaught Exception)
Caveats
- Proof status, stated per path: the in-process panic is executed and
reproduced (exit status 2); the live HTTP panic is executed against a
local isolated node and shown to be recovered per connection (node
survived); the gossip path is traced and shown to filter this block
shape before verification; the sync-path process kill is traced through
the code (
spawnGate.spawnhas no recover) but NOT executed against a live node — a live sync-delivery attempt was blocked by tooling during this audit and was not retried, so it is claimed as traced, not proven. A triager who credits only the executed paths should weigh this as connection-kill denial of service, not process kill. - The same slicing shape was noted at two other sites (
core/vote.goandcore/ledger.go); they are not claimed here and would need their own verification. - No public prior report of the
pk[:12]panic mechanism was found (dedup queries recorded in the audit's DEDUP-BASELINE.md). - This reproduction runs against the repository code at the stated HEAD. No testnet transactions were sent as part of this report.
Payout address (XE): eff2c51dd8457df740b919226cd9b37a2944e5abea7501094db80234f87f010e
Best, Chaplin
Thread
I have submitted a clean fix in PR #164 (https://github.com/xeprotocol/xe/pull/164).
Summary of Fix
- Introduced a length-safe
shortKey(s string) stringhelper incore/multisig.goaligned with the existing implementation instatechain/chain.go:shortKey. - Replaced the three unguarded
pk[:12]slice sites inVerifyMultisigwithshortKey(pk). - Added unit tests in
core/multisig_test.gocovering 1-character, 11-character, 12-character boundary, and empty public key payloads, verifying that all scenarios return clear errors with 0 panics.
Thanks for the detailed report. We have confirmed the behaviour and it is being handled; we will update this ticket when there is more to share.