Back to skill

Security audit

MCP Workflow

Security checks for vulnerabilities and agentic risk

Overview

This workflow skill is not clearly malicious, but it needs review because its MCP server can read arbitrary local files and it stores workflow state on disk without strong boundaries.

Install only if you are comfortable with a local MCP server that can read files by arbitrary path. Run it in a constrained project directory or sandbox, avoid connecting it to untrusted MCP clients, do not store secrets in workflow inputs or memory, and review any workflow that exports, emails, posts, deploys, or writes generated files before allowing it to run.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/mcp-server.js:117
Finding

Unrestricted Local File Disclosure Through MCP Resource Handlers

Content
View full analysis

Vulnerability Details

File Location: scripts/mcp-server.js, lines 117–121, 166–190
Vulnerability Type: Arbitrary local file read and directory traversal
Risk Level: High

Vulnerable Code

javascript
{
  uriTemplate: 'file://{path}',
  name: 'File System',
  mimeType: 'text/plain',
  description: 'Access files by path',
},
javascript
// Template resource
if (uri.startsWith('template://')) {
  const name = uri.replace('template://', '');
  const templatePath = path.join(CONFIG.templatesDir, `${name}.json`);
  if (fs.existsSync(templatePath)) {
    return {
      contents: [
        {
          uri,
          mimeType: 'application/json',
          text: fs.readFileSync(templatePath, 'utf8'),
        },
      ],
    };
  }
  throw new Error(`Template not found: ${name}`);
}

// File resource
if (uri.startsWith('file://')) {
  const filePath = uri.replace('file://', '');
  if (fs.existsSync(filePath)) {
    const content = fs.readFileSync(filePath, 'utf8');
    return {
      contents: [
        {
          uri,
          mimeType: 'text/plain',
          text: content,
        },
      ],
    };
  }

Technical Analysis

The file:// MCP resource accepts a caller-controlled path and passes it directly to fs.existsSync and fs.readFileSync. The implementation does not:

  • Restrict access to an approved workspace or resource directory.
  • Canonicalize the path before applying access-control checks.
  • Reject absolute paths or ../ traversal sequences.
  • Deny access to sensitive files.
  • Enforce file-type or file-size restrictions.
  • Request user confirmation before accessing a new location.

Consequently, the MCP server acts as an arbitrary local file-reading primitive under the privileges of the account running the server.

The template:// handler has a related directory-traversal weakness. The template name is i ...[truncated 1899 chars]

Remediation
View remediation

Remediation Suggestions

  1. Define explicit resource roots: Configure one or more approved workspace directories and prohibit access outside them.
  2. Canonicalize before authorization: Resolve both the approved root and requested path with fs.realpathSync or an equivalent canonicalization operation.
  3. Enforce containment: Verify that the canonical requested path equals the approved root or begins with the canonical root followed by the platform path separator.
  4. Reject unsafe inputs: Reject absolute paths, null bytes, traversal components, malformed URI encoding, and unsupported URI forms.
  5. Validate template names: Permit template identifiers matching a narrow pattern such as ^[A-Za-z0-9_-]+$; do not accept path separators or traversal components.
  6. Restrict readable content: Apply allowlists for extensions, maximum file sizes, and approved MIME types. Explicitly deny credential stores, SSH directories, environment files, and agent state.
  7. Apply least privilege: Run the server under a dedicated account with access only to required workflow resources.
  8. Require authorization or confirmation: Obtain explicit user approval before reading paths not previously authorized.
  9. Avoid leaking path details: Return structured generic errors rather than exposing sensitive filesystem paths.
  10. Add security tests: Test absolute paths, ../ traversal, encoded traversal, symlink escapes, Windows path forms, and attempts to read known sensitive locations.
  11. Remove unrestricted access if unnecessary: If arbitrary files are not essential to the workflow, remove the file://{path} resource template entirely and expose only named, pre-registered resources.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill appears to support filesystem writes, persistent local state, server process management, and workflow import/export utilities, while presenting itself as a simpler workflow helper with no declared permissions. This under-disclosure makes the skill more dangerous in context because users may authorize it without realizing it can create/modify files, maintain persistent state, or manage local processes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill appears to support filesystem writes, persistent local state, server process management, and workflow import/export utilities, while presenting itself as a simpler workflow helper with no declared permissions. This under-disclosure makes the skill more dangerous in context because users may authorize it without realizing it can create/modify files, maintain persistent state, or manage local processes.

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 14)May include surrounding context.

md
node scripts/mcp-server.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/mcp-server.js

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The ReadResource handler reads any path supplied via file:// with no allowlist, sandbox, path normalization, or authorization checks. This creates a direct arbitrary local file read primitive, which can leak credentials, tokens, source code, configuration, and other host secrets to any MCP client able to invoke the resource.

Content

No source excerpt is available for this finding.

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · scripts/mcp-server.js (reported line 458)May include surrounding context.

js
}
    
    case 'memory.delete': {
      delete memoryStore[args.key];
      saveMemory();
      return {
        content: [

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/mcp-server.js (reported line 717)May include surrounding context.

js
throw new Error(`Prompt not found: ${name}`);
  }
  
  return prompt;
});

// Helper functions

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill advertises and documents capabilities that interact with environment/configuration and external execution surfaces, but it does not declare any explicit tool scope or permissions boundaries. In a workflow automation skill, missing scope declarations can cause users or orchestrators to underestimate what the skill can access or invoke, increasing the chance of unintended privilege use.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
76% confidence
Finding

The instruction to create configuration under ~/.openclaw/ introduces session persistence across runs. Persistent local state is not inherently malicious, but in this skill's context it can retain server definitions, workflow settings, or potentially sensitive operational data beyond the immediate session, increasing privacy and security risk if the host is shared or the file is later read by other tools.

Content

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

Configuration

Create ~/.openclaw/mcp-workflow.json:

json
{
  "servers": [

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guidance explicitly recommends logging workflow inputs and outputs, which in an MCP workflow can include prompts, embedded resources, tool arguments, model responses, and other user-provided content. Without minimization, redaction, or retention controls, this creates a clear risk of sensitive data exposure through logs, especially in automation systems that aggregate data across multiple steps and servers.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The example encourages capturing workflow input and output values in plain language, which can directly preserve sensitive user data, credentials, proprietary documents, or model-generated secrets in log stores. In the context of MCP workflow automation, where data may flow between several services and prompts evolve dynamically, indiscriminate logging increases the blast radius and persistence of any exposed information.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/mcp-spec.md (reported line 16)May include surrounding context.

text
file://path/to/file.md
git://repo/branch/path
https://api.example.com/data

Resource Templates

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file documents a workflow pattern that culminates in a release action on a deployer server, which can affect system integrity or production state. The surrounding description only says "Multiple MCP servers collaborating" and provides no warning or caution about the potentially destructive or irreversible nature of deployment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The server advertises a file://{path} resource template, explicitly exposing arbitrary local file access to MCP clients. In a workflow automation skill, this is broader than necessary and can enable sensitive file disclosure if a connected client requests paths like SSH keys, environment files, or application secrets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill exposes arbitrary file-reading capability in its resource templates without user-facing disclosure or consent boundaries. While the core issue is the file read itself, the lack of clear disclosure increases the chance users or integrators will grant trust to a server that can access far more local data than expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The server persists memory updates and deletions to a local JSON file without clearly disclosing that tool calls mutate durable local state. This is primarily a transparency and safety issue: users may not realize workflows can leave persistent artifacts or erase prior state across sessions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The template advertises a generic capability to "Generate documentation from codebase" without narrowing scope, repository boundaries, or requiring explicit user confirmation before broad codebase analysis. In agent-routing contexts, overly broad descriptions can cause the skill to activate on common documentation requests and then inspect large portions of the workspace, increasing the chance of unintended data exposure or overreach.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The workflow explicitly writes generated documentation to docs/ but does not disclose to the user that it will modify the workspace. A skill that performs file writes without clear user-facing notice can surprise users, overwrite existing content, or be invoked in contexts where read-only analysis was expected.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This manifest file uses the prompt value "meal-planner" as the activation reference without any scope, constraints, or negative examples. While somewhat domain-related, it is still broad enough that ordinary references to meal planning could ambiguously match, and the file does not clarify when the skill should or should not activate.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The export step allows sending generated content to external targets such as email and Notion without any explicit confirmation, warning, or disclosure in the workflow definition. If the meal plan includes user-specific dietary preferences, notes, or other personal content, this can result in unintended data exfiltration to third-party services through a normal-looking automation step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Workflow execution persists the full input/context to a hidden memory file without clear disclosure, which can unintentionally store sensitive user data such as tokens, prompts, project details, or personal content. In an agent skill context, silent persistence increases confidentiality risk because users may assume inputs are ephemeral while the script retains them on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The memory commands allow modification and deletion of persisted workflow data with no strong user warning or safety controls. In practice this can lead to silent state tampering, data loss, or retention of sensitive information in a hidden file, especially when used by automation or users unaware of the persistence model.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes workflow automation using MCP patterns, which reasonably covers creating and running workflows. However, this script also starts, stops, and tails logs for a background Node.js server, which is an operational process-management capability beyond simple workflow orchestration.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Starting a background server process with Node.js, recording its PID, killing it later, and streaming logs introduces host-level process-management behavior. That capability is not explicitly justified by the manifest's short description of workflow automation and is broader than the expected core functions of defining and executing workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The example includes a send-email distribution step, which can transmit generated report contents to external recipients, but the markdown provides no warning about data sensitivity, recipient validation, or privacy considerations. For documentation describing behaviors that may affect user data or privacy, a brief disclosure is expected.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.