Skip to content

fix(vault): an address that the mcp tool vault_status gets from the model reaches private addresses #2639

Description

@dan-petty

Problem Description

The MCP tool vault_status publishes the option vault_addr: "Vault cluster HTTP API address". The model that calls the tool gives it. VaultSecretBroker.get_status in src/devops_cli/security/vault_broker.py sends GET {vault_addr}/v1/sys/health at the private level (EgressLevel.PRIVATE), which admits every address but cloud metadata. No token is sent.

The address can end in ?x=. Then the path of the request is the path that the caller wrote, and /v1/sys/health is only the value of the query. The tool prints the version and cluster_name fields of a JSON answer. So a model can send a GET request to any path of any private or loopback service, and read two fields of the answer.

The cause is the same as in #2480: an address from the caller is used as configuration.

Reproduction Steps

  1. Leave ai.allow_private_network unset.
  2. In a test, install record_connects from tests/web_fakes.py with a canned JSON answer that holds the fields version and cluster_name.
  3. Call the MCP tool vault_status with vault_addr="http://127.0.0.1:8200/some/path?x=".
  4. Read recorder.dialled, recorder.written and the tool reply.

Expected vs Actual Behavior

Expected: the tool reports only the configured Vault. An address option stays for a person at the command line.

Actual: on main at a3eb41f4, the client dialled 127.0.0.1:8200 and wrote GET /some/path?x=/v1/sys/health. The reply held the version and cluster_name values of the answer.

Environment Diagnostics

  • DevOps CLI Version: 0.15.1 (main at a3eb41f4)
  • Python Version: 3.14.10
  • OS & Architecture: Linux x86_64
  • Execution Environment: DevContainer

Logs, Traces, or Terminal Output

recorder.dialled -> [('127.0.0.1', 8200)]
recorder.written -> [b'GET /some/path?x=/v1/sys/health HTTP/1.1\r\nHost: 127.0.0.1:8200\r\n...']
reply            -> Version <value from the answer>, Cluster <value from the answer>

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Proposed design

Problem statement

The MCP tool vault_status exposes a vault_addr option that the model sets. A model can craft an address with a query string that changes the request path. This lets the model send a GET to any private or loopback service and read two fields from the answer. The fix removes the option so the model cannot set the address.

Acceptance criteria

Requirement: No model-supplied address

The MCP tool vault_status SHALL NOT accept a vault_addr parameter from the model.

Scenario: schema inspection

  • WHEN the vault_status tool schema is read by a client
  • THEN the parameters list does not include vault_addr

Requirement: Configured address only

The tool SHALL resolve the Vault address from environment variables or CLI configuration only.

Scenario: env var resolution

  • WHEN VAULT_ADDR is set to http://10.0.0.1:8200 and the tool is called with no address argument
  • THEN the HTTP request targets host 10.0.0.1 port 8200

Requirement: Fixed health path

The tool SHALL request the path /v1/sys/health on the configured host.

Scenario: path integrity

  • WHEN the tool is called and the request bytes are recorded by record_connects
  • THEN the request line is GET /v1/sys/health HTTP/1.1

Existing Tool Considered

The project builds its own MCP tool. No open, maintained library provides a vault_status MCP tool with a fixed address. The written cost is about 80 tokens to remove the vault_addr parameter from the tool registration, update the tool docstring in docs/MCP_TOOLS.md, and add one test that asserts the parameter is absent from the schema.

Key questions

  • Where is the vault_status MCP tool registered and where is its vault_addr option defined?: The tool is documented in docs/MCP_TOOLS.md at line 2462, which lists vault_addr as a string option. The broker that makes the request is VaultSecretBroker.get_status in src/devops_cli/security/vault_broker.py. The MCP tool registration that exposes the option to the model is in the MCP server code that builds the tool schema. [sources: docs/MCP_TOOLS.md:2462, src/devops_cli/security/vault_broker.py]
  • What is the fix for the SSRF defect?: Remove vault_addr from the MCP tool's parameter list so the model cannot set it. The broker already resolves the address from VAULT_ADDR or DEVOPS_CLI_VAULT_ADDR environment variables, which a person sets. This mirrors the fix delivered in fix(ai): a url that an mcp tool gives to devops ai gateway status, routes or probe-backend reaches loopback and gets the ai api key #2480 for the AI gateway tools. (best practice) [sources: openspec/changes/archive/2026-10-29-2480-mcp-gateway-url-override/proposal.md, src/devops_cli/security/vault_broker.py]
    • Chosen: Remove vault_addr from the tool schema. The model should not set infrastructure addresses. The address is already in environment variables set by a person. This is the same fix pattern as fix(ai): a url that an mcp tool gives to devops ai gateway status, routes or probe-backend reaches loopback and gets the ai api key #2480.
    • Rejected: Validate the address more strictly in the broker. Does not fix the root cause. The model can still probe different paths and hosts by varying the address. The broker already validates scheme and netloc.
    • Rejected: Restrict the address to a fixed allowlist. Over-engineered. The address is already in environment variables. An allowlist adds maintenance cost without removing the model's ability to probe.
  • Should the broker also reject addresses that contain a query string, as defense in depth?: Yes. After removing the model-supplied option, the broker should also reject or strip a query string from the resolved address. This prevents a misconfigured environment variable from changing the request path. The check is one line: reject if urlsplit(addr).query is non-empty. (best practice) [sources: src/devops_cli/security/vault_broker.py]
    • Chosen: Reject an address with a non-empty query string. Prevents a misconfigured env var from changing the path. One line of code. Defense in depth behind the primary fix.
    • Rejected: Strip the query string silently. Hides a misconfiguration. A person who set a bad address gets no error and may not notice.
    • Rejected: Do nothing; the primary fix is enough. The model can no longer set the address. But a person could still set a bad env var. The cost of the check is one line.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/security
    status/new
    value/high
    effort/low
    on Oct 29, 2026
  2. dan-petty commented on Oct 29, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/security. A model can craft a GET request to any private or loopback address and read response data, which is an SSRF security defect.
    • Priority: P1-High. The defect is exploitable on main and allows data exfiltration from private services with no token required.
    • Value: High. It exposes internal service data to an untrusted model caller and breaks the egress boundary the project enforces.
    • Effort: Low. The fix mirrors the pattern already described for sibling tools: validate or remove the model-supplied address option in one function.
    • Related: fix(ai): a url that an mcp tool gives to devops ai gateway status, routes or probe-backend reaches loopback and gets the ai api key #2480, which asks for a different change. Both share the root cause of a model-supplied address used as configuration at the private egress level, but #2480 fixes AI gateway tools leaking the API key while this fixes vault_status leaking response fields.
  3. added
    priority/p1-high
    on Oct 29, 2026
  4. added
    status/ready
    and removed
    status/new
    on Oct 29, 2026
  5. devops-cli-service commented on Oct 29, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at ec2f7f7 (see proposed design in issue body).

  6. added 2 commits that reference this issue on Oct 29, 2026
    68c226c
    279b3d0
  7. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p1-highsource/agenttype/securityvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions