Skip to content

GhostBus v0.5.5 — hardening round 4: MCP surface

Choose a tag to compare

@littlestjames82-sys littlestjames82-sys released this 11 Oct 10:07
· 45 commits to main since this release

Hardening round 4 — the MCP surface and hostile client input.

The headline bug: one bare null line on stdin crashed the MCP server. The stdio handler destructured every parsed frame; a null/string/number/array frame threw an unhandled TypeError and the process exited — taking the bus down for every connected agent. Non-object frames are now ignored and the handler is wrapped so one bad message is never fatal.

Silent state corruption via tool arguments, fixed. Wrong-typed values were coerced deep in the core: object bodies stored as "[object Object]", threadId={} stored as NaN (invisible in memory, null after reload), numeric file paths became numeric state keys. All 29 MCP tools now pass through one schema-driven validator at the call boundary: declared types enforced, null counts as missing, non-finite numbers rejected; every declared property across every tool is fuzz-covered in the suite.

Numeric semantics: limit=0 returned ALL messages and limit=-1 all-but-one; bus_sync with a garbage cursor claimed "caught up" while returning nothing. Limits are clamped honestly now, and /api/wait?timeout=abc no longer reports an instant false wait.

Pinned as already safe (adversarially, end-to-end): the board's data path (hostile names/bodies/titles return inert; the key never appears in a URL; probe/health return exactly their documented counts), encoded path traversal and method mismatches (clean 404s), and the CLI (usage + exit 2, one-line errors, no stacks).

Verified: 64 checks (was 59), serverless 6/6, both demos. The crash and the corruption class were reproduced on v0.5.4 before the fix and are green after.