From e68010568fa0dc4405bcd260581924123d71f35c Mon Sep 17 00:00:00 2001 From: Sebastion Date: Thu, 9 Jul 2026 19:46:11 +0100 Subject: [PATCH] fix(http): remove active session IDs from /health response The /health endpoint returned an array of every active MCP session UUID via 'sessionIds: Array.from(transports.keys())'. Because the HTTP server binds on 0.0.0.0 by default and treats the 'mcp-session-id' header as the sole authentication token for reusing a transport on POST /mcp, any unauthenticated network caller could fetch /health, harvest live session UUIDs, and hijack another user's MCP transport - including wallet signing and transfer tools. Drop 'sessionIds' from the response and keep only the non-sensitive liveness fields (status, server, activeSessions count). --- src/server/http-server.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/http-server.ts b/src/server/http-server.ts index cb20194..d7c4d79 100644 --- a/src/server/http-server.ts +++ b/src/server/http-server.ts @@ -154,11 +154,13 @@ app.delete("/mcp", async (req: Request, res: Response) => { // Health check endpoint app.get("/health", (_req: Request, res: Response) => { + // Only expose non-sensitive liveness data. Active session IDs are the + // sole authentication token for reusing an MCP transport on POST /mcp, + // so they must never be disclosed to unauthenticated callers. res.status(200).json({ status: "ok", server: server ? "initialized" : "initializing", - activeSessions: transports.size, - sessionIds: Array.from(transports.keys()) + activeSessions: transports.size }); });