Back to skill

Security audit

Shield Cn

Security checks for vulnerabilities and agentic risk

Overview

The skill appears defensive rather than malicious, but it overstates its protection features while scanning and storing sensitive local content.

Treat this as an experimental local scanner/classifier, not a reliable real-time shield. Run it only on trusted workspaces, review what it stores under ~/.openclaw, and do not rely on it to block credential reads, uploads, QR/link attacks, or platform sharing.

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 (4)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/shield-guard.py:145
Finding

Credential-access checks and block mode are not connected to enforceable operations

Content
View full analysis
dict: """检查文件访问是否安全""" filepath_lower = filepath.lower() # 凭证文件黑名单 for pattern in self.CREDENTIAL_PATTERNS: if re.search(pattern, filepath_lower): return { "safe": False, "reason": f"凭证文件禁止访问: {filepath}", "type": "credential_access_denied" } return {"safe": True} ``` ```python def run(self): """运行防护""" print(f"{GREEN}🛡️ 安全卫士启动中...{RESET}") print(f"模式: {self.mode}") print(f"日志级别: {self.log_level}") print(f"告警渠道: {', '.join(self.alert_channels)}") print("\n输入文本进行安全检测(Ctrl+C 退出):\n") try: while True: user_input = input(f"{GREEN}> {RESET}") if not user_input.strip(): continue result = self.check_input(user_input) if not result["safe"]: self.log_threat(result, user_input[:50]) if self.mode == "block": print(f"\n{RED}⚠️ 检测到威胁,操作已阻断{RESET}") print("如需继续执行,请确认...") else: print(f"{GREEN}✓ 安全{RESET}") ``` ```python guard = ShieldGuard(args.config) if args.mode: guard.config["mode"] = args.mode ``` ### Technical Analysis `check_file_access()` can return a denial result, but no code invokes it before opening a file or performing an Agent tool operation. It therefore operates only as an unused classification helper and cannot prevent access to `.env`, private-key, SSH-key, or credential paths. Likewise, block mode only prints a message. It does not terminate an operation, return an enforceable authorizatio ...[truncated 1655 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/shield-guard.py:203
Finding

Flagged user-input fragments are stored in persistent plaintext logs

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/shield-guard.py:70
Finding

Documented security capabilities and configuration controls are not implemented

Content
View full analysis
dict: """加载配置文件""" default_config = { "mode": "monitor", "log_level": "INFO", "alert_channels": ["console"], "blocked_keywords": [], "protected_files": [".env", "*.key", "*.pem"], "url_whitelist": ["docs.openclaw.ai", "github.com", "gitee.com"] } if config_path and os.path.exists(config_path): try: with open(config_path, 'r', encoding='utf-8') as f: user_config = json.load(f) default_config.update(user_config) except Exception as e: print(f"{YELLOW}⚠️ 配置文件加载失败: {e},使用默认配置{RESET}") return default_config ``` The documentation advertises broader controls, including encoded-instruction detection, QR and link checks, credential-file blocking, platform-specific data-loss prevention, split-attack analysis, and whitelist behavior. The implementation only applies regular expressions and substring searches to manually entered text. The `protected_files`, `url_whitelist`, and non-console `alert_channels` settings are loaded but are not used to enforce their documented purposes. ### Technical Analysis Security configuration that is accepted but ignored creates a fail-open condition. A user can configure protected files or approved domains and receive no error, while the runtime performs no matching or enforcement based on those values. No implementation was found for: - Base64 or Unicode decoding before inspection. - Multi-turn or split-attack correlation. - QR-code analysis. - URL extraction, domain validation, or whitelist enforcement. - WeChat, DingTalk, Feishu, email, SMS, webhook, or clou ...[truncated 1277 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/security-audit.py:61
Finding

Literal substring matching causes sensitive-file scan false negatives

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior claims real-time prompt-injection defense and platform-specific protections, but the described implementation is primarily local file scanning and report generation with workspace traversal and filesystem writes. This mismatch is dangerous because users may rely on protections that are not actually present, while unknowingly granting the skill sensitive file access not clearly disclosed in the description.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/security-audit.py (reported line 62)May include surrounding context.

python
# 高危文件
    DANGEROUS_FILES = [
        ".env",
        ".env.local",
        ".env.production",
        "id_rsa",
        "id_ed25519",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/security-audit.py (reported line 63)May include surrounding context.

python
DANGEROUS_FILES = [
        ".env",
        ".env.local",
        ".env.production",
        "id_rsa",
        "id_ed25519",
        "credentials",

Credential Access

High
Category
Privilege Escalation
Confidence
67% confidence
Finding

The scanner reads full contents of markdown, config, text, YAML, and .env files across the workspace, which can include secrets and private material. Although the intent is defensive, broad content ingestion increases exposure because sensitive data is processed in memory and later partially echoed into findings, creating a larger attack surface if reports are mishandled or the tool is run on untrusted/shared workspaces.

Content

Scanner excerpt · scripts/security-audit.py (reported line 125)May include surrounding context.

python
})
                
                # 扫描文件内容
                if file.endswith(('.md', '.json', '.txt', '.yaml', '.yml', '.env')):
                    self._scan_file_content(filepath, rel_path)
    
    def _scan_file_content(self, filepath: Path, rel_path: Path):

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
"""检查文件权限"""
        print(f"{BLUE}🔐 检查文件权限...{RESET}")
        
        # 检查 .env 文件权限
        env_files = list(self.workspace.glob("**/.env*"))
        
        for env_file in env_files:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
"""检查文件权限"""
        print(f"{BLUE}🔐 检查文件权限...{RESET}")
        
        # 检查 .env 文件权限
        env_files = list(self.workspace.glob("**/.env*"))
        
        for env_file in env_files:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/security-audit.py (reported line 175)May include surrounding context.

python
"""检查文件权限"""
        print(f"{BLUE}🔐 检查文件权限...{RESET}")
        
        # 检查 .env 文件权限
        env_files = list(self.workspace.glob("**/.env*"))
        
        for env_file in env_files:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/security-audit.py (reported line 188)May include surrounding context.

python
"""检查文件权限"""
        print(f"{BLUE}🔐 检查文件权限...{RESET}")
        
        # 检查 .env 文件权限
        env_files = list(self.workspace.glob("**/.env*"))
        
        for env_file in env_files:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
# 凭证文件模式
    CREDENTIAL_PATTERNS = [
        r"\.env",
        r"\.pem",
        r"\.key",
        r"id_rsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/security-audit.py (reported line 61)May include surrounding context.

python
# 凭证文件模式
    CREDENTIAL_PATTERNS = [
        r"\.env",
        r"\.pem",
        r"\.key",
        r"id_rsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/security-audit.py (reported line 189)May include surrounding context.

python
# 凭证文件模式
    CREDENTIAL_PATTERNS = [
        r"\.env",
        r"\.pem",
        r"\.key",
        r"id_rsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/shield-guard.py (reported line 57)May include surrounding context.

python
# 凭证文件模式
    CREDENTIAL_PATTERNS = [
        r"\.env",
        r"\.pem",
        r"\.key",
        r"id_rsa",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/shield-guard.py (reported line 87)May include surrounding context.

python
# 凭证文件模式
    CREDENTIAL_PATTERNS = [
        r"\.env",
        r"\.pem",
        r"\.key",
        r"id_rsa",

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README repeatedly states that the skill is designed specifically for Chinese users and Chinese scenarios, including "专为中文场景设计" and "专为中文用户打造." This presents a locale/language restriction in the skill description without offering a user choice or opt-in, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises executable commands and file-scanning behavior but does not declare any explicit tool scope such as permissions or allowed-tools. That creates an implicit trust gap: an agent may grant broader-than-necessary file and shell access to a skill that can read workspace contents and write reports, increasing the chance of unintended data exposure or unsafe execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown states the skill is not suitable when users 'must use an English environment,' which signals a language restriction rather than offering language choice. This can violate language/locale policy expectations because the skill appears to force a specific language context without explicit opt-in or a justified compliance-only constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file states that it scans the workspace and generates a Chinese report, and the implementation consistently emits Chinese messages and report content. This imposes a specific language/locale on users without offering a choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/security-audit.py (reported line 189)May include surrounding context.

python
"severity": "MEDIUM",
                        "file": str(env_file.relative_to(self.workspace)),
                        "description": f".env 文件权限过宽: {oct(mode)}",
                        "suggestion": "运行: chmod 600 .env"
                    })
            except Exception:
                pass

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module description and embedded operational text are primarily Chinese and describe Chinese-specific detection scenarios, but the script provides no language selection or opt-in. This can violate language/locale policy because users are implicitly forced into a specific language experience without a documented regional justification.

Content

No source excerpt is available for this finding.