# CVE-2025-58062 openmcp-client open() RCE class

- ID: cve-2025-58062-openmcp-client
- Reported: 2025-08-28
- Researcher: Industry CVE assignment
- Organization: openmcp-client maintainers / NVD
- AI role: ai_agent_or_mcp_as_target (Agent / MCP as target)
- Confidence in AI involvement: not assessed
- Research / borderline: false
- Last reviewed: 2026-10-20
- Entry page: https://openattacks.ai/attacks/cve-2025-58062-openmcp-client/
- Entry JSON: https://openattacks.ai/api/attacks/cve-2025-58062-openmcp-client.json
- Browse title: openmcp-client OAuth URL command injection (CVE-2025-58062)
- Editorial summary: On Windows, openmcp-client mishandled the MCP OAuth authorization URL, allowing PowerShell command injection. This is the same flaw class as mcp-remote and opencode.
- Evidence class (catalog annotation): Vulnerability report
- Source-stated target environments: Agents & MCP; Windows
- Stage hunts and conditional defenses: https://openattacks.ai/api/defenses/cve-2025-58062-openmcp-client.json

## Technique
Same open() PowerShell sink class as mcp-remote/opencode: MCP OAuth authorization URL handled unsafely on Windows leading to command injection. Documented in Pillar's comparative analysis of the vulnerability class.

## Stack relevance (editorial)
Assessment: mapped. Editorial applicability reviewed against the catalog source account; not a scan or independent incident verification.
First action: Check the vendor advisory and update the affected client; review remote MCP OAuth destinations.
- Relationship: target; tools: openmcp-client; OS scope: windows; requires existing MCP connections: true.
  Relevance: openmcp-client is the affected MCP client in the source account.
  Condition to check: Confirm that the installed version is affected by the historical report; selecting a product does not establish its version or patch status.
  Condition to check: The reported command-injection path depends on Windows OAuth URL handling and an untrusted remote MCP server.
  Evidence: https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth
A product mention alone is not a victim-side applicability mapping. Selection does not verify affected versions, permissions or compromise.

## Initial access
unknown

## AI tooling and models
- [openmcp-client](https://github.com/LSTM-Kirigaya/openmcp-client)
- MCP OAuth

## Other tooling
- unknown

## Victims and sectors
unknown

## Target geography
- unknown

## Attribution
unknown

## Scale and metrics
unknown

## Attack flow
Catalog reconstruction of the supplied source account. Unknowns and research caveats are preserved.
### step-1: Full delivery chain is undisclosed [unknown]
The seed does not specify every connection prerequisite.
Evidence: https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth

### step-2: Client handles an MCP OAuth URL [ai]
The authorization URL is passed to the browser-opening helper.
Evidence: https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth

### step-3: Windows shell interprets the URL [execution]
Unsafe open() handling exposes a PowerShell command-injection sink.
Evidence: https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth

### step-4: Commands execute on the client [impact]
The report groups openmcp-client with the same OAuth URL execution class.
Evidence: https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth

Connections:
- step-1 -> step-2
- step-2 -> step-3
- step-3 -> step-4

## Stage defense and hunting recommendations
Editorial recommendations, not validated coverage. Source-controlled query starters are drafts. Custom-schema examples require telemetry collection and field mapping; absence of a mapping means not assessed. MagicSword policy opportunities require managed Windows scope and enforcement.
### step-1: No source-backed runtime hunt yet
- Visibility: Not established
- Query origin: catalog_authored; status: not_applicable; log scope: gap
- Hunt hypothesis: The supplied account does not establish a deployed victim-side behavior for this stage.
- Required telemetry: not assessed
- Investigate: Obtain a source-backed procedure and identify which party could observe it before drafting a detection.
- Limitation: Marketing claims, unknown steps and unconfirmed deployments are not detection coverage. No rule is generated for this stage.
- Qualification: The supplied account leaves this stage unestablished. Obtain a source-backed procedure before proposing a runtime query.
- No direct MagicSword prevention claim is recorded for this stage.

### step-2: Unexpected agent tool use
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/agent-tools.sigma.yml
- KQL query download: /api/detections/agent-tools.kql
- SPL query download: /api/detections/agent-tools.spl
- Hunt hypothesis: Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.
- Required telemetry: Agent tool-call audit records with session / tool / destination; Tool-definition and approval changes; Endpoint process, file-access and network evidence where available
- Investigate: Join input provenance, tool descriptions and calls by session ID and compare the action to the approved task.
- Investigate: Inspect child processes and destinations; record whether execution was in-process, local, or through a remote SaaS connector.
- Limitation: Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.
- No direct MagicSword prevention claim is recorded for this stage.

### step-3: Suspicious Windows script execution
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: native
- SIGMA query download: /api/detections/windows-shell.sigma.yml
- KQL query download: /api/detections/windows-shell.kql
- SPL query download: /api/detections/windows-shell.spl
- Hunt hypothesis: A script host or shell runs encoded content, a remote URL, or inline script syntax, then downloads or launches a payload.
- Required telemetry: Windows process creation: Sysmon Event 1 or Defender DeviceProcessEvents; PowerShell script-block logging when enabled; Download / network and installer events
- Investigate: Follow the parent and child process tree and recover the script or URL from logs without executing it.
- Investigate: Correlate the payload's signer/hash, persistence, and network activity; baseline approved automation.
- Limitation: Encoded commands and remote administration can be legitimate. This does not cover every script host, in-process execution, or non-Windows branch.
- Conditional MagicSword policy: Use MagicSword application control to restrict an unneeded Windows shell/helper or deny unapproved payloads while the vulnerable client is patched.
- Policy scope: The reported Windows shell branch; an allowed PowerShell interpreter can still run malicious arguments.
- Policy limitation: Policy opportunity, not tested incident coverage. Requires enrolled Windows devices, a policy covering the actual executable, and enforcement. Audit mode records decisions without blocking; allowed tools and in-process / cloud actions can remain reachable.
- Policy reference: https://www.magicsword.io/use-cases/application-control?utm_source=openattacks&utm_medium=referral&utm_content=stage-control

### step-4: Suspicious Windows script execution
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: native
- SIGMA query download: /api/detections/windows-shell.sigma.yml
- KQL query download: /api/detections/windows-shell.kql
- SPL query download: /api/detections/windows-shell.spl
- Hunt hypothesis: A script host or shell runs encoded content, a remote URL, or inline script syntax, then downloads or launches a payload.
- Required telemetry: Windows process creation: Sysmon Event 1 or Defender DeviceProcessEvents; PowerShell script-block logging when enabled; Download / network and installer events
- Investigate: Follow the parent and child process tree and recover the script or URL from logs without executing it.
- Investigate: Correlate the payload's signer/hash, persistence, and network activity; baseline approved automation.
- Limitation: Encoded commands and remote administration can be legitimate. This does not cover every script host, in-process execution, or non-Windows branch.
- No direct MagicSword prevention claim is recorded for this stage.


## MITRE ATLAS
Mappings are catalog annotations based on described behavior, not assignments or endorsements by MITRE.
No source-backed mapping is currently recorded.

## Defensive notes
Upgrade clients; never shell-interpolate remote OAuth URLs

## Sources
- https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth
