Back to skill

Security audit

OpenClaw Config Field Validator

Security checks for vulnerabilities and agentic risk

Overview

This skill is not malicious, but it can give unsafe false confidence by accepting some unknown OpenClaw configuration fields as valid while presenting itself as schema validation.

Install only if you understand this is a helper for field lookup, not a complete OpenClaw configuration security validator. Do not rely on it alone to approve sandbox, filesystem, execution, token, or channel settings until the unknown-child fail-open behavior and documentation mismatch are fixed.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/schema_loader.py:52
Finding

Unknown Child Fields Are Incorrectly Accepted as Valid

Content
View full analysis

Vulnerability Details

File Location: scripts/schema_loader.py, lines 52–63
Vulnerability Type: Improper schema validation / fail-open validation
Risk Level: Medium

Vulnerable Code

python
def get_field_info(field_path: str, fields: Dict[str, Any]) -> Optional[Dict[str, Any]]:
    """Get information about a specific field."""
    # Try exact match first
    if field_path in fields:
        return fields[field_path]
    
    # Try matching parent paths
    parts = field_path.split('.')
    for i in range(len(parts) - 1, 0, -1):
        parent_path = '.'.join(parts[:i])
        if parent_path in fields:
            parent_info = fields[parent_path]
            # Check if parent is an object that could contain this field
            if parent_info.get('type') == 'object':
                # Field might be valid but not documented individually
                return {
                    "type": "unknown (child of object)",
                    "optional": True,
                    "parent": parent_path,
                }
    
    return None

Technical Analysis

get_field_info() first checks for an exact schema match, but then falls back to accepting any unknown descendant of a field whose type is object. The function returns a non-null synthetic field description, which callers interpret as proof that the field is valid.

In scripts/validate_field.py, any non-null result becomes "valid": True. Likewise, scripts/validate_config.py adds such paths to valid_fields. Consequently, a path such as tools.exec.securitty is accepted because tools.exec is a known object, even though the misspelled child is absent from the bundled schema.

This behavior contradicts the Skill’s stated purpose of checking whether configuration fields exist and are schema-compliant. It is particularly concerning for security-sensitive settings, including execution policy, filesystem restrictions, sandbox controls, allow/deny lists, and credential co ...[truncated 1719 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require an exact schema-field match by default. Remove the generic fallback that treats every child of an object as valid.
  2. If some objects intentionally allow arbitrary keys, represent that property explicitly in the schema, such as with an additionalProperties or open_map marker.
  3. Return a distinct unverified result for descendants of explicitly extensible objects rather than reporting them as valid.
  4. Ensure validate_field.py and validate_config.py distinguish among exact matches, permitted dynamic keys, unverified fields, and invalid fields.
  5. Fail closed for security-sensitive objects such as tools.exec, tools.fs, agents.defaults.sandbox, and allow/deny policy structures.
  6. Add regression tests covering:
    • Misspelled security fields such as tools.exec.securitty.
    • Invented descendants beneath ordinary objects.
    • Valid exact child fields.
    • Legitimate dynamic-map keys, if supported.
    • Unknown fields nested in arrays of objects.
  7. Consider validating values and required fields in addition to field-path existence so the implementation more closely matches its schema-compliance claims.
Vulnerability Patterns
  • 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The described validation appears narrower than claimed: checking whether a field path exists is not equivalent to validating configuration values or full openclaw.json correctness. While not inherently malicious, overstating validation coverage can cause users to rely on incomplete checks and miss invalid or unsafe configuration values.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The described validation appears narrower than claimed: checking whether a field path exists is not equivalent to validating configuration values or full openclaw.json correctness. While not inherently malicious, overstating validation coverage can cause users to rely on incomplete checks and miss invalid or unsafe configuration values.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The described validation appears narrower than claimed: checking whether a field path exists is not equivalent to validating configuration values or full openclaw.json correctness. While not inherently malicious, overstating validation coverage can cause users to rely on incomplete checks and miss invalid or unsafe configuration values.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The described validation appears narrower than claimed: checking whether a field path exists is not equivalent to validating configuration values or full openclaw.json correctness. While not inherently malicious, overstating validation coverage can cause users to rely on incomplete checks and miss invalid or unsafe configuration values.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README states that the skill 'automatically triggers when working with OpenClaw configurations' without defining exact activation conditions, scope, or safeguards. In an agent runtime, ambiguous auto-trigger behavior can cause the skill to activate on broader inputs than intended, leading to unintended file inspection, validation actions, or influence over configuration-editing workflows.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises shell, file read, and file write behavior but does not declare any explicit tool scope or permission boundaries in the skill metadata. In a skill system, missing scope declarations can cause an agent to invoke capabilities more broadly than a user expects, especially since the workflow includes downloading schemas and writing cache files.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file claims to synchronize the schema to the local OpenClaw version, but the implementation currently just copies the bundled schema and marks it as the local version. This can mislead users into trusting compatibility that does not exist, potentially causing incorrect validation decisions and unsafe configuration acceptance or rejection.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill persists data under the user's home directory even though its advertised function is schema field validation. Persistent reads/writes create side effects, allow stateful behavior across runs, and increase privacy and integrity risks if the cache is tampered with or if users do not expect a validator to modify files.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is described as field validation against an official schema, but this file adds broader behavior: environment inspection, schema synchronization, and persistent cache/version management. That scope expansion violates least privilege for a validation-focused skill and increases attack surface by introducing filesystem writes and host-state dependence.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/sync_schema.py (reported line 25)May include surrounding context.

python
"""Get the currently installed OpenClaw version."""
    # Try command line first
    try:
        result = subprocess.run(
            ["openclaw", "--version"],
            capture_output=True,
            text=True,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Executing an external CLI is not justified by the stated purpose of validating configuration fields. In a skill context, spawning host binaries expands the trust boundary and can be abused indirectly via PATH hijacking, unexpected binary behavior, or execution in restricted environments where validation should have remained purely local and declarative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown states that schema sync is automatic and that the skill downloads data from GitHub and writes local cache files, but it does not prominently warn users about network access and filesystem modification. Hidden side effects are risky in agent workflows because a user may expect a local validation step and instead trigger outbound requests or persistent file changes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a validator for checking whether OpenClaw configuration fields exist and are valid. However, the file docstring and main flow explicitly state and perform schema synchronization via ensure_schema_synced(), which is an additional operational behavior beyond pure validation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The module docstring states 'Auto-syncs schema if needed', suggesting the script's validation behavior includes syncing as part of its operation. However, validate_field() only attempts to read cached schema state and even references an undefined loader helper, while the actual sync attempt happens separately in main(). This is an intent/documentation mismatch rather than a core security issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

This code automatically calls ensure_schema_synced() before validation and only reports a warning if syncing fails. Because the module docstring and runtime messaging do not clearly disclose what the sync does or whether it may contact external systems, users may not realize validation can trigger network or data-transfer behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.