Back to skill

Security audit

Agent Factory (Walter)

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its stated agent-creation purpose, but it has unsafe scripting and copies persistent memory between agents without clear consent.

Review before installing. Use only test or least-privilege Feishu credentials, inspect and edit the generated scripts before running them, avoid the Windows Invoke-Expression version unless fixed, do not copy existing MEMORY.md unless you intentionally want that data transferred, and install only trusted skills into the new agent workspace.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:432
Finding

PowerShell Command Injection Through User-Controlled Agent and Skill Names

Content
View full analysis
&1 ``` ```powershell $skillInstallCmd = "clawhub install $Skill --workdir `"$env:USERPROFILE\.openclaw\workspace-$Name`"" Invoke-Expression $skillInstallCmd 2>&1 | Out-Null ``` ### Technical Analysis The PowerShell implementation incorporates the user-controlled `$Name` and `$Skill` parameters into command strings and executes those strings through `Invoke-Expression`. This cmdlet treats the resulting string as PowerShell source code rather than as a command with isolated arguments. Although the documentation states that agent names may contain only letters, digits, and hyphens, the script does not implement that validation. The optional Skill name is likewise not validated. An attacker can therefore include PowerShell metacharacters, expression syntax, separators, or quoting characters in either parameter and alter the command parsed by `Invoke-Expression`. Quoting only the workspace path does not prevent exploitation because `$Name` is also interpolated into an unquoted command argument, and `$Skill` is directly inserted into the Skill installation command. ### Attack Path 1. An attacker supplies a crafted agent name or Skill name containing PowerShell syntax. 2. The value is accepted because the script performs no allowlist validation. 3. The value is interpolated into `$agentCmd` or `$skillInstallCmd`. 4. `Invoke-Expression` parses the complete attacker-influenced string as PowerShell code. 5. The injected command executes with the privileges of the user running the generated factory script. ### Impact Assessment Successful exploitation provides arbitrary local command execution under the account running t ...[truncated 590 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:338
Finding

Unrestricted Installation of User-Selected Third-Party Skills

Content
View full analysis
/dev/null || { echo -e " ${YELLOW}⚠ skill 安装失败,继续执行(可能已存在或无需安装)${NC}" } echo -e " ${GREEN}✓${NC} skill '$SKILL' 已安装到 $WORKSPACE_DIR/skills" fi ``` ```powershell if ($Skill -ne "") { Write-Host "[7/9] 安装 skill '$Skill' 到新 agent workspace..." $skillInstallCmd = "clawhub install $Skill --workdir `"$env:USERPROFILE\.openclaw\workspace-$Name`"" Invoke-Expression $skillInstallCmd 2>&1 | Out-Null if ($LASTEXITCODE -ne 0) { Write-Host " ⚠ skill 安装失败,继续执行(可能已存在或无需安装)" -ForegroundColor Yellow } else { Write-Host " ✓ skill '$Skill' 已安装到 $env:USERPROFILE\.openclaw\workspace-$Name\skills" } } ``` ### Technical Analysis The factory installs any Skill name supplied by the user without enforcing an approved-package allowlist, pinning a specific version, verifying an integrity digest, validating the publisher, or reviewing the downloaded package. Consequently, the effective contents installed into the new agent's workspace are controlled by the external package source and may change independently of this Skill's reviewed contents. This creates exposure to malicious packages, compromised publishers, typosquatting, and mutable-package attacks. The PowerShell implementation compounds this supply-chain risk by passing the package name through `Invoke-Expression`, which is separately vulnerable to command injection. The Bash implementation also suppresses installer diagnostics and prints a success message even after the installation command fails. This can prevent operators from recognizing dependency-integrity or installation failures. ### Attack Path 1. A ...[truncated 1273 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:323
Finding

Cross-Agent Transfer of Persistent Memory Without Explicit Consent

Content
View full analysis
"$WORKSPACE_DIR/MEMORY.md" <<'MEMEOF' # MEMORY.md - 长期记忆 _(随着对话积累,持续更新这里。)_ MEMEOF echo -e " ${GREEN}✓${NC} MEMORY.md 已创建(空白)" fi ``` ```powershell # MEMORY.md — 永久记忆(从当前 agent 复制) $srcMemory = Join-Path $env:USERPROFILE ".openclaw\workspace\MEMORY.md" $destMemory = Join-Path $workspaceDir "MEMORY.md" $srcMemoryContent = $null if (Test-Path $srcMemory) { $srcMemoryContent = Get-Content $srcMemory -Raw # 检查是否有实质内容(不只是空白模板) $srcMemoryLines = ($srcMemoryContent -split "`n").Trim() | Where-Object { $_ -and $_ -notmatch "^#" -and $_ -notmatch "^_" -and $_ -notmatch "随着对话" } if ($srcMemoryLines.Count -gt 0) { Copy-Item $srcMemory $destMemory -Force Write-Host " ✓ MEMORY.md 已复制(共 $($srcMemoryLines.Count) 行实质内容)" } else { Write-Host " ⚠ 源 MEMORY.md 为空白模板,跳过复制,创建空白 MEMORY.md" -ForegroundColor Yellow $srcMemoryContent = $null } } if (-not $srcMemoryContent) { $emptyMemory = @" # MEMORY.md - 长期记忆 _(随着对话积累,持续更新这里。)_ "@ Set-Content -Path $destMemory -Value $emptyMemory -Encoding UTF8 Write-Host " ✓ MEMORY.md 已创建(空白)" } ``` ### Technical Analysis Both platform implementations copy the active agent's `MEMORY.md` into the newly created agent's persistent workspace. The high-level creation procedure describes identity, behavior, handbook, and user files but does not clearly disclose that existing long-term memory will be transferred between agents. Persistent memory can contain private conversation context, internal operational information, user identifiers, secrets entered du ...[truncated 1733 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill asks users to provide appId and especially appSecret but does not include an explicit warning about sensitive credential handling, storage, and exposure risks. Since the workflow persists secrets into configuration files, lack of upfront warning can lead users to disclose production credentials without understanding retention or access implications.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include broad natural-language requests like creating a new agent or bot, which may be invoked unintentionally in ordinary conversation. Because the skill performs configuration changes, credential handling, and service restarts, accidental activation materially increases risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill globally enables Feishu tool permissions as part of agent creation, even though creating and binding a bot does not inherently require wiki/doc/drive capabilities. This expands privileges beyond the requested task and can expose additional data sources or actions to the new or existing Feishu integrations.

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 · SKILL.md (reported line 173)May include surrounding context.

md
# ============ Step 1: Validate Feishu credentials ============
echo -e "${CYAN}[1/9]${NC} 验证飞书凭证..."

RESP=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
  -H 'Content-Type: application/json' \
  -d "$(jq -n --arg id "$APP_ID" --arg secret "$APP_SECRET" '{app_id: $id, app_secret: $secret}')" \
  --max-time 10) || true

Ssd 3

Medium
Category
Not specified by scanner
Confidence
72% confidence
Finding

The text instructs that USER.md should be continually updated as dialogue accumulates, which semantically encourages persistent collection and retention of user-provided information. Even though phrased as documentation guidance, it creates a standing natural-language directive to store potentially sensitive user data over time.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill copies MEMORY.md from the current agent into the newly created agent by default, which can transfer unrelated prior conversation context, user data, or operational notes into a different agent without necessity for agent creation. This is an unjustified cross-agent data flow and violates least-privilege and purpose limitation for a provisioning skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

In the Linux/macOS script, copying MEMORY.md from the current workspace into the new workspace creates cross-agent propagation of accumulated context outside the stated purpose of provisioning a new agent. Because MEMORY.md is intended to retain long-term information, this can leak sensitive or irrelevant data into another agent environment.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions direct the new agent to inherit prior agent memory by default, carrying forward accumulated conversation-derived information into a separate agent identity. This creates unnecessary data retention and sharing across logical boundaries, potentially exposing user or operational information to the wrong agent context.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The MEMORY.md template explicitly frames itself as long-term memory that should be updated as conversations accumulate, which is a plain-language instruction to retain user-provided information persistently. This can lead to overcollection and long-lived storage of sensitive content without any stated boundaries, consent, or data handling constraints.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The Windows implementation copies substantive MEMORY.md content from the current agent into the new agent whenever the source appears non-empty. This preserves and propagates prior dialogue-derived information into an unrelated agent workspace, increasing the risk of confidential data disclosure and context contamination.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The Windows flow automatically enables Feishu wiki tool access even when the user only asked to create and configure an agent. This is unnecessary privilege expansion and may allow access to resources unrelated to the provisioning task.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.