Back to skill

Security audit

Config Preflight Validator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward OpenClaw configuration validator with disclosed local schema caching, though users should not treat its fallback checks as complete validation.

Install this only if you are comfortable with a Chinese-language helper that invokes the local OpenClaw CLI to fetch schema data and caches that schema under your home directory. For important configuration changes, ensure `jsonschema` is installed and a live or cached schema is available; otherwise the tool only performs limited checks and may overstate confidence.

Vulnerability Patterns
  • 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
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config-preflight-validator.py:43
Finding
Schema Validation Fails Open When No Schema Is Available<![CDATA[ ## Vulnerability Details **File Location**: `scripts/config-preflight-validator.py`, lines 43-66 **Vulnerability Type**: Fail-open security validation **Risk Level**: Medium ### Vulnerable Code ```python try: import jsonschema if schema: jsonschema.validate(instance=patch_data, schema=schema) return True, [] ``` ```python # Basic manual validation for a limited number of fields if "plugins" in patch_data: p = patch_data["plugins"] if "allow" in p and not isinstance(p["allow"], list): errors.append("Error: 'plugins.allow' must be an array of strings") if "deny" in p and not isinstance(p["deny"], list): errors.append("Error: 'plugins.deny' must be an array of strings") if "channels" in patch_data: if not isinstance(patch_data["channels"], dict): errors.append("Error: 'channels' must be an object") return len(errors) == 0, errors ``` ### Technical Analysis Full JSON Schema validation is performed only when a schema is available. If retrieval of the live schema fails and no valid cached schema exists, execution falls through to manual validation covering only `plugins.allow`, `plugins.deny`, and `channels`. Any invalid field outside this narrow set produces no error. The function consequently returns `True` when the `errors` list remains empty, causing the command to report successful validation even though no comprehensive schema validation occurred. This is a fail-open design in a tool intended to provide configuration safety guarantees. Although the command prints an informational message when no schema exists, its successful return status can still be interpreted by users or automation as authorization to apply the configuration. ### Attack Path 1. An attacker or environmental failure prevents `openclaw gateway config.schema` from returning a usable schema. 2. The local schema cache is absent, unreadable, or contains invalid JSON. 3. The attacker supplies a configuration or pa ...[truncated 959 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Fail closed when neither a live nor cached schema is available: ```python if schema is None: return False, ["A valid schema is required for configuration validation."] ``` 2. Provide limited manual validation only through an explicit option such as `--allow-basic-validation`. 3. Use a distinct nonzero exit status for incomplete validation so automated workflows cannot mistake it for successful schema validation. 4. Clearly differentiate the following outcomes: - Full schema validation passed. - Full schema validation failed. - Validation could not be completed. 5. Validate that the top-level input is an object before accessing configuration fields. 6. If offline use is required, package a reviewed baseline schema and verify cached schema integrity and format before use. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:39
Finding
Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 39 **Vulnerability Type**: Unpinned dependency installation **Risk Level**: Low ### Vulnerable Code ```bash pip install jsonschema ``` ### Technical Analysis The installation documentation recommends installing `jsonschema` without specifying a reviewed version, trusted package index, or cryptographic hashes. The installed artifact is therefore selected dynamically from the Python package index configured in the user's environment. This creates supply-chain exposure if that index, an upstream account, a package mirror, or local package-management configuration is compromised. It also reduces reproducibility because future installations may receive materially different dependency versions than those reviewed with the Skill. No evidence was found that the project intentionally references a malicious or misspelled package. The risk arises from the unrestricted installation guidance rather than from a confirmed malicious dependency. ### Attack Path 1. A user follows the documented `pip install jsonschema` instruction. 2. The user's configured package index or mirror is compromised, redirected, or controlled by an attacker. 3. The index serves a malicious or tampered package artifact under the expected package name. 4. Package installation executes attacker-controlled build or installation behavior. 5. The malicious package subsequently executes when the validator imports `jsonschema`. ### Impact Assessment Successful exploitation could execute code with the privileges of the user performing the installation or running the validator. Accessible scope may include that user's files, environment variables, OpenClaw configuration, and any credentials available to the process. The issue does not itself provide privilege escalation. System-wide impact would require installation or execution under an elevated account. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `jsonschema` to a reviewed, compatible version or constrained version range. 2. Provide a lock file or hash-locked requirements file, for example: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Record hashes for all direct and transitive dependencies. 4. Recommend installation in an isolated virtual environment rather than the system Python environment. 5. Document the expected trusted package index and discourage unreviewed third-party mirrors. 6. Periodically update and re-audit the pinned dependency set for security advisories. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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
Findings (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill advertises and instructs shell execution plus reads from and writes to local files, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where an agent may invoke broader capabilities than a reviewer or runtime policy expects, increasing the risk of unintended file access or command execution.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The manifest description and main body are written in Chinese, which imposes a specific language on users. There is no indication that the skill supports other languages, offers opt-in language selection, or is restricted to a justified Chinese-only context.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The file's top-level documentation and CLI descriptions are entirely in Chinese, and the script's output strings continue this language assumption throughout the file. This imposes a specific language on users without opt-in or documentation that the tool is intended only for a Chinese-speaking or region-specific environment.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The script is described as a local preflight validator, but it silently reaches out through the OpenClaw CLI and persists returned data under the user's home directory. This violates least surprise and expands the trust boundary: a compromised or unexpected CLI/backend response could influence validation behavior or leave persistent artifacts without explicit user approval.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
For a validator whose stated purpose is local configuration checking, subprocess-based gateway access introduces unnecessary capability and an avoidable dependency on external behavior. In this context, the extra capability increases attack surface and can cause unintended network/service interaction, making the skill more dangerous than its description suggests.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
import subprocess
    try:
        # 优先使用 openclaw CLI 获取
        result = subprocess.run(["openclaw", "gateway", "config.schema"], capture_output=True, text=True, timeout=5)
        if result.returncode == 0:
            schema = json.loads(result.stdout)
            # 缓存一份
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Static analysis

No suspicious patterns detected.