Skip to content

fix(valkey): a url that an mcp valkey tool gets from the model gets the valkey password #2634

Description

@dan-petty

Problem Description

The MCP tools valkey_ping, valkey_get, valkey_info, valkey_stats, valkey_set and valkey_flush (CONST_MCP_EXPOSURE_TABLE) publish the option url: "Valkey URL to use in place of valkey.url". The model that calls the tool gives it. _resolve_client in src/devops_cli/commands/valkey.py builds a ValkeyClient for that URL, and gives it the password from get_valkey_password(settings). The client dials at the private level (EgressLevel.PRIVATE in src/devops_cli/valkey/client.py), which admits each address but cloud metadata. valkey-py sends AUTH <password> when it connects.

Thus a model can make devops-cli send the configured Valkey password to any host that it names, and valkey_set and valkey_flush write to that host. The cause is the same as in #2480: a URL from the caller is used as configuration.

Reproduction Steps

  1. Set valkey.password (or DEVOPS_CLI_VALKEY_PASSWORD) to a test value.
  2. In a test, bind a listener on 127.0.0.1 and read what it receives.
  3. Call the MCP tool valkey_ping with url="valkey://127.0.0.1:<port>/0".
  4. Read the bytes that the listener received.

Expected vs Actual Behavior

Expected: a tool dials only the configured Valkey (valkey.url), or the password goes only to the origin of valkey.url. A URL option stays for a person at the command line.

Actual: on main at a3eb41f4, the listener received *2\r\n$4\r\nAUTH\r\n$9\r\n<password>\r\n, and then a CLIENT SETINFO command. The password was sent to the URL that the caller gave.

Other MCP tools that publish a URL option and are not checked yet: ai_prewarm (url), ai_benchmark (servers) and vault_status (vault_addr).

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

valkey_ping(url="valkey://127.0.0.1:<port>/0") -> listener received:
  b'*2\r\n$4\r\nAUTH\r\n$9\r\n<password>\r\n'
  b'*4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$9\r\nvalkey-py\r\n'

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.

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 direct the configured Valkey password to any host it names, which is a credential-exfiltration vulnerability.
    • Priority: P1-High. The configured Valkey password is sent to an arbitrary host chosen by the model, and valkey_set and valkey_flush can write to that host.
    • Value: High. Prevents exfiltration of the Valkey password to attacker-chosen hosts.
    • Effort: Low. The fix removes or restricts the url parameter in the six Valkey MCP tool definitions, matching the approach of #2480.
    • 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 items fix MCP tools that accept a caller-supplied URL and leak a credential to that host; the candidate targets Valkey tools and the Valkey password, while #2480 targets AI gateway tools and the AI API key.
  3. added
    priority/p1-high
    on Oct 29, 2026
  4. removed
    status/new
    on Oct 30, 2026
  5. added a commit that references this issue on Nov 2, 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