Back to skill

Security audit

Mcp Integration

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent MCP bridge, but it gives agents broad access to discover and invoke configured external tools without enough built-in guardrails.

Install only for trusted/admin agents and only with MCP servers you control or explicitly trust. Prefer read-only or least-privilege credentials, restrict which agents can use the mcp tool, require confirmation for database writes or sensitive data access, and review/redact diagnostic reports before sharing them publicly or with support.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T01 · Skill Instruction Hijacking

Warning
Location
src/index.js:42
Finding

Untrusted MCP Metadata and Results Are Exposed to the Agent Without Trust Boundaries

Content
View full analysis
{ this.tools.set(`${name}:${tool.name}`, { server: name, tool, client }); }); ``` ```javascript description: entry.tool.description, inputSchema: entry.tool.inputSchema ``` ```javascript return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; ``` ### Technical Analysis The plugin accepts tool descriptions, input schemas, and execution results from administrator-configured MCP servers and returns them verbatim as agent-visible text. No content classification, provenance marker, sanitization, or policy boundary distinguishes trusted plugin instructions from untrusted remote server content. MCP tool descriptions and results are expected to contain arbitrary natural language. A malicious or compromised MCP server can therefore embed instructions such as requests to disclose conversation data, invoke another sensitive tool, use attacker-selected arguments, or disregard the user's original objective. Because the accompanying Skill instructions direct the agent to inspect remote descriptions and use remote results in subsequent calls, such content creates an indirect prompt-injection channel. This behavior does not establish local code execution by itself. Exploitation depends on the agent interpreting remote content as instructions and possessing tools or data beyond the compromised MCP server. ### Attack Path 1. An administrator configures an attacker-controlled MCP server, or a legitimate configured MCP server is compromised. 2. During startup, the plugin calls `listTools()` against that server. 3. The server supplies a malicious tool desc ...[truncated 1349 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
docs/TROUBLESHOOTING.md:420
Finding

Diagnostic Report Instructions Can Disclose Secrets from OpenClaw Configuration

Content
View full analysis
/dev/null || echo "Failed" done ``` ```bash chmod +x diagnose-mcp.sh ./diagnose-mcp.sh > mcp-diagnostic.txt ``` ```text ### Support Channels 1. GitHub Issues: Include diagnostic report 2. Discord: OpenClaw Community #plugins channel 3. Email: Attach diagnostic report ``` ### Technical Analysis The troubleshooting guide instructs users to copy the complete `mcp-integration` plugin configuration from `~/.openclaw/openclaw.json` into a diagnostic file. It then instructs users to include or attach that file when contacting support. The configuration schema permits arbitrary server URLs and an `env` object. Documentation elsewhere in the project also describes API-key configuration. Consequently, the extracted configuration may contain: - API keys or tokens stored in environment configuration. - Passwords or tokens embedded in endpoint URLs. - Internal hostnames, ports, and service topology. - Sensitive server names or operational configuration. - Other credentials stored under arbitrary environment-variable names. The script performs no redaction. Although the guide later says configuration should have secrets redacted, that prose does not modify the generated report and does not require inspection before sharing. Recent MCP-related logs may also contain internal endpoint inform ...[truncated 1848 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (39)

MCP Config Access

High
Category
Agent Snooping
Confidence
92% confidence
Finding

The README normalizes allowing a chat agent to enumerate all connected MCP tools, which can reveal available integrations, internal capabilities, and potentially sensitive operational surface area. In an MCP integration plugin, tool discovery is especially sensitive because the entire purpose is brokering access to external systems; exposing that inventory to broadly accessible agents materially helps later misuse.

Content

Scanner excerpt · README.md (reported line 146)May include surrounding context.

In OpenClaw chat:

text
User: List all MCP tools

AI: I'll check what MCP tools are available.

MCP Config Access

High
Category
Agent Snooping
Confidence
84% confidence
Finding

This testing example again encourages tool enumeration from chat without emphasizing access controls, reinforcing insecure defaults for a capability-discovery action. While framed as a test step, in this plugin context it still teaches exposure of connected MCP capabilities to any agent context where the tool is enabled.

Content

Scanner excerpt · README.md (reported line 433)May include surrounding context.

node test-server.js

In OpenClaw chat

User: List MCP tools

AI: [Shows available tools from test server]

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/CONFIGURATION.md (reported line 136)May include surrounding context.

Then reference in server

text

**Option 3: .env file**
```bash
# ~/.openclaw/.env
KR_LEGAL_API_KEY=your-api-key-here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/CONFIGURATION.md (reported line 138)May include surrounding context.

Then reference in server

text

**Option 3: .env file**
```bash
# ~/.openclaw/.env
KR_LEGAL_API_KEY=your-api-key-here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · docs/CONFIGURATION.md (reported line 144)May include surrounding context.

json
{
  "envFile": "/home/user/.openclaw/.env",
  "plugins": { ... }
}

MCP Config Access

High
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · docs/REAL_EXAMPLE_KR_LEGAL.md (reported line 77)May include surrounding context.

In OpenClaw chat:

text
User: List MCP tools

AI: Let me check available MCP tools.
[Uses: mcp with action=list]

MCP Config Access

High
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · docs/REAL_EXAMPLE_KR_LEGAL.md (reported line 233)May include surrounding context.

In OpenClaw chat:

text
User: List MCP tools

AI: Let me check available MCP tools.
[Uses: mcp with action=list]

MCP Config Access

High
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · docs/TROUBLESHOOTING.md (reported line 152)May include surrounding context.

In OpenClaw chat:

text
User: List MCP tools

AI: Let me check available MCP tools.
[Uses: mcp with action=list]

MCP Config Access

High
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill accesses MCP server configuration files (mcp.json). MCP configs contain server URLs, authentication tokens, and tool definitions — reading them allows the skill to discover and potentially abuse other tool integrations.

Content

Scanner excerpt · docs/TROUBLESHOOTING.md (reported line 203)May include surrounding context.

In OpenClaw chat:

text
User: List MCP tools

AI: Let me check available MCP tools.
[Uses: mcp with action=list]

Instruction Override

High
Category
Prompt Injection
Confidence
70% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · README.md (reported line 412)May include surrounding context.

Diagnostic:

bash
# Enable debug mode
# Edit http-transport.js:
# new StreamableHTTPClientTransport(url, { debug: true })

Instruction Override

High
Category
Prompt Injection
Confidence
70% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · docs/TROUBLESHOOTING.md (reported line 246)May include surrounding context.

Diagnostic:

bash
# Enable debug mode
# Edit http-transport.js:
# new StreamableHTTPClientTransport(url, { debug: true })

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README explicitly promotes a database query capability and even shows raw SQL being passed through the MCP bridge, but it does not clearly warn that this can expose sensitive data or permit destructive operations if connected to a powerful backend. In this plugin’s context, the MCP layer is a generic tool-execution bridge for AI agents, so documenting unrestricted query usage without strong safety guidance meaningfully increases the chance of unsafe deployment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill instructs the agent to enumerate and invoke external MCP tools, which can reach arbitrary connected servers and services, but the skill metadata declares no explicit tool scope or permission boundaries. This creates an overbroad capability surface where user data may be sent to unintended endpoints and sensitive actions may be performed through third-party tools without clear restriction or informed approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill description presents MCP integration as a general utility feature but does not warn that tool discovery and tool calls may transmit user-provided content to external servers and execute third-party functionality. In this context, that omission is security-relevant because the entire purpose of the skill is brokering requests to external systems, increasing the risk of uninformed data disclosure and unsafe tool invocation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The API documentation presents arbitrary MCP tool execution as a normal operation and even highlights examples such as database queries, but it does not warn that these tools may have side effects on external systems, data, or network resources. In an agent setting, that omission can lead developers or users to permit unsafe tool invocation patterns, increasing the chance of unintended writes, destructive queries, or calls into sensitive infrastructure.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · docs/CONFIGURATION.md (reported line 291)May include surrounding context.

bash
# Test URL is accessible
curl http://localhost:3000/mcp

# Test with JSON-RPC request
curl -X POST http://localhost:3000/mcp \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The database query examples encourage direct retrieval and display of internal order data, including customer-identifying and business-sensitive fields, without any warning about least-privilege access, redaction, or authorization checks. In an MCP integration skill, examples strongly shape agent behavior, so omitting privacy guidance can normalize unsafe data access and disclosure to users or downstream systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The multi-step workflow demonstrates combining internal event records with an external weather service without warning that internal operational data such as event schedules and locations may be sensitive and may be indirectly disclosed through third-party MCP servers. Because this skill is specifically designed to bridge external tools and data sources, the lack of data-sharing boundaries increases the chance that agents will transmit unnecessary internal context to external services.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · README.md (reported line 515)May include surrounding context.

md
openclaw logs | grep MCP

# Check plugin directory
ls -la ~/.openclaw/extensions/mcp-integration/

# Test configuration syntax
cat ~/.openclaw/openclaw.json | jq '.plugins.entries["mcp-integration"]'

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · docs/CONFIGURATION.md (reported line 347)May include surrounding context.

md
openclaw logs | grep MCP

# Check plugin directory
ls -la ~/.openclaw/extensions/mcp-integration/

# Test configuration syntax
cat ~/.openclaw/openclaw.json | jq '.plugins.entries["mcp-integration"]'

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · docs/TROUBLESHOOTING.md (reported line 17)May include surrounding context.

md
openclaw logs | grep MCP

# Check plugin directory
ls -la ~/.openclaw/extensions/mcp-integration/

# Test configuration syntax
cat ~/.openclaw/openclaw.json | jq '.plugins.entries["mcp-integration"]'

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · docs/TROUBLESHOOTING.md (reported line 36)May include surrounding context.

md
openclaw logs | grep MCP

# Check plugin directory
ls -la ~/.openclaw/extensions/mcp-integration/

# Test configuration syntax
cat ~/.openclaw/openclaw.json | jq '.plugins.entries["mcp-integration"]'

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · docs/TROUBLESHOOTING.md (reported line 91)May include surrounding context.

netstat -tuln | grep 3000

Test server with JSON-RPC

curl -X POST http://localhost:3000/mcp
-H "Content-Type: application/json"
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

text

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 547)May include surrounding context.

C. Firewall blocking:

bash
# Allow local connections
sudo ufw allow from 127.0.0.1

# Or allow specific port
sudo ufw allow 3000/tcp

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · docs/TROUBLESHOOTING.md (reported line 121)May include surrounding context.

C. Firewall blocking:

bash
# Allow local connections
sudo ufw allow from 127.0.0.1

# Or allow specific port
sudo ufw allow 3000/tcp

Static analysis

No suspicious patterns detected.