Repository navigation
Description
Security: MCP execution routes are unauthenticated under legacy auth, enabling access to exposed agent capabilities
Summary
In the current main snapshot (72a46c7, @voltagent/core@2.11.0), VoltAgent's legacy authentication policy protects ordinary agent, tool, and workflow execution routes, but does not protect MCP execution routes.
As a result, an application using the legacy auth configuration with the default defaultPrivate behavior may expose MCP agent, tool, and workflow execution without authentication.
This becomes high impact when an exposed agent has Workspace tools, because the MCP caller can reach capabilities such as shell execution, filesystem access, database access, or third-party integrations.
Local reproduction
The policy function was executed directly against the checked-out source. Results:
| Request | Result |
|---|---|
POST /mcp/servers/demo/http |
requiresAuth=false |
GET /mcp/servers/demo/sse |
requiresAuth=false |
POST /mcp/servers/demo/messages |
requiresAuth=false |
POST /agents/demo/text |
requiresAuth=true |
POST /tools/demo/execute |
requiresAuth=true |
POST /workflows/demo/run |
requiresAuth=true |
The result is deterministic and does not require an API key or external service.
Affected code
packages/server-core/src/auth/defaults.tsPROTECTED_ROUTESincludes normal agent, tool, and workflow execution routes.- MCP execution routes are absent.
requiresAuth()falls back todefaultPrivate ?? falsefor unmatched routes.
packages/server-hono/src/routes/mcp.routes.ts- Registers the MCP Streamable HTTP, SSE, and SSE message routes.
Relevant route implementations:
- Streamable HTTP:
packages/server-hono/src/routes/mcp.routes.ts:303 - SSE:
packages/server-hono/src/routes/mcp.routes.ts:343 - SSE messages:
packages/server-hono/src/routes/mcp.routes.ts:389
Impact
An unauthenticated client may be able to:
- Connect to an MCP transport.
- Enumerate exposed tools and agents.
- Invoke registered agents, tools, or workflows.
- Reach privileged Workspace capabilities indirectly through an agent.
- Trigger workflow execution or workflow resumption if those capabilities are exposed.
The severity depends on how the host application configures MCP and its registered tools. The default behavior is unsafe for deployments where MCP is reachable from an untrusted network.
Related local finding: LocalSandbox is not an isolation boundary by default
The same checkout also contains a separate capability risk. LocalSandbox defaults to isolation provider none and launches real host processes. Its root directory constrains the working directory, but it does not provide a filesystem jail.
A harmless local test created a temporary workspace and configured only bash as an allowed command. The command bash -c 'cat /etc/hostname' completed successfully and returned host metadata, despite the configured workspace root being a different temporary directory.
This also shows why interpreter-based command allowlists are not security boundaries: allowing bash, node, or python allows that interpreter to perform secondary operations.
Relevant code:
packages/core/src/workspace/sandbox/local.ts:311-314— default isolation provider isnonepackages/core/src/workspace/sandbox/local.ts:510-515— allowlist checks only the top-level executable basenamepackages/core/src/workspace/sandbox/local.ts:547-552— host process is spawned directly
The documentation does recommend enabling OS-level isolation, but safe isolation is opt-in.
Additional correctness finding: prompt cache TTL zero is ignored
packages/core/src/voltops/prompt-manager.ts:213-220 uses a truthiness check when interpreting a custom TTL. A custom TTL of 0 falls back to the cached entry's original TTL instead of expiring immediately.
This means callers cannot reliably use ttl: 0 to force a prompt refetch.
The relevant logic should distinguish undefined from 0.
Additional observability risk: raw prompt contents are logged
packages/core/src/voltops/prompt-manager.ts:275-316 logs raw prompt content and rendered prompt results at trace level, including template data. If trace logs are exported or persisted, sensitive instructions or request-specific data may enter telemetry.
Prompt identifiers, versions, hashes, and variable names would be safer than raw content.
Test and build note
The focused run recorded 74 passing tests. A broader focused run also showed source-checkout collection failures because workspace package entrypoints point at missing dist artifacts until packages are built. The root typecheck additionally includes archived deprecated providers and reports many unrelated missing-dependency errors.
Recommended remediation
- Add MCP execution routes to the protected route policy by default.
- Protect all MCP transports consistently, including HTTP, SSE, and SSE message POST requests.
- Keep MCP discovery public only if desired; do not treat discovery and execution as equivalent.
- Add regression tests asserting that MCP execution requires authentication under legacy auth.
- Consider making
defaultPrivatethe default for MCP execution specifically. - Document that
LocalSandboxwith isolationnoneis host execution, not a security sandbox. - Treat interpreter allowlists as convenience filters, not isolation.
- Fix prompt TTL handling to treat
0explicitly. - Remove raw prompt bodies and rendered results from trace logs by default.
Suggested regression assertions
The authentication test suite should assert that all of the following require authentication:
- MCP Streamable HTTP execution
- MCP SSE connection when used for execution
- MCP SSE message POST
- Agent execution
- Tool execution
- Workflow execution
Disclosure note
All testing was performed locally against a fresh clone of the repository. No external VoltAgent service, GitHub account, customer system, credential, or production deployment was accessed.
Activity
shu-chen-dot-ca commentedon Nov 8, 2026
I'd like to work on this one: adding the MCP transport routes to the protected route list, with regression tests.
Solaris-star commentedon Nov 12, 2026
I’d like to address only the prompt-cache TTL 0 correctness issue described here. #1522 explicitly leaves this out, and #1521 changes cache-key selection rather than expiration. I’ll reproduce the zero-TTL behavior through the prompt manager, add regressions for per-call/global zero TTL and positive-TTL controls, and keep authentication, sandboxing, logging, and cache-key changes out of scope. This work will be AI-assisted.
pritpatel2412 commentedon Nov 13, 2026
Thanks both for taking this on and for clearly separating the scopes.
@shu-chen-dot-ca, PR #1522 matches the MCP authentication portion of this report. Protecting the HTTP, SSE, and SSE message execution routes while keeping discovery routes public, together with regression coverage, sounds right.
@Solaris-star, thanks for isolating the
ttl: 0expiration behavior. It makes sense to keep that separate from the cache-key selector work in #1521 and from the authentication, sandboxing, logging, and other findings in this issue.Please link the follow-up PRs here when ready so the fixes can be tracked independently. Thanks again for the thorough scope separation.
Solaris-star commentedon Nov 13, 2026
Thanks for confirming the scope. The TTL-only follow-up is in draft PR #1531. It has local regression coverage; GitHub CI is still awaiting approval, so I am not marking it ready. Authentication, sandboxing, logging, and cache-key selection remain out of scope.