Skip to content

fix(vault): the MCP tool vault_status takes no address - #2706

Merged
dan-petty merged 4 commits into
mainfrom
fix/2639-mcp-vault-status-no-addr
Oct 29, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/2639-mcp-vault-status-no-addr

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The MCP tool vault_status published the option vault_addr. A model that gave it made devops-cli send a GET request to any path of any loopback or private host, and read the version and cluster_name fields of the answer. An address that ends in a query or a fragment made the text of the caller the path of the request.

The tool now publishes only dry_run, through _PATH_PARAM_RESTRICTIONS. It asks the Vault that VAULT_ADDR or DEVOPS_CLI_VAULT_ADDR names, at the fixed path /v1/sys/health. With neither variable set, the call fails and the error names both. A call that gives vault_addr fails at the argument contract and sends no request. The command keeps --addr for a person.

VaultSecretBroker also refuses an address that holds ? or #, so an address of a person cannot change the path either. The error for a missing address no longer names a --vault-addr option that does not exist.

Change: openspec/changes/archive/2026-10-29-2639-mcp-vault-status-no-addr/

Closes #2639

The MCP tool vault_status published the option vault_addr. A model that gave it made devops-cli send a GET request to any path of any loopback or private host, and read the version and cluster_name fields of the answer. An address that ends in a query or a fragment made the text of the caller the path of the request.

The tool now publishes only dry_run, through _PATH_PARAM_RESTRICTIONS, and asks the Vault that VAULT_ADDR or DEVOPS_CLI_VAULT_ADDR names. A call that gives vault_addr fails at the argument contract and sends no request. The command keeps --addr for a person.

VaultSecretBroker also refuses an address that holds a query or a fragment, and the error for a missing address names the two variables and no longer names a --vault-addr option that does not exist.

Refs #2639
… list

Change: openspec/changes/2639-mcp-vault-status-no-addr/

Refs #2639
Change: openspec/changes/archive/2026-10-29-2639-mcp-vault-status-no-addr/

Refs #2639
@dan-petty

Copy link
Copy Markdown
Owner Author

Targeted tests on the rebased branch: 335 passed (tests/test_vault_cmd.py, test_vault_broker.py, test_fastmcp_contracts.py, test_mcp.py). An earlier run of 698 tests (these files plus test_docs.py, test_fastmcp_in_process.py, test_pydantic_ai_mcp.py, test_secret_resolution.py, test_network_security_and_trace_correlation.py, test_ai_gateway.py, test_valkey.py, test_k8s_logql.py) also passed.
openspec check and docs check pass. The pre-push hook passed.

Fail-to-pass against origin/main (exit 0). Six tests fail on base and pass on the branch:

  failed on base: tests.test_vault_broker::test_vault_broker_refuses_an_address_that_changes_the_request_path[fragment] (Failed: DID NOT RAISE VaultConfigurationError)
  failed on base: tests.test_vault_broker::test_vault_broker_refuses_an_address_that_changes_the_request_path[query] (Failed: DID NOT RAISE VaultConfigurationError)
  failed on base: tests.test_fastmcp_contracts::test_the_vault_tools_take_no_address (assert (True, True, True, False) == (True, True, True, True))
  failed on base: tests.test_vault_cmd.TestStatusToolTakesNoAddressFromTheModel::test_the_tool_publishes_no_address_parameter (AssertionError: assert [['vault_addr', 'dry_run']] == [['dry_run']])
  failed on base: tests.test_vault_cmd.TestStatusToolTakesNoAddressFromTheModel::test_an_address_argument_is_refused_and_reaches_no_socket (AssertionError: assert (False, False....0\r\n\r\n')]) == (True, True, False, [], []))
  failed on base: tests.test_vault_cmd.TestStatusToolTakesNoAddressFromTheModel::test_a_call_with_no_configured_vault_names_the_settings (assert (True, True, True, []) == (True, True, False, []))
6 failed on base (6 failed and 164 passed in tests/test_fastmcp_contracts.py, tests/test_vault_broker.py, tests/test_vault_cmd.py; 0 errored).

On base, the call with vault_addr="http://127.0.0.1:8200/some/path?x=" dialled 127.0.0.1:8200 and wrote GET /some/path?x=/v1/sys/health. After the change, the call fails at the argument contract and the socket gets no dial.

@dan-petty dan-petty added scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak labels Oct 29, 2026
@dan-petty
dan-petty marked this pull request as ready for review October 29, 2026 22:33
@dan-petty
dan-petty merged commit 68c226c into main Oct 29, 2026
18 checks passed
@dan-petty
dan-petty deleted the fix/2639-mcp-vault-status-no-addr branch October 29, 2026 22:34
dan-petty pushed a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.21.0](v0.20.0...v0.21.0)
(2026-10-29)


### Features

* **telemetry:** count the project items by release tag, not by
milestone ([#2710](#2710))
([253a97d](253a97d))


### Bug Fixes

* **ai:** the MCP benchmark tool takes no server URL
([#2707](#2707))
([7f7f84b](7f7f84b)),
closes [#2638](#2638)
* **rag:** name the Qdrant span server by host and port
([#2705](#2705))
([57725c3](57725c3)),
closes [#2459](#2459)
* **roadmap:** take a plan that a person merged as a Planned item
([#2718](#2718))
([043463b](043463b)),
closes [#2714](#2714)
* **security:** pin tflint; remove dive and devops docker analyze-layers
([#2712](#2712))
([244bafb](244bafb))
* **vault:** the MCP tool vault_status takes no address
([#2706](#2706))
([68c226c](68c226c)),
closes [#2639](#2639)


---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant