Back to skill

Security audit

Mcp Client

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed MCP bridge, but it can launch configured local MCP servers with broad tool authority and full access to the agent process environment.

Install only if you trust every MCP server configured in your OpenClaw config and are comfortable with those processes receiving the agent's environment variables. Prefer using it for read-only calls, confirm specific write/delete/browser/database actions before use, and avoid running it from environments that contain broad API keys or production credentials.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/mcp-call.js:92
Finding

Full Parent Environment Exposed to Spawned MCP Servers

Content
View full analysis

Vulnerability Details

File Location: scripts/mcp-call.js, lines 92–98
Vulnerability Type: Excessive inheritance of potentially sensitive environment variables
Risk Level: High

Vulnerable Code

js
const { command, args = [], env: serverEnv = {} } = serverConfig;
const childEnv = { ...process.env, ...serverEnv };

const child = spawn(command, args, {
  stdio: ['pipe', 'pipe', 'pipe'],
  env: childEnv,
});

Technical Analysis

The script constructs the child process environment by copying every variable from process.env and then merging the MCP server's configured variables. Consequently, every invoked MCP executable can read the complete parent environment rather than only the variables required for its operation.

Agent and automation environments may contain API keys, cloud credentials, CI/CD tokens, service credentials, and other secrets. Although SKILL.md advises against logging MCP environment variables, that guidance does not prevent a spawned process from reading, using, or transmitting inherited secrets.

Exploitation requires a malicious or compromised executable to be referenced by an MCP server configuration and then invoked through this client. No shell command injection is involved because spawn() receives the command and argument array directly; the weakness is excessive credential exposure to the child process.

Attack Path

  1. An attacker introduces, replaces, or compromises an executable referenced by an entry under mcp.servers in the user's OpenClaw configuration.
  2. The user or agent invokes that configured server through scripts/mcp-call.js.
  3. The script starts the executable with an environment containing all values from process.env.
  4. The child process enumerates the inherited environment and extracts available credentials or tokens.
  5. If the child has network access, it can transmit those secrets externally; otherwise, it can use them locally to access services available from the host.

...[truncated 669 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not pass the complete parent environment to MCP servers.
  2. Construct a minimal allowlisted environment containing only variables required to launch the configured runtime, such as a controlled PATH, platform-required variables, and explicitly approved entries from serverConfig.env.
  3. Require explicit opt-in before forwarding sensitive variables to an individual server.
  4. Validate configured server commands against a trusted allowlist or record approved executable paths and verify them before execution.
  5. Resolve executables to trusted absolute paths where practical, reducing the risk of PATH-based executable substitution.
  6. Prompt for confirmation before the first execution of a newly configured or changed MCP server.
  7. Document that MCP servers run with the user's operating-system privileges and must be treated as trusted local code.
  8. Consider launching servers in a sandbox with restricted filesystem and network access to limit the consequences of compromise.

A safer environment construction pattern would resemble:

js
const childEnv = {
  PATH: process.env.PATH,
  HOME: process.env.HOME,
  ...serverEnv,
};

const child = spawn(command, args, {
  stdio: ['pipe', 'pipe', 'pipe'],
  env: childEnv,
});

The final allowlist should be platform-aware and should exclude credentials unless they are explicitly required by, and approved for, that specific MCP server.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The manifest promises broad MCP transport and config support, but the documented implementation only handles stdio and appears incomplete for YAML/SSE/streamable-http. Security-wise, this kind of capability mismatch can cause operators and downstream agents to make unsafe assumptions about how servers are connected, authenticated, or constrained.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 59)May include surrounding context.

md
Use `scripts/mcp-call.js` (see below) or inline Node.js to:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 88)May include surrounding context.

md
Use `scripts/mcp-call.js` (see below) or inline Node.js to:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 91)May include surrounding context.

md
Use `scripts/mcp-call.js` (see below) or inline Node.js to:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 98)May include surrounding context.

md
Use `scripts/mcp-call.js` (see below) or inline Node.js to:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 101)May include surrounding context.

md
Use `scripts/mcp-call.js` (see below) or inline Node.js to:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 104)May include surrounding context.

md
Use `scripts/mcp-call.js` (see below) or inline Node.js to:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill describes spawning arbitrary configured MCP server processes and passing environment variables, but it declares no explicit tool scope or permission boundaries. That weakens auditability and increases the chance the agent can access sensitive env-backed credentials or launch powerful external capabilities without clear guardrails.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Claiming SSE and streamable-http support when only stdio is implemented is a security-relevant integrity issue because users may assume remote transport scenarios are handled safely when they are not. While not an exploit by itself, inaccurate security-significant claims can lead to misconfiguration and unsafe operational decisions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This skill is specifically designed to bridge into MCP tools that may read or modify files, browser state, databases, and memory stores, yet it does not require confirmation or warn about destructive actions. In this context, the lack of user-intent verification materially raises the risk of unauthorized or accidental high-impact operations through powerful external tools.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documented memory MCP tools include create and delete operations, but the skill gives no warning to verify user intent before using those mutating actions. Because this skill can proxy powerful external tools, normalizing mutation examples without confirmation guidance increases the chance of accidental data loss or unauthorized state changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script spawns whatever executable is configured for the selected MCP server and passes it a merged environment containing the parent process environment plus server-specific variables, with no confirmation, allowlist, or restriction. In this skill context, that is security-relevant because MCP servers are explicitly used for powerful operations like file access, browser automation, memory storage, and database queries; a malicious or compromised config entry could execute arbitrary local commands and inherit secrets such as API keys, tokens, and other sensitive environment variables.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/mcp-call.js:88