Back to skill

Security audit

OpenClaw Policy Check

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent local repository scanner, but it can read files outside the chosen scan root through symlinks and can print detected secrets verbatim in JSON output.

Install only if you are comfortable with a local scanner reading the target tree. Avoid running it on untrusted repositories that may contain symlinks, and avoid --json on codebases that may contain real credentials unless the output is kept private and handled as sensitive.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/policy_check.py:154
Finding

Scan-Root Escape Through Symbolic Links

Content
View full analysis
bool: if not path.is_file(): return False if path.stat().st_size > 1024 * 1024: return False if path.suffix.lower() in TEXT_EXTENSIONS: return True if path.name in {"Dockerfile", "Makefile"}: return True return path.suffix == "" def iter_files(target: Path) -> Iterable[Path]: if target.is_file(): if should_scan_file(target): yield target return for root, dirs, files in os.walk(target): dirs[:] = [d for d in dirs if d not in DEFAULT_IGNORE_DIRS] root_path = Path(root) for filename in files: candidate = root_path / filename if should_scan_file(candidate): yield candidate ``` The resulting path is subsequently read without a containment check: ```python def scan_file(path: Path, root: Path) -> List[Dict[str, object]]: findings: List[Dict[str, object]] = [] try: text = path.read_text(encoding="utf-8", errors="ignore") except OSError: return findings ``` ### Technical Analysis `Path.is_file()`, `Path.stat()`, and `Path.read_text()` follow symbolic links. The scanner does not reject symbolic links or resolve each candidate and verify that the resolved path remains beneath the requested scan root. Consequently, an untrusted repository can contain a file symlink whose name has a permitted text extension but whose target is outside the repository. The scanner will treat the symlink as an ordinary file and read the external target. This exceeds the least privilege required for the declared repository-scanning functionality: scanning a selected repository does not require access to arbitrary files elsewhere on the host. ### A ...[truncated 1361 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/policy_check.py:176
Finding

Detected Secrets Can Be Disclosed Through Raw JSON Snippets

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

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

python
".yml",
    ".toml",
    ".json",
    ".env",
    ".ini",
    ".cfg",
    ".sql",

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

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

Content

Scanner excerpt · scripts/policy_check.py (reported line 147)May include surrounding context.

python
Rule(
        "hardcoded-local-credential-path",
        "low",
        r"(\.aws/credentials|id_rsa|\.ssh/config|\.env\.production)",
        "Reference to sensitive local credential path.",
    ),
]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs the agent to read files, inspect repositories, and execute a Python script, but it does not declare any explicit tool scope such as allowed-tools or permissions. That creates an authorization gap where an orchestrator may permit broader file, environment, or shell access than intended, which is risky for a security-scanning skill that operates on arbitrary user-supplied paths.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description uses broad activation language like scanning repositories for risky patterns and handling suspicious code triage or unsafe commands, which can overlap with many generic security-review requests. Without clearer activation boundaries, the skill may be invoked in contexts broader than intended, increasing the chance it runs shell-backed scanning on untrusted or overly broad targets.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The default prompt contains a broad natural-language trigger phrase ('run a preflight scan on this repo and summarize risky findings') while the policy explicitly allows implicit invocation. That combination can cause the skill to activate on ordinary security-review or repo-analysis requests without clear user intent, which expands the skill’s reach and may route sensitive repository contents into an automated scanning workflow unexpectedly.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.