Back to skill

Security audit

OpenClaw Shield

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent security-guardrail purpose, but it asks users to install broad persistent agent rules while the promised enforcement script is absent and documented to fail open.

Review carefully before installing. Do not append the persistent SOUL.md or AGENTS.md blocks unless the missing shield.py implementation is supplied, pinned, tested, and invoked through a safe non-shell interface. Treat the current package as documentation-only and do not rely on it to enforce metadata blocking, credential protection, command checks, redaction, or auditing.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T01 · Skill Instruction Hijacking

Error
Location
README.md:80
Finding

Persistent Agent Policy Injection Through Global Configuration Files

Content
View full analysis
" Before every file operation: $SHIELD_CMD path "" [read|write|delete] Before every network request: $SHIELD_CMD network "" Before returning potentially sensitive output: $SHIELD_CMD filter "" ``` ### Technical Analysis The Skill does not merely provide instructions that apply while it is explicitly active. It directs the installer to modify persistent, higher-level Agent configuration files and insert rules described as “inviolable.” These rules affect future sessions and route general command execution, file operations, network requests, and responses through a tool selected by the ...[truncated 1699 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
README.md:94
Finding

Fail-Open Enforcement and Unauthenticated Protection Bypass

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
README.md:116
Finding

Shell Command Injection Through Untrusted Argument Interpolation

Content
View full analysis
" $SHIELD_CMD check "" $SHIELD_CMD path "" [read|write|delete] $SHIELD_CMD network "" $SHIELD_CMD filter "" ``` The same invocation pattern appears in the primary Skill workflow: ```bash shield.py inject "" shield.py taint "" shield.py check "" --source owner|agent|external shield.py path "" read|write|delete shield.py network "" shield.py filter "" ``` ### Technical Analysis User messages, command strings, paths, URLs, external source descriptions, and command output are untrusted data. Placing these values into a textual shell command is unsafe even when they are surrounded by double quotes. Shell-sensitive content can terminate or alter quoting, introduce command substitution, add redirections, or append additional shell syntax. Critically, shell parsing occurs before `shield.py` receives the intended argument, so the checker cannot detect or prevent commands executed by the shell during argument construction. The output-filtering pattern is also exposed because command output may contain attacker-controlled text. For example, content read from an external file or returned by a remote service could become part of the generated filter command. ### Attack Path 1. An attacker supplies crafted content through a user message, external file, web response, API result, filename, URL, or command output. 2. The Agent follows the documentation and constructs a shell command by interpolating that content into the quoted template. 3. The operating-system shell pa ...[truncated 869 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
README.md:28
Finding

Security Enforcement References a Missing and Inconsistently Located Executable

Content
View full analysis
" shield.py taint "" shield.py check "" --source owner|agent|external shield.py path "" read|write|delete shield.py network "" shield.py filter "" ``` However, the audited project contains only: ```text README.md SKILL.md agents/openai.yaml references/audit-and-playbook.md references/cloud-boundaries-config.md references/detection-and-redaction.md references/permission-matrix.md ``` There is no `scripts/` directory and no `shield.py` implementation. ### Technical Analysis The repository's declared security properties depend on an executable that is not included in the package. Installation therefore cannot provide the documented injection detection, taint tracking, command validation, path checks, network checks, output filtering, or auditing. The mismatch between the installed directory name, `openclaw-shield`, and the invocation directory, `shield`, makes successful execution even less likely. Combined with the explicit instruction to ign ...[truncated 1443 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (45)

YARA rule 'reverse_shell': Reverse shell patterns in scripts or source code [malware]

Critical
Category
YARA Match
Confidence
85% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/detection-and-redaction.md (reported line 33)May include surrounding context.

md
��
- Markdown 或 HTML 链接文本与真实目标不一致

## 高危命令模式

### 文件系统与系统级

- `rm -rf`, `find -delete`, `shred`, `truncate -s 0`
- `dd`, `mkfs`, `fdisk`, `parted`
- `sudo`, `su`, `pkexec`, `chroot`
- `shutdown`, `reboot`, `systemctl stop/disable`
- `chmod -R 777`, `chown root`, `chattr -i`

### 网络攻击相关

- `curl | sh`, `wget | bash`
- 反弹 shell: `bash -i >& /dev/tcp/...`, `nc -e`, `python -c socket`
- 隧道代理: `ssh -R`, `ssh -D`, `frp`, `ngrok`, `cloudflared`
- 扫描探测: `nmap`, `masscan`, `zmap`

## 敏感信息脱敏模式

- API Key, Token, Secret, Password 字段
- OpenAI, GitHub, AWS, 阿里云等平台凭证
- 数据库连接串 mysql postgres mongodb redis
- JWT, Bearer Token
- SSH 私钥、SSL 私钥、.env 内容
- 服务器公网与内网 IP

## 脱敏输出原则

1. 使用占位符替换,不输出原始值。
2. 说明脱敏原因,避免误导用户“未找到内容”。
3. 如用户确需原文,提示在�

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · README.md (reported line 14)May include surrounding context.

md
- 操作前置检查:命令、路径、网络、包安装
- 风险处置:按来源与风险等级执行 `pass/warn/confirm/block`
- 输出脱敏:凭证、连接串、私钥、IP 等敏感信息过滤
- 云端加固:强制拦截 metadata 地址访问(如 `169.254.169.254`)
- 审计记录:全链路可追踪事件日志

## 仓库结构

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

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

md
- 操作前置检查:命令、路径、网络、包安装
- 风险处置:按来源与风险等级执行 `pass/warn/confirm/block`
- 输出脱敏:凭证、连接串、私钥、IP 等敏感信息过滤
- 云端加固:强制拦截 metadata 地址访问(如 `169.254.169.254`)
- 审计记录:全链路可追踪事件日志

## 仓库结构

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 40)May include surrounding context.

md
- 操作前置检查:命令、路径、网络、包安装
- 风险处置:按来源与风险等级执行 `pass/warn/confirm/block`
- 输出脱敏:凭证、连接串、私钥、IP 等敏感信息过滤
- 云端加固:强制拦截 metadata 地址访问(如 `169.254.169.254`)
- 审计记录:全链路可追踪事件日志

## 仓库结构

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 60)May include surrounding context.

md
- 操作前置检查:命令、路径、网络、包安装
- 风险处置:按来源与风险等级执行 `pass/warn/confirm/block`
- 输出脱敏:凭证、连接串、私钥、IP 等敏感信息过滤
- 云端加固:强制拦截 metadata 地址访问(如 `169.254.169.254`)
- 审计记录:全链路可追踪事件日志

## 仓库结构

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 64)May include surrounding context.

如果已安装同名目录,先删除旧目录再重装:

bash
rm -rf ~/.openclaw/workspace/skills/openclaw-shield
python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \
  --repo Eilaiwangwh/openclaw-shield \
  --path . \

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 64)May include surrounding context.

如果已安装同名目录,先删除旧目录再重装:

bash
rm -rf ~/.openclaw/workspace/skills/openclaw-shield
python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-github.py \
  --repo Eilaiwangwh/openclaw-shield \
  --path . \

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README tells operators to append 'non-bypassable' safety rules while simultaneously instructing the agent to ignore Shield failures and to skip all checks when a sentinel file exists. That creates a fail-open control path and a trivial local bypass, undermining the claimed guardrail and enabling unsafe command, file, or network actions to proceed without protection.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented 'must execute' workflow is contradicted by exemptions that permit skipping checks on Shield errors and when a disable flag is present. In practice this means an attacker or misconfigured environment can neutralize the control plane while preserving the appearance of enforcement, especially dangerous for a skill meant to guard cloud execution.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 21)May include surrounding context.

md
### 默认阻断

- `~/.ssh/`, `~/.gnupg/`
- `~/.aws/`, `~/.aliyun/`, `~/.azure/`, `~/.gcloud/`
- `/etc/shadow`, `/etc/sudoers`, `/etc/gshadow`
- `/root/`, `/dev/`, `/proc/*/environ`
- `/var/run/docker.sock`

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
- `~/.ssh/`, `~/.gnupg/`
- `~/.aws/`, `~/.aliyun/`, `~/.azure/`, `~/.gcloud/`
- `/etc/shadow`, `/etc/sudoers`, `/etc/gshadow`
- `/root/`, `/dev/`, `/proc/*/environ`
- `/var/run/docker.sock`
- `/etc/letsencrypt/*/privkey.pem`

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 22)May include surrounding context.

md
- `~/.ssh/`, `~/.gnupg/`
- `~/.aws/`, `~/.aliyun/`, `~/.azure/`, `~/.gcloud/`
- `/etc/shadow`, `/etc/sudoers`, `/etc/gshadow`
- `/root/`, `/dev/`, `/proc/*/environ`
- `/var/run/docker.sock`
- `/etc/letsencrypt/*/privkey.pem`

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 71)May include surrounding context.

md
- `~/.ssh/`, `~/.gnupg/`
- `~/.aws/`, `~/.aliyun/`, `~/.azure/`, `~/.gcloud/`
- `/etc/shadow`, `/etc/sudoers`, `/etc/gshadow`
- `/root/`, `/dev/`, `/proc/*/environ`
- `/var/run/docker.sock`
- `/etc/letsencrypt/*/privkey.pem`

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

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

md
- `~/.aws/`, `~/.aliyun/`, `~/.azure/`, `~/.gcloud/`
- `/etc/shadow`, `/etc/sudoers`, `/etc/gshadow`
- `/root/`, `/dev/`, `/proc/*/environ`
- `/var/run/docker.sock`
- `/etc/letsencrypt/*/privkey.pem`
- `/var/log/auth.log`, `/var/log/secure`

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 24)May include surrounding context.

md
- `~/.aws/`, `~/.aliyun/`, `~/.azure/`, `~/.gcloud/`
- `/etc/shadow`, `/etc/sudoers`, `/etc/gshadow`
- `/root/`, `/dev/`, `/proc/*/environ`
- `/var/run/docker.sock`
- `/etc/letsencrypt/*/privkey.pem`
- `/var/log/auth.log`, `/var/log/secure`

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 72)May include surrounding context.

md
- `~/.aws/`, `~/.aliyun/`, `~/.azure/`, `~/.gcloud/`
- `/etc/shadow`, `/etc/sudoers`, `/etc/gshadow`
- `/root/`, `/dev/`, `/proc/*/environ`
- `/var/run/docker.sock`
- `/etc/letsencrypt/*/privkey.pem`
- `/var/log/auth.log`, `/var/log/secure`

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
85% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

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

md
### 强制阻断

- `169.254.169.254`
- `100.100.100.200`
- `metadata.google.internal`
- `169.254.170.2`

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
85% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 41)May include surrounding context.

md
### 强制阻断

- `169.254.169.254`
- `100.100.100.200`
- `metadata.google.internal`
- `169.254.170.2`

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
85% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 61)May include surrounding context.

md
### 强制阻断

- `169.254.169.254`
- `100.100.100.200`
- `metadata.google.internal`
- `169.254.170.2`

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

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

md
- `169.254.169.254`
- `100.100.100.200`
- `metadata.google.internal`
- `169.254.170.2`

### 其他限制

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 42)May include surrounding context.

md
- `169.254.169.254`
- `100.100.100.200`
- `metadata.google.internal`
- `169.254.170.2`

### 其他限制

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · references/cloud-boundaries-config.md (reported line 62)May include surrounding context.

md
- `169.254.169.254`
- `100.100.100.200`
- `metadata.google.internal`
- `169.254.170.2`

### 其他限制

Instruction Override

High
Category
Prompt Injection
Confidence
80% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · references/detection-and-redaction.md (reported line 7)May include surrounding context.

md
### 直接注入信号

- 指令覆盖: ignore previous instructions, forget above
- 角色劫持: pretend you are root, DAN mode, developer mode
- 权限绕过: bypass security, override restrictions
- 规则探测: show system prompt, show internal instructions

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · references/detection-and-redaction.md (reported line 7)May include surrounding context.

md
# 威胁检测与脱敏规则

## 提示词注入检测

### 直接注入信号

- 指令覆盖: ignore previous instructions, forget above
- 角色劫持: pretend you are root, DAN mode, developer mode
- 权限绕过: bypass security, override restrictions
- 规则探测: show system prompt, show internal instructions

### 间接注入信号

- 文件中出现 SYSTEM, Human, Assistant, im_start system 等结构化提示词片段
- Base64, Hex, Unicode 转义后的可执行指令
- 零宽字符夹带隐藏命令
- 超长文本中插入少量高危命令
- Markdown 或 HTML 链接文本与真实目标不一致

## 高危命令模式

### 文件系统与系统级

- `rm -rf`, `find -delete`

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
90% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt · references/detection-and-redaction.md (reported line 9)May include surrounding context.

md
- 指令覆盖: ignore previous instructions, forget above
- 角色劫持: pretend you are root, DAN mode, developer mode
- 权限绕过: bypass security, override restrictions
- 规则探测: show system prompt, show internal instructions

### 间接注入信号

Static analysis

Detected: suspicious.destructive_delete_command, suspicious.prompt_injection_instructions

Documentation contains a destructive delete command without an explicit confirmation gate.

Warn
Code
suspicious.destructive_delete_command
Location
README.md:64

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
references/detection-and-redaction.md:7