Back to skill

Security audit

orchestrator-v4

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a legitimate multi-agent orchestration tool, but it needs Review because it can scan broad project files, spawn child agents with inherited authority, and persist task context.

Install only if you are comfortable with a Chinese-language orchestration skill that can scan project trees, plan work for multiple subagents, and in fix mode lead to file modifications. Use it on trusted workspaces, avoid projects containing secrets such as .env files unless filtered, prefer plan-only or analysis mode first, and require explicit confirmation before spawning workers or applying fixes.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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)

T02 · Agent Memory Poisoning

Warning
Location
scripts/orchestrator_v4_acp.py:84
Finding

Persistent checkpoint restoration enables cross-session agent memory poisoning

Content
View full analysis

Vulnerability Details

File Location: scripts/orchestrator_v4_acp.py:84-88, scripts/orchestrator_v4_acp.py:192-203, scripts/orchestrator_v4_acp.py:314-315, scripts/orchestrator_v4_acp.py:1319-1341, scripts/orchestrator_v4_acp.py:1825-1863
Vulnerability Type: Unauthenticated persistent state restoration and plaintext conversation storage
Risk Level: Medium

Vulnerable Code

python
checkpoint_dir: str = "./checkpoints"
auto_checkpoint: bool = True
checkpoint_interval_sec: float = 60.0
resume_from_latest_checkpoint: bool = True
latest_checkpoint_name: str = "checkpoint_latest.json"
python
async def start(self):
    if self.config.resume_from_latest_checkpoint:
        self._load_latest_checkpoint()

    self.state = SessionState.ACTIVE
python
async def _save_checkpoint(self, suffix: str = "auto"):
    checkpoint = {
        "session_id": self._session_id,
        "timestamp": time.time(),
        "history": self.context_manager._history,
        "stats": self._stats,
        "request_context": self._request_context
    }

    path = Path(self.config.checkpoint_dir) / f"checkpoint_{self._session_id}_{suffix}.json"
    latest_path = Path(self.config.checkpoint_dir) / self.config.latest_checkpoint_name
    try:
        with open(path, "w", encoding="utf-8") as f:
            json.dump(checkpoint, f, ensure_ascii=False, indent=2)
        with open(latest_path, "w", encoding="utf-8") as f:
            json.dump(checkpoint, f, ensure_ascii=False, indent=2)
    except Exception as e:
        self._log("error", f"Failed to save checkpoint: {e}")
python
def _load_latest_checkpoint(self):
    latest_path = Path(self.config.checkpoint_dir) / self.config.latest_checkpoint_name
    if not latest_path.exists():
        return
    try:
        with open(latest_path, "r", encoding="utf-8") as f:
            checkpoint = json.load(f)
     
...[truncated 3653 chars]
Remediation
View remediation

Remediation Suggestions

  1. Disable resume_from_latest_checkpoint by default and require explicit user opt-in before restoring conversational state.
  2. Store checkpoints in a private, per-user runtime data directory rather than a workspace-relative directory.
  3. Create the checkpoint directory with owner-only permissions and checkpoint files with mode 0600.
  4. Write checkpoints atomically using a securely created temporary file followed by an atomic replacement.
  5. Protect checkpoint integrity with an authenticated MAC or equivalent mechanism using a key stored outside the workspace.
  6. Bind each checkpoint to an expected user, workspace, Skill version, and session identifier. Reject mismatches.
  7. Validate the complete JSON schema, including allowed keys, entry count, field types, role values, and maximum lengths.
  8. Treat all restored content as untrusted data. Clearly delimit it in prompts and instruct delegated agents not to interpret historical content as higher-priority instructions.
  9. Avoid persisting user content unless necessary. Provide configurable retention limits and secure deletion controls.
  10. Redact credentials, tokens, private keys, and other sensitive patterns before writing checkpoint data.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/orchestrator_v4_acp.py:1025
Finding

Missing scan-root confinement permits access to sensitive or out-of-scope files

Content
View full analysis

Vulnerability Details

File Location: scripts/orchestrator_v4_acp.py:1025-1036, scripts/orchestrator_v4_acp.py:1067-1093, scripts/orchestrator_v4_acp.py:1109-1124
Vulnerability Type: Filesystem boundary violation and sensitive-file enumeration
Risk Level: Medium

Vulnerable Code

Absolute file references are extracted directly from user-controlled task text:

python
def _extract_file_references(self, content: str) -> List[str]:
    import re
    patterns = [
        r'[A-Z]:\\[^\s\'"<>]+\.\w+',
        r'/[\w/.-]+\.\w+',
        r'[\w.-]+\.(?:py|js|ts|md|json|yaml)',
    ]
    files = []
    for pattern in patterns:
        files.extend(re.findall(pattern, content))
    return list(set(files))

Secret-bearing .env files are included in the default scan set:

python
code_extensions = {
    '.py', '.js', '.ts', '.jsx', '.tsx', '.go', '.rs', '.java',
    '.cpp', '.c', '.h', '.md', '.json', '.yaml', '.yml',
    '.css', '.scss', '.less', '.html', '.vue', '.svelte',
    '.sh', '.bash', '.sql', '.graphql', '.gql',
    '.toml', '.ini', '.env',
}

Discovered paths and user-supplied references are merged without verifying that their resolved locations remain under target_dir:

python
for root, dirs, filenames in os.walk(target_dir):
    dirs[:] = [d for d in dirs if d not in skip_dirs]
    for fname in filenames:
        ext = os.path.splitext(fname)[1].lower()
        if ext in code_extensions:
            fpath = os.path.join(root, fname)
            scanned_files.append(fpath)

all_paths = list(set(referenced_files + scanned_files))

Each accepted path is then opened:

python
for fpath in all_paths:
    if not os.path.isfile(fpath):
        continue
    try:
        size = os.path.getsize(fpath)
        size_kb = round(size / 1024, 1)
        with open(fpath, 'r', encoding='utf-8', errors='ignore') as f:
            lines
...[truncated 3253 chars]
Remediation
View remediation

Remediation Suggestions

  1. Resolve the configured project root once with Path(target_dir).resolve(strict=True).
  2. Resolve every candidate path before accessing it and require it to remain under the resolved project root.
  3. Use Path.is_relative_to() on supported Python versions, or a safe relative_to() check, rather than string-prefix comparisons.
  4. Reject symbolic links by default. If symlinks are required, resolve their targets and ensure the targets remain inside the project root.
  5. Do not merge absolute paths extracted from task text into a project scan unless the user explicitly authorizes out-of-root access.
  6. Remove .env from the default extension allowlist. Also exclude common secret-bearing files such as .env.*, credential exports, private keys, and local configuration overrides.
  7. Return project-relative paths instead of absolute filesystem paths wherever possible.
  8. Use metadata-only operations when line counts are unnecessary. If line counts are required, enforce file-size limits before opening files to prevent excessive resource consumption.
  9. Apply the same root-confinement checks when constructing and consuming files_to_read; validation must not exist only at the initial scan stage.
  10. Require explicit confirmation before delegating any sensitive or out-of-project path to a sub-agent.
Vulnerability Patterns
  • 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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Presenting user interruption/cancellation and orchestration as available when they are placeholders weakens operator ability to assess risk. In a multi-agent or bridge-based execution context, false assumptions about interruption and scope control can lead to unintended file access or continued background operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Presenting user interruption/cancellation and orchestration as available when they are placeholders weakens operator ability to assess risk. In a multi-agent or bridge-based execution context, false assumptions about interruption and scope control can lead to unintended file access or continued background operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Presenting user interruption/cancellation and orchestration as available when they are placeholders weakens operator ability to assess risk. In a multi-agent or bridge-based execution context, false assumptions about interruption and scope control can lead to unintended file access or continued background operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Presenting user interruption/cancellation and orchestration as available when they are placeholders weakens operator ability to assess risk. In a multi-agent or bridge-based execution context, false assumptions about interruption and scope control can lead to unintended file access or continued background operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Presenting user interruption/cancellation and orchestration as available when they are placeholders weakens operator ability to assess risk. In a multi-agent or bridge-based execution context, false assumptions about interruption and scope control can lead to unintended file access or continued background operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Presenting user interruption/cancellation and orchestration as available when they are placeholders weakens operator ability to assess risk. In a multi-agent or bridge-based execution context, false assumptions about interruption and scope control can lead to unintended file access or continued background operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Presenting user interruption/cancellation and orchestration as available when they are placeholders weakens operator ability to assess risk. In a multi-agent or bridge-based execution context, false assumptions about interruption and scope control can lead to unintended file access or continued background operations.

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

md
| `scripts/orchestrator_v4_acp.py` | 核心引擎(扫描+规划+上下文管理+并发控制) | 已验证 |

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/_archived/audit_agent.py (reported line 85)May include surrounding context.

python
)
    if extra_context:
        prompt += f"\n\n### 额外上下文\n{extra_context}"
    return prompt


def parse_audit_result(raw_result: str) -> Dict[str, Any]:

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
98% confidence
Finding

Using {**os.environ, **(env or {})} causes the child process to inherit the entire parent environment, including secrets and operational metadata. Because this bridge is specifically designed to start and communicate with subprocesses, any worker execution path can become a credential-harvesting point if the worker is malicious, replaced, or influenced by untrusted input.

Content

Scanner excerpt · scripts/_archived/v3_bridge.py (reported line 104)May include surrounding context.

python
proc_env = {**dict(asyncio.get_event_loop()._default_executor or {}), **(env or {})}
            # 修正:合并环境变量
            import os
            proc_env = {**os.environ, **(env or {})}

            self._process = await asyncio.create_subprocess_exec(
                *command,

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/orchestrator_v4_acp.py (reported line 392)May include surrounding context.

python
instructions = self._redirect_instructions
            self._redirect_instructions = None  # 清空已处理的新指令
            self._log("info", f"按新思路恢复,已取消 {len([t for t in self._active_tasks.values() if t.get('status') == 'cancelled'])} 个运行中任务")
            return instructions

        return None

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

Including .env in the recursively scanned file extensions means the orchestrator will enumerate and open files commonly used to store API keys, tokens, and credentials. Even though the current code only counts lines and metadata, opening secret-bearing files as part of generic planning is unnecessary sensitive-file access and could easily evolve into leakage through logs, downstream prompts, or future feature changes.

Content

Scanner excerpt · scripts/orchestrator_v4_acp.py (reported line 1073)May include surrounding context.

python
'.cpp', '.c', '.h', '.md', '.json', '.yaml', '.yml',
                '.css', '.scss', '.less', '.html', '.vue', '.svelte',
                '.sh', '.bash', '.sql', '.graphql', '.gql',
                '.toml', '.ini', '.env',
            }
            skip_dirs = {
                # 构建产物

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The extension-to-language mapping explicitly recognizes .env, reinforcing that these files are expected to be processed during project scans. Treating credential files as normal analyzable artifacts increases the chance they are selected, summarized, or exposed to worker prompts in later orchestration steps, making credential discovery materially easier.

Content

Scanner excerpt · scripts/orchestrator_v4_acp.py (reported line 1114)May include surrounding context.

python
'.html': 'html', '.vue': 'vue', '.svelte': 'svelte',
            '.sh': 'shell', '.bash': 'shell', '.zsh': 'shell',
            '.sql': 'sql', '.graphql': 'graphql', '.gql': 'graphql',
            '.toml': 'toml', '.ini': 'ini', '.env': 'env',
        }
        
        for fpath in all_paths:

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The orchestrator advertises worker tool access including file_write, shell_exec, and code_execution via _get_available_tools() even though the manifested purpose is orchestration rather than delegated system modification. In practice this expands every spawned worker’s authority and increases the blast radius of prompt injection or task confusion, enabling arbitrary command execution or filesystem changes under the parent’s context.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill describes capabilities that involve shell access, filesystem reads/writes, and environment access, but it does not declare any tool scope or permissions boundary. In an orchestration skill, this is dangerous because broad undeclared capabilities can lead to over-privileged execution, accidental destructive actions, or hidden expansion of what downstream workers are allowed to do.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger conditions are so broad that the skill may activate for many ordinary analysis, coding, debugging, or research requests. Because this skill can orchestrate scanning, spawning, and possibly writing, overbroad routing increases the chance it is invoked when a simpler, safer, or read-only workflow would be more appropriate.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill discusses writing reports and includes a fix mode that can create or modify project files, but it does not provide an explicit upfront warning that execution may change the workspace. In a codebase-management context, lack of disclosure is risky because users may trigger filesystem changes, repairs, or shell-assisted modifications without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description is written entirely in Chinese, which imposes a specific language/locale in user-facing metadata without indicating that other languages are supported or that the skill is region-specific. The policy allows locale constraints only when users are given a choice or the restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The audit prompt is written to the subagent entirely in Chinese and explicitly requires Chinese content in several JSON fields such as "一句话记录你识别到的原始需求是什么" and the rejection reason wording. This imposes a specific language/locale on the skill's behavior without offering a user choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains docstrings, comments, log messages, and test output in Chinese, but nothing indicates that the skill is intentionally region-specific or that users may opt into another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The worker builds prompts from task context that can include conversation history, tool availability, constraints, and file contents, then forwards that material to spawned sub-agents. In an agent-orchestration skill this creates a real data minimization and unintended disclosure risk, because sensitive user/project data may be propagated to another execution context without explicit consent, scope reduction, or redaction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user/developer-facing natural-language content entirely in Chinese, including the module docstring and subsequent comments/docstrings. Under the language/locale policy, forcing a specific language without user opt-in or clear justification is a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language documentation and runtime output exclusively in Chinese, beginning with the module docstring and continuing throughout comments and test prints. Because the skill does not offer any language selection or document a justified locale restriction, it appears to force a specific language, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This helper provides a one-call path that immediately plans and spawns subagent sessions once a caller invokes run_orchestrated_task, with no built-in confirmation, policy gate, or dry-run default. In an orchestration skill, automatic delegation can amplify prompt injection or unintended actions by causing multiple child agents to run on unreviewed task text at once, increasing operational and data-exposure risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The bridge example configures spawned subagents with sandbox="inherit" and cleanup="delete", which can grant child agents the parent's execution context while removing artifacts that could aid review or incident response. In an orchestration skill that dispatches multiple workers automatically, this increases the risk of over-privileged actions and reduces transparency if the host integrates the example without adding user disclosure or guardrails.

Content

No source excerpt is available for this finding.