Back to skill

Security audit

mcp-code-execution

Security checks for vulnerabilities and agentic risk

Overview

This skill is a documented MCP workflow orchestrator, but it asks agents to persist workflow state externally and alter execution flow without enough user control or data-handling limits.

Install only if you are comfortable with this skill influencing MCP workflow routing and subagent use. Before using it on sensitive projects, require local/session-scoped storage, avoid full context snapshots, redact secrets, and confirm any external storage destination and retention policy.

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

Warning
Location
modules/mcp-coordination.md:24
Finding

Unrestricted External Storage of Sensitive Workflow and Context Data

Content
View full analysis

Vulnerability Details

File Location: modules/mcp-coordination.md:14-25, modules/mcp-coordination.md:52-63, modules/mcp-coordination.md:106-111, modules/mcp-coordination.md:205-216, modules/mcp-subagents.md:117-121, modules/mcp-subagents.md:132-140
Vulnerability Type: Uncontrolled external persistence of potentially sensitive data
Risk Level: Medium

Vulnerable Code

modules/mcp-coordination.md:14-25:

python
current_data = input_data
results = []

for subagent in subagents:
    # Monitor context before each subagent
    if estimate_context_usage() > get_mecw_limit() * 0.8:
        apply_emergency_compaction()

    # Execute subagent with minimal context
    subagent_result = subagent.execute_focused_task({
        'data': current_data,
        'context_limit': get_mecw_limit() * 0.4
    })

    current_data = subagent_result.get('next_input', current_data)
    results.append(subagent_result)

    # Store intermediate results externally
    store_intermediate_result(subagent.purpose, subagent_result)

modules/mcp-coordination.md:52-63:

python
# Launch subagents with minimal context
futures = []
for subagent, data_split in zip(subagents, data_splits):
    future = subagent.execute_async({
        'data': data_split,
        'context_limit': get_mecw_limit() // len(subagents)
    })
    futures.append(future)

# Collect results with external storage
results = []
for future in futures:
    result = future.get_result()
    store_external_result(result.subagent_id, result.data)
    results.append(result)

modules/mcp-coordination.md:106-111:

python
def handle_context_overflow(subagent, current_state):
    """Emergency handling when subagent exceeds MECW limits"""

    # 1. Immediately store current state externally
    store_emergency_state(subagent.id, current_state)

modules/mcp-coordination.md:205-216:

text
...[truncated 4392 chars]
Remediation
View remediation

Remediation Suggestions

  1. Default to local, session-scoped storage and prohibit network-backed persistence unless the user explicitly approves it.
  2. Require an allowlisted storage destination with a documented trust boundary before any external write.
  3. Apply data minimization: persist only fields needed by the next processing stage rather than complete results or state objects.
  4. Prohibit full context snapshots. Replace them with non-sensitive operational metadata such as token counts, event types, and opaque correlation identifiers.
  5. Scan and redact credentials, API keys, authentication headers, personal information, database connection material, and other sensitive fields before storage.
  6. Require encryption in transit and at rest, least-privilege service identities, tenant isolation, and auditable access controls.
  7. Establish short retention periods and guaranteed deletion at workflow or session completion.
  8. Add confidentiality checks to mcp-validation.md, including destination validation, consent verification, sensitivity classification, redaction verification, and fail-closed behavior.
  9. Change emergency handling so context overflow does not automatically persist the complete current state. Store a minimal, sanitized recovery checkpoint instead.
  10. Clearly distinguish local temporary storage from remote external storage in all examples and documentation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill declares automatic activation keywords including generic terms like "code execution", "MCP", and "tool chain", which are broad enough to match ordinary discussion rather than a clear request to invoke this orchestration hub. In an agent setting, this can cause unintended skill activation and routing into multi-tool workflows, increasing the chance of unnecessary tool use, context consumption, and execution of actions the user did not explicitly intend.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill repeatedly instructs agents to store intermediate, external, and emergency state data outside the active execution context without any safeguards, data classification guidance, retention limits, or user consent. In a code-execution and multi-tool coordination skill, those stored artifacts can easily contain source code, credentials, proprietary datasets, prompts, or execution state, creating a realistic risk of unintended persistence, disclosure, or cross-session access.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The automatic invocation keywords are broad enough that ordinary user requests containing terms like 'pattern', 'optimize', or 'code execution' could trigger this skill outside its intended scope. In a skill that routes work into MCP-based code execution flows, accidental over-invocation increases the chance of unnecessary or unsafe execution-path selection, especially when handling untrusted data-heavy tasks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module declares broad automatic trigger keywords such as "subagent," "decompose," "break down," and "modular," which can cause the skill to activate in contexts where delegation was not actually intended. In a code-execution/MCP orchestration skill, unintended invocation can expand tool usage, increase exposure to downstream risky operations, and undermine the documented pre-invocation complexity checks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest context for the skill is execution routing for data-heavy MCP workflows, but this file defines a module focused on MECW compliance, hallucination prevention, and alerting. That is a semantic expansion from workflow routing/execution into quality/compliance monitoring, which is not an obvious implementation detail of the stated purpose.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Broad automatic trigger keywords like 'check', 'monitor', and 'validate' can cause unintended invocation in unrelated contexts. In a code-execution ecosystem, accidental activation of a module that can influence workflow control increases the chance of unnecessary interruptions, policy noise, or abuse through prompt shaping.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module claims authority to stop execution and reconfigure workflow state despite being framed as validation/monitoring only. In the context of an MCP code-execution skill, those powers are more dangerous because they can alter active multi-tool workflows, interrupt processing, or redirect state based on potentially noisy or manipulated validation signals.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Although presented as a validation module, it prescribes control-plane actions such as stopping execution, migrating state, and decomposing into subagents. That expands a monitoring component into an execution orchestrator, which can let loosely scoped checks trigger disruptive workflow changes, creating denial-of-service or unsafe state-transition risks.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.