Back to skill

Security audit

OpenClaw Performance

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a performance-analysis helper, but it automatically trusts code from an undeclared neighboring support directory and several advertised capabilities are broken or overstated.

Review this carefully before installing. The main security issue is not the performance-analysis purpose, but the script's automatic trust of a neighboring c-support/lib module outside the reviewed skill. Install only in an environment where that sibling directory is absent or controlled by trusted users, and expect the Python analysis/profiling/benchmarking behavior to need fixes before it works as advertised.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/main.py:14
Finding

Unverified Out-of-Project Python Module Execution

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 14–21
Vulnerability Type: Insecure dependency loading and Python import-path hijacking
Risk Level: Medium

Vulnerable Code

python
# Import C support library
c_support_path = Path(__file__).parent.parent.parent / 'c-support' / 'lib'
if c_support_path.exists():
    sys.path.insert(0, str(c_support_path))
    try:
        from c_parser import CParser
        C_SUPPORT_AVAILABLE = True
    except ImportError:
        C_SUPPORT_AVAILABLE = False

Technical Analysis

The script derives a directory outside the project root, prepends that directory to sys.path, and imports c_parser without verifying the module's source, ownership, or integrity.

Because the directory is inserted at index zero, a file or package named c_parser in that location takes precedence over other modules with the same name. Python executes module-level code during import, so merely starting the script can execute attacker-controlled code before any command is processed. Catching ImportError does not mitigate this behavior because malicious top-level code will already have run.

Exploitation requires an attacker to be able to create or replace files in the resolved c-support/lib directory. The code does not itself grant that write access, so exploitability depends on local filesystem permissions and deployment layout.

Attack Path

  1. An attacker obtains write access to the external c-support/lib directory resolved relative to scripts/main.py.
  2. The attacker creates or replaces c_parser.py, or creates a c_parser package containing malicious module-level code.
  3. A user or automated process invokes any command in scripts/main.py.
  4. The script places the attacker-controlled directory first in sys.path.
  5. Python imports the attacker's c_parser module and executes its top-level code.
  6. The payload runs with the same operating-system identity and permissions as the Skill process ...[truncated 573 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not prepend an external directory to sys.path.
  • Package c_parser as a normal, pinned dependency obtained from a trusted source, or bundle the required parser within the reviewed project.
  • Pin dependency versions and verify package integrity with hashes or signed artifacts.
  • If loading from a shared directory is unavoidable:
    • Resolve the canonical path and ensure it is beneath an explicitly configured trusted root.
    • Verify that the directory and module are not writable by untrusted users.
    • Validate the expected module file's cryptographic hash before loading it.
    • Load the exact validated file rather than changing global import precedence.
  • Run the Skill under a least-privileged account with restricted filesystem and credential access to reduce the impact of dependency compromise.
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring at L109 says this function analyzes a Python file for performance issues, but the body immediately calls helper checks using issues, tree, and lines without defining them. This is an active contradiction between the documented intent and executable behavior, because the function will fail rather than analyze Python code.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file presents the skill’s user-facing instructions and descriptions primarily in Chinese, including headings, feature descriptions, command explanations, and roadmap items. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description presents profiling code execution and optimization support as capabilities of the skill itself. However, run_profile only prints cProfile/line_profiler commands, and run_benchmark only prints a timeit command template, so the advertised profiling/benchmarking behavior is not actually implemented.

Content

No source excerpt is available for this finding.