Repository navigation
Closed
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/mcpModel Context Protocol tools, system resources, and promptstype/securityType security: a vulnerability or a leak
Milestone
Description
Problem
The MCP tool telemetry_profile(command=..., trace_id=...) (ai/mcp/server.py:1140-1150) runs any program an MCP client names, with the user's full environment.
- The tool passes
commandtouv run devops telemetry profile <command>, after_validate_mcp_arg, which only refuses a leading hyphen. _run_profiled_command(commands/telemetry.py:303-322) splits that string withshlex.splitand runs it throughrun_subprocess(..., isolate_env=False). Nothing limits it to devops-cli commands.
The threat model treats MCP calls as untrusted input, so a prompt-injected agent with this server attached can run arbitrary commands, with every credential in the environment.
Found while reviewing #949 on 2026-10-02. With the tool's Jaeger read stubbed, telemetry_profile(command='devops review verify <session> --index 1 --status INVALIDATED -r planted') recorded a human verdict, even though #949's verify_finding tool always records agent.
Acceptance criteria
- MCP tool.
telemetry_profileno longer takes a command. MCP clients profile a trace bytrace_idonly, and the tool's schema and docs say so. - CLI.
devops telemetry profile <command>runs only a devops-cli command: its first word must bedevops, and it is run through the same entry point. Anything else is refused with a message, exit 1. - Environment. The profiled child keeps the full environment only for the devops-cli entry point; the docstring says why.
- Other MCP tools. Every tool in
ai/mcp/server.pyis checked for the same pattern: a free-form string split into an argv or passed to a shell. The PR lists the result. - Tests:
- The MCP tool's signature has no
commandparameter. devops telemetry profile "bash -c true"exits 1 without starting a process.devops telemetry profile "devops version"still runs.
- The MCP tool's signature has no
uv run devops cipasses.
Key questions
- Is this a critical fix? Yes, a security fix: arbitrary command execution from an untrusted caller.
Metadata
Metadata
Assignees
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/mcpModel Context Protocol tools, system resources, and promptstype/securityType security: a vulnerability or a leak
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(security): the mcp telemetry_profile tool runs no command, and de…
dan-petty commentedon Oct 2, 2026
Closed by #991, merged into
release/v0.2.25.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.feat(release): v0.2.25 (#1089)