Skip to content

fix(mcp): don’t leave gateway secrets in /tmp after a crash #3596

Description

@aheritier

Summary

pkg/tools/mcp/gateway.go:76-121 writes plaintext secret values to os.CreateTemp files (0600) passed by path to docker mcp gateway run; removal happens only in Stop (gateway.go:58, 63-72). A crash/SIGKILL leaves secrets on disk indefinitely.

Fix

Startup sweep of stale mcp-secrets-* / mcp-config-* files; evaluate passing secrets via stdin/fd instead of a path (keep the file path as a fallback for gateway compatibility).

Acceptance

  • Stale secret files cleaned on startup; no plaintext secret persists after abnormal exit (where feasible).

Metadata

Metadata

Assignees

Labels

area/gatewayGateway, proxy, and routingarea/mcpMCP protocol, MCP tool servers, integrationarea/securityAuthentication, authorization, secrets, vulnerabilitieskind/fixPR fixes a bug (maps to fix:). Use on PRs only.

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions