Back to skill

Security audit

Code Optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a code-evaluation tool, but its deployment script installs and exposes unreviewed local code while modifying the user's OpenClaw/Hermes environment.

Review this skill carefully before installing. Only run its deploy script in a disposable or well-controlled workspace, and do not rely on the package alone to define what will execute because the script imports code from an external local path. Prefer a version that bundles all evaluator code, pins dependencies, avoids ambient pip installs, shows config diffs, asks before changing Hermes or HOME/bin, and provides retention controls for stored code-evaluation data.

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

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/deploy.sh:8
Finding

Deployment Executes Unverified Code from Outside the Audited Skill

Content
View full analysis
/dev/null || true ``` The generated command subsequently gives these copied modules import precedence: ```python sys.path.insert(0, OPTIMIZER_DIR) sys.path.insert(0, os.path.join(OPTIMIZER_DIR, 'evaluator')) ``` It then imports and executes the external implementation: ```python from auto_evaluator import CodeEvaluator evaluator = CodeEvaluator() result = evaluator.evaluate(code, task) ``` The generated command is copied into the installed Skill and exposed through the user's command path: ```bash cp "$HERMES_DIR/bin/code-eval" "$SKILL_DIR/scripts/code-eval" ln -sf "$HERMES_DIR/bin/code-eval" "$HOME/bin/code-eval" 2>/dev/null || true ``` ### Technical Analysis The deployment does not use an evaluator implementation included in the audited project. Instead, it copies Python modules from a hard-coded directory outside the Skill package. The copied files are not checked for expected ownership, permissions, content hashes, signatures, or source provenance. The generated `code-eval` executable places the copied directories at the beginning of `sys.path`. Consequently, Python imports `auto_evaluator.py` and related modules from this unverified source. Importing a Python module executes its top-level statements before `CodeEvaluator` is instantiated, so malicious code does not need to wait for the `evaluate` method to be called. This also creates a review-boundary problem: auditing the two files in this project cannot establish the behavior of the deployed ...[truncated 1360 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/deploy.sh:36
Finding

Deployment Installs Unpinned Python Dependencies Without Integrity Verification

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/deploy.sh:215
Finding

Workspace Path Is Unsafely Interpolated into Dynamically Generated Python Source

Content
View full analysis
&1 fi ``` ### Technical Analysis `WORKSPACE` is supplied through the first command-line argument and is incorporated into `CONFIG_FILE`. The shell safely quotes the value for the filesystem test, but the same value is then inserted between single quotes inside dynamically generated Python source. Shell quoting does not escape a value for use as a Python string literal. A workspace path containing a single quote and valid Python syntax can terminate the `config_path` literal and inject additional Python statements. The payload is executed by `python3 -c` with the privileges of the user running the deployment. The preceding `-f` check raises the exploitation requirement because the attacker must arrange for a regular file to exist at the resulting configuration path. Nevertheless, paths on Unix-like systems may contain quote and delimiter characters, making such a crafted path feasible where the attacker controls the workspace argument and its directory structure. ### Attac ...[truncated 1139 chars]
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose is code evaluation/optimization, but the documented behavior includes dependency installation, workspace copying, configuration changes, symlink creation, and broad filesystem writes. This mismatch is dangerous because users may grant trust appropriate for a code-quality tool while the skill performs deployment-like or system-modifying actions outside that expected scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The Hermes integration explicitly says evaluation results are stored in memory and the ML dataset is continuously expanded, again without user warning or consent. In context, this is more dangerous because the retained material can include source code and task content over time, compounding confidentiality, privacy, and model-poisoning risks across sessions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises installation and CLI usage that imply shell execution, file reads, and file writes, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization and review gap: operators cannot easily understand or constrain what the skill may touch, increasing the chance of unintended filesystem changes or command execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill states that evaluation results are automatically recorded as part of a feedback loop, but it does not warn users about retention, sensitivity, or privacy implications. Since code submissions may contain proprietary source, secrets, or personal data, silent logging can create unauthorized data retention and secondary-use risks.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script automatically runs pip3 install for sklearn, numpy, and pyyaml during deployment without pinning versions, integrity verification, or isolating the environment. Network-based dependency installation at deploy time creates supply-chain risk and allows unexpected code execution from package installation hooks or compromised dependencies.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Installing Python packages from the network without confirmation or warning is risky because it performs externally sourced code acquisition and installation silently during deployment. In the context of a developer tool, this can surprise users, bypass change control, and expose the environment to dependency or mirror compromise.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The deployment script performs broad filesystem changes well beyond a narrow code-evaluation skill: it creates directories, copies code and models, edits Hermes configuration, writes executable files, and creates a symlink in $HOME/bin. This expands the trust boundary of the skill and can unexpectedly alter the host environment, increasing the chance of persistence, misconfiguration, or abuse if the source paths or copied content are compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script rewrites the Hermes configuration file in place without backup, confirmation, or validation of resulting semantics beyond basic YAML parsing. Silent config mutation can break existing workflows, enable unwanted features, or create persistence for the skill inside a larger automation environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file presents the skill description and usage guidance primarily in Chinese, which can impose a language constraint on users. There is no indication that users may choose another language or that the Chinese-only presentation is required for a specific regional purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script comments, banner text, generated CLI docstring, help output, and runtime messages are consistently in Chinese, and no option is provided for users to select a different language. This can violate language/locale policy when the skill imposes a specific language without user opt-in or documented regional scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The embedded CLI documentation says 'test-suite' will run a standard test suite, which implies execution of tests. In the command dispatch table, however, 'test-suite' is mapped to cmd_status, so invoking it only shows system status rather than performing test execution.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.