Back to skill

Security audit

Multi Agent

Security checks for vulnerabilities and agentic risk

Overview

This multi-agent skill is mostly coherent, but it includes an automatic shell execution fallback that can run task text as an operating-system command.

Review this before installing. Use it only in an isolated project directory with trusted task text, and avoid giving it secrets or broad filesystem access. The shell fallback in src/agent-roles.js should be removed or replaced with a non-shell acknowledgment path before use in shared or sensitive environments.

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
src/agent-roles.js:286
Finding

OS Command Injection Through Unsanitized Task Text

Content
View full analysis

Vulnerability Details

File Location: src/agent-roles.js:286-294
Vulnerability Type: OS command injection
Risk Level: High

Vulnerable Code

javascript
// Try to execute as command
try {
  console.log(`[Executor] Executing as shell command`);
  const { exec } = require('child_process');
  const { promisify } = require('util');
  const execAsync = promisify(exec);

  const { stdout, stderr } = await execAsync(`echo "Task executed: ${task}"`, {
    cwd: process.cwd(),
    timeout: 10000
  });

Technical Analysis

The task value originates from command-line arguments or a caller of executeTask() and is forwarded to ExecutorAgent.executeRoleSpecific(). The code interpolates this untrusted value directly into a command passed to child_process.exec().

Because exec() invokes a system shell, shell metacharacters and expansions inside task are interpreted rather than treated as literal text. Wrapping the value in double quotes does not prevent command substitution using $(...) or backticks. An attacker can also inject a closing quote followed by shell operators.

The vulnerable fallback is reached when:

  1. A tools registry is configured.
  2. ReAct execution fails or is unavailable.
  3. The task does not match a registered tool name.

The CLI configures both the external ReAct engine and tools registry, and all supported orchestration modes can dispatch task text to the executor.

Attack Path

  1. An attacker controls task text supplied through the CLI or programmatic API.
  2. The CLI parses the text and calls orchestrator.executeTask(task, ...).
  3. The orchestrator forwards the original task, or a generated subtask containing it, to ExecutorAgent.
  4. ReAct execution throws or is unavailable.
  5. No registered tool name matches the task.
  6. The fallback constructs a shell command containing the untrusted task.
  7. The shell evaluates injected command substitutions or operators.

For example, task text with the following ...[truncated 870 chars]

Remediation
View remediation

Remediation Suggestions

Remove shell execution from this fallback. The command only formats a status message, so it should be implemented directly in JavaScript:

javascript
return {
  success: true,
  result: `Task executed: ${task}`,
  stderr: null,
  note: 'Task acknowledged without shell execution'
};

If process execution is genuinely required in a future implementation:

  1. Use execFile() or spawn() with a fixed executable and an argument array.
  2. Keep shell: false.
  3. Apply a strict allowlist of executable names and supported operations.
  4. Validate argument types, formats, lengths, and permitted values.
  5. Do not accept raw command lines from task descriptions.
  6. Run subprocesses with minimal operating-system privileges.
  7. Use a dedicated, restricted working directory rather than arbitrary process.cwd().
  8. Restrict inherited environment variables to an explicit allowlist.
  9. Enforce execution timeouts and output-size limits.
  10. Add regression tests covering $(), backticks, quotes, semicolons, pipes, redirections, newlines, and logical shell operators.

The external ReAct engine and tools registry imported from outside this project should also enforce independent authorization, path confinement, and argument validation before exposing filesystem or command-execution tools.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (25)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/index.js "Analyze project structure"

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 src/index.js "Analyze project structure"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/index.js "Analyze project structure"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/index.js "Analyze project structure"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/index.js "Analyze project structure"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node src/index.js "Analyze project structure"

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code gives the Executor agent direct subprocess capability via child_process.exec, despite the role definition not clearly constraining or justifying OS command execution. In an agent system where tasks may originate from users, planners, or other agents, this materially increases the risk of arbitrary command execution if the fallback evolves or is reused with less-safe command construction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README advertises web search and code execution capabilities ('Tavily Search, Web Fetch', 'Code Sandbox, Exec') but does not warn users about privacy exposure, untrusted content ingestion, or the risks of executing generated code. In a multi-agent system, these capabilities can amplify harm because one agent may retrieve hostile content and another may execute or act on it without clear human review boundaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly advertises write_file and execute_command capabilities, which can modify the filesystem and run arbitrary shell commands, but it provides no safety warning, permission model, or usage constraints. In a multi-agent orchestration context, this is more dangerous because task delegation can cause an executor agent to perform impactful actions indirectly from high-level prompts, increasing the chance of unsafe or unintended operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script automatically launches a multi-agent task that enumerates directory contents, reads package.json, counts files, and creates a summary report using a full tools registry rooted at the current working directory. Even though this is framed as a test, it performs real filesystem inspection without any confirmation, sandboxing, or clear user warning, which can expose sensitive project metadata or enable unintended file access depending on the registered tools.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The Executor role is presented as a generic task worker, but its implementation includes a hidden subprocess fallback that can invoke shell execution logic on untrusted task text. Even though the current command only echoes the task, introducing shell execution capability in an agent role broadens the attack surface and creates a dangerous precedent for command-oriented handling of user-controlled input.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The shell execution path can be reached automatically as a fallback with no explicit user warning, approval, or higher-level policy check. In a multi-agent context, silent subprocess invocation is especially risky because tasks can be indirectly generated or transformed, making unintended execution harder to detect and govern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This JavaScript file defines all role descriptions, comments, and console log messages in Chinese, including user-visible status outputs such as '开始研究' and '开发完成'. Because the file provides no opt-in, fallback, or stated region-specific constraint, it imposes a specific language/locale in a way that can violate organizational language-choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This JavaScript file consistently uses Chinese in natural-language comments and console output, including user-visible operational messages such as initialization, task decomposition, assignment, and replanning logs. Under the policy, forcing a specific language without user opt-in or a documented region-specific justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains user-facing/comment natural language in Chinese ("Multi-Agent 测试套件") and similar Chinese-only text elsewhere, with no indication that the skill is region-specific or that users can opt into the locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The comment "测试运行器" is natural-language content that assumes a specific language context. Because the file does not offer language choice or explain a justified locale restriction, it conflicts with the language/locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The comment "运行测试" continues the pattern of Chinese-only natural-language content in a general-purpose test file. Without an explicit opt-in or a documented region-specific purpose, this violates the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file uses Chinese throughout headings, labels, status text, and recommendations, but does not indicate that the skill or report is region-specific or that users may choose another language. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The skill documentation is predominantly in Chinese and does not indicate that users may choose another language or that the Chinese-only presentation is a justified region-specific constraint. Under the language/locale policy, forcing a specific language without user opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file uses Chinese throughout for headings, instructions, examples, and summaries, but does not state that the skill is region-specific or provide any user language/locale opt-in. Under the policy rule, forcing a specific language without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing natural language content that defaults to Chinese for headings, descriptions, findings, and recommendations. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language description is written entirely in Chinese, which can impose a language choice on users without offering any alternative or opt-in. Under the policy, locale or language constraints should be optional or clearly justified rather than implicitly enforced.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JavaScript file uses Chinese exclusively in natural-language comments, errors, and console output such as the module description and creation log. Under the policy rule, forcing a specific language without user opt-in is a locale/language policy concern unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This JavaScript file contains user-facing console output and descriptive comments exclusively in Chinese, such as test names, status messages, and error text. Under the policy, forcing a specific language without opt-in can be a natural-language policy violation when no alternative language choice or justification is provided.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

At L463, the inline comment states that history should be preserved by default after team.reset(), but the assertion immediately checks team.history.length === 0, which means history is expected to be empty. This is an active contradiction between the test's documentation and the code's actual expectation.

Content

No source excerpt is available for this finding.