You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: When a client sends a request with a sessionId that does not exist (server restart, timeout, stale client), createSessionAndRestoreId creates a new McpServerSession+StreamableHttpSessionTransport, stores them in sessions/sessionTransports, and processes one request — but, unlike createTemporarySessionAndProcess (which has a .doFinally(...removeSession...)), the restore path has no cleanup hook. The session and transport remain in both maps forever.
impact: Unbounded memory growth of sessions/sessionTransports/ShenyuMcpExchangeHolder via the stale-session restore path.
suggested_fix: Add a doFinally to createSessionAndRestoreId that calls removeSession(actualSessionId) and ShenyuMcpExchangeHolder.remove(actualSessionId).
shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/transport/ShenyuStreamableHttpServerTransportProvider.java:461-490sessionIdthat does not exist (server restart, timeout, stale client),createSessionAndRestoreIdcreates a newMcpServerSession+StreamableHttpSessionTransport, stores them insessions/sessionTransports, and processes one request — but, unlikecreateTemporarySessionAndProcess(which has a.doFinally(...removeSession...)), the restore path has no cleanup hook. The session and transport remain in both maps forever.sessions/sessionTransports/ShenyuMcpExchangeHoldervia the stale-session restore path.doFinallytocreateSessionAndRestoreIdthat callsremoveSession(actualSessionId)andShenyuMcpExchangeHolder.remove(actualSessionId).Identified during the 2026-08-02 deep re-scan; full list in
docs/scan2-2026-08-02/00-consolidated-critical-high.md.