Summary
When scheduler-mcp is configured with SSE transport (--transport sse), the server exposes all MCP tools over HTTP without any authentication. An unauthenticated remote attacker who can reach the SSE port can create and execute arbitrary shell commands via add_command_task / run_task_now, achieving remote code execution with the privileges of the server process.
Affected Versions
- Latest commit
5a2015a (2025-07-24)
- All versions supporting SSE transport
Root Cause
The SchedulerServer class (mcp_scheduler/server.py) registers MCP tools via FastMCP without any authentication middleware. When started with SSE transport, the server binds an HTTP endpoint via uvicorn on the configured address/port.
Key issues:
- No authentication mechanism exists — no API keys, tokens, OAuth, or passwords
- No CORS headers returned by the server
- No per-transport access control differentiation (stdio vs SSE expose identical tools)
- No command allow-list, sandboxing, or confirmation gate
asyncio.create_subprocess_shell(shell=True) used for execution
- README does not warn about SSE transport security implications
The FastMCP SDK supports auth settings in its constructor, but scheduler-mcp never configures them.
Proof of Concept
1. Server: python main.py --transport sse --address 0.0.0.0 --port 8080
2. Attacker: GET /sse → receives SSE session_id (no auth required)
3. POST /messages/?session_id=xxx → JSON-RPC tools/call add_command_task
4. POST /messages/?session_id=xxx → JSON-RPC tools/call run_task_now
5. Arbitrary shell command executed on host
Tested and confirmed with real runtime. Commands execute via asyncio.create_subprocess_shell(shell=True).
Impact
- Remote Code Execution: Arbitrary OS commands as the server process user
- SSRF:
add_api_task allows forcing HTTP requests to internal services
- Information Disclosure:
list_tasks, get_task, get_server_info expose configuration and execution history
- No authentication required for any of the above
Recommended Fix
- Add authentication middleware using FastMCP
auth parameter
- Add
--require-auth CLI flag, mandatory for SSE transport
- Return proper CORS headers restricting cross-origin access
- Add security section to README warning about SSE exposure
- Consider
--disable-command-tasks flag for SSE mode
- Implement command allow-list or execution sandboxing
Environment
- scheduler-mcp commit:
5a2015a6cd9ebbef0feb1a382e762b2c5783a904
- MCP SDK: 1.27.1
- Python: 3.10.12
- OS: Ubuntu 22.04
Summary
When scheduler-mcp is configured with SSE transport (
--transport sse), the server exposes all MCP tools over HTTP without any authentication. An unauthenticated remote attacker who can reach the SSE port can create and execute arbitrary shell commands viaadd_command_task/run_task_now, achieving remote code execution with the privileges of the server process.Affected Versions
5a2015a(2025-07-24)Root Cause
The
SchedulerServerclass (mcp_scheduler/server.py) registers MCP tools via FastMCP without any authentication middleware. When started with SSE transport, the server binds an HTTP endpoint via uvicorn on the configured address/port.Key issues:
asyncio.create_subprocess_shell(shell=True)used for executionThe FastMCP SDK supports
authsettings in its constructor, butscheduler-mcpnever configures them.Proof of Concept
Tested and confirmed with real runtime. Commands execute via
asyncio.create_subprocess_shell(shell=True).Impact
add_api_taskallows forcing HTTP requests to internal serviceslist_tasks,get_task,get_server_infoexpose configuration and execution historyRecommended Fix
authparameter--require-authCLI flag, mandatory for SSE transport--disable-command-tasksflag for SSE modeEnvironment
5a2015a6cd9ebbef0feb1a382e762b2c5783a904