Back to skill

Security audit

Cybernetic Evolver

Security checks for vulnerabilities and agentic risk

Overview

This skill is not overtly malicious, but it asks users to wire a persistent self-optimization loop into an agent using broad hooks and an unsafe workspace import pattern.

Review before installing. Use this only in an isolated workspace, avoid adding writable directories to the front of Python's import path, provide and verify any init_evolver.py loader yourself, restrict save/load paths to a dedicated evolver state directory, and require explicit user approval before its recommendations change agent routing or strategy.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Error
Location
SKILL.md:445
Finding
Workspace Import-Path Precedence Enables Python Module Hijacking<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:445-447` **Vulnerability Type**: Untrusted Python import-path precedence **Risk Level**: High ### Vulnerable Code ```python EVOLVER_DIR = os.path.join(WORKSPACE, "evolver") sys.path.insert(0, EVOLVER_DIR) from init_evolver import load_evolver_for_agent ``` ### Technical Analysis The documented integration procedure inserts a workspace-controlled directory at index zero of `sys.path`. Python therefore searches this directory before standard and installed package locations when resolving `init_evolver`. The imported `init_evolver` module is not included in the audited project. Consequently, its identity and integrity are not established by this package. Importing a Python module executes its top-level code immediately, so a malicious `init_evolver.py` placed in the workspace would obtain arbitrary Python code execution when the Agent follows these deployment instructions. Exploitation requires an attacker, compromised process, or lower-trust component to be able to create or replace files in `WORKSPACE/evolver`. This is a conditional local trust-boundary vulnerability rather than evidence that the audited package itself contains a malicious payload. ### Attack Path 1. The Agent or operator configures `WORKSPACE` as described in `SKILL.md`. 2. An attacker or compromised local component obtains write access to `WORKSPACE/evolver`. 3. The attacker creates `WORKSPACE/evolver/init_evolver.py` containing malicious top-level Python code. 4. The Agent executes the documented initialization snippet. 5. `sys.path.insert(0, EVOLVER_DIR)` gives the attacker-controlled directory highest import precedence. 6. `from init_evolver import load_evolver_for_agent` loads the malicious file and executes its top-level code. 7. The payload runs with the same operating-system identity, filesystem access, environment variables, and network permissions as the Agent process. ### Impact Assessment Successful exploitatio ...[truncated 489 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Package `init_evolver` as a verified module within the distributed project rather than loading it from a mutable workspace. 2. Use an explicit package import, such as: ```python from cybernetic_evolver.init_evolver import load_evolver_for_agent ``` 3. Do not prepend writable directories to `sys.path`. If path modification is unavoidable, use a trusted, read-only installation directory and avoid index-zero insertion. 4. Resolve the expected module path and verify that it remains inside an approved directory before importing it. 5. Restrict directory ownership and permissions so lower-trust users and processes cannot modify Python source files loaded by the Agent. 6. For high-integrity deployments, verify the module against a pinned cryptographic hash or signed release manifest before loading it. 7. Document the source, expected location, and integrity requirements of `init_evolver`. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
DEMO/example.py:124
Finding
Demonstration Script Performs Hard-Coded Writes Outside the Project Directory<![CDATA[ ## Vulnerability Details **File Location**: `DEMO/example.py:124, 286, 409, 425` **Vulnerability Type**: Uncontrolled fixed-path filesystem writes **Risk Level**: Low ### Vulnerable Code ```python plt.savefig('/root/.openclaw/workspace/cybernetic-evolver/DEMO/demo1_convergence.png', dpi=150) ``` ```python plt.savefig('/root/.openclaw/workspace/cybernetic-evolver/DEMO/demo2_adaptation.png', dpi=150) ``` ```python plt.savefig('/root/.openclaw/workspace/cybernetic-evolver/DEMO/demo3_exploration.png', dpi=150) ``` ```python if __name__ == '__main__': print("Cybernetic Evolver — 演示示例集") print("基于钱学森《工程控制论》的AI自我进化框架") print("=" * 60) # 确保输出目录存在 os.makedirs('/root/.openclaw/workspace/cybernetic-evolver/DEMO', exist_ok=True) ``` ### Technical Analysis Executing the demonstration script creates a directory and writes three fixed-name image files under `/root/.openclaw/workspace`, regardless of the project’s actual installation directory or the caller’s desired output location. The code does not ask for confirmation, check whether the destination files already exist, or ensure that the resolved output path belongs to the audited project. `plt.savefig()` normally replaces an existing destination file. The behavior therefore creates an unnecessary cross-directory write side effect and assumes execution under a privileged root-oriented workspace layout. If an untrusted party can manipulate the destination path components or pre-position filesystem links, the fixed-path behavior may also redirect writes to another location accessible to the process. The generated content remains image data, which limits the practical impact, but the destination is still insufficiently controlled. ### Attack Path 1. The user or Agent runs `python DEMO/example.py`. 2. The script creates `/root/.openclaw/workspace/cybernetic-evolver/DEMO` when permitted. 3. Each demonstration writes to a predetermined filename in that directory. 4. Existing files wit ...[truncated 702 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Derive the default output directory from the script or project location: ```python from pathlib import Path output_dir = Path(__file__).resolve().parent / "output" output_dir.mkdir(parents=True, exist_ok=True) plt.savefig(output_dir / "demo1_convergence.png", dpi=150) ``` 2. Accept an explicit output directory through a command-line argument rather than embedding an absolute root path. 3. Resolve the selected path with `Path.resolve()` and verify that it is within an approved output directory. 4. Detect existing files and require an explicit overwrite option before replacing them. 5. Reject symlinked output files where deployment threat models include untrusted local users. 6. Run demonstrations with an unprivileged operating-system account and document all filesystem side effects. ]]>
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The document title and all descriptive prose are written in Chinese, with no indication that users may choose another language or that the skill is region-specific. Under the policy, forcing a specific language without opt-in is a natural-language locale violation.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The module docstring and user-facing documentation are written entirely in Chinese, with no indication that language is selectable or that the skill is intentionally region-specific. This creates a natural-language locale policy issue because the skill effectively imposes a specific language on users without opt-in.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The skill provides generic hooks for external state extraction, action transformation, metric computation, and an optimize loop that can steer arbitrary agent actions. In a broader agent framework, these hooks can be wired to sensitive capabilities so the evolver effectively becomes a policy engine for choosing external operations beyond its stated purpose, increasing the risk of abuse, privilege creep, and hard-to-audit behavior.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The module exposes unrestricted save/load primitives that read from and write to arbitrary file paths supplied by the caller. In an agent setting, this expands the skill from self-evolution logic into filesystem access, enabling unintended overwrite of local files, loading attacker-controlled state, or persistence of sensitive optimization history if the surrounding agent passes untrusted paths.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This Python file contains user-facing documentation and runtime messages in Chinese, beginning with the module docstring, without any indication that language selection is optional. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation even when it appears in code strings or comments.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The skill documentation is written entirely in Chinese, including the core description, headings, and usage explanations, with no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is justified, which is not present here.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill describes persistent state save/load operations and workspace file access, but declares no explicit tool scope or permission boundaries. In an agent ecosystem, undocumented file read/write capability can enable unintended persistence, modification of local state, or broader workspace interaction without operator awareness.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The manifest trigger list contains generic phrases without contextual constraints, making invocation collisions likely in normal conversations about adaptation or self-improvement. In this skill's context, activation can influence agent strategy selection and persistence behavior, so loose triggers create a real control-surface risk even without overtly malicious code.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger phrases include broad terms such as '自我进化', 'adaptive AI', and 'self-improving', which can match ordinary discussion and cause the skill to activate outside intended contexts. Because this skill proposes optimization, delegation, persistence, and structural mutation behaviors, accidental activation increases the chance of unexpected autonomous changes or recommendations in unrelated conversations.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This markdown file is written entirely in Chinese, including headings, workflow steps, and operational guidance, with no indication that language choice is optional or that the skill is region-specific. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation.

Intent-Code Divergence

Low
Confidence
95% confidence
Finding
The optimize() docstring describes a control loop in which the evolver selects an action, the external system executes it, and a result is then obtained. In code, no execution callback is invoked and no new result is fetched; instead, the method repeatedly reads a preexisting last_result from the input context, which contradicts the documented closed-loop behavior.

Description-Behavior Mismatch

Low
Confidence
85% confidence
Finding
The manifest describes a closed-loop adaptive/self-organizing AI framework, but this demo script performs concrete filesystem output by saving plots to fixed workspace paths. While plotting can support a demo, persistent file generation is still behavior beyond the core self-evolution functionality described in the manifest.

Description-Behavior Mismatch

Low
Confidence
84% confidence
Finding
These lines save demo-generated visualizations to fixed paths, which is not reflected in the manifest description focused on adaptive control, feedback loops, mutation, and online learning. The behavior is not harmful by itself, but it is an externally visible capability not described at the manifest level.

Description-Behavior Mismatch

Low
Confidence
87% confidence
Finding
The manifest presents the skill as an AI self-evolution/control framework, but the script also ensures directories exist and emits image artifacts into the workspace. That write-oriented demo tooling is a broader operational behavior than the conceptual framework description suggests.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The primary natural-language usage instructions and trigger guidance are presented in Chinese, including the explicit activation wording, without stating that users may choose another language. This can be a language/locale policy issue when a skill effectively assumes one language by default without opt-in or justification.

Static analysis

No suspicious patterns detected.