Back to skill

Security audit

Evolution Toolkit

Security checks for vulnerabilities and agentic risk

Overview

The toolkit mostly matches its stated self-improvement purpose, but it can silently read and persist sensitive OpenClaw workspace memory and sends optimizer inputs to Gemini without a clear confirmation step.

Install only in a workspace where it is acceptable to analyze and store agent memory, identity/guidance files, task context, and personal reasoning notes. Set `EVOLUTION_TOOLKIT_WORKSPACE` explicitly before running scripts, review generated files under `memory/`, avoid using shared or synced directories for sensitive imprints/reports, and use the Gemini optimizer only when playbooks and test cases are safe to send to Google. Prefer a pinned installer version instead of the README's unpinned `npx` command.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T08 · Insecure Dependencies

Error
Location
README.md:16
Finding
Unpinned Package Execution in the Documented Installation Command<![CDATA[ ## Vulnerability Details **File Location**: `README.md:16-22` **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: High ### Vulnerable Code ```markdown ## Install ClawHub-style install target: ```bash npx clawhub install ergopitrez/evolution-toolkit ``` ``` ### Technical Analysis The documented installation procedure invokes `clawhub` through `npx` without specifying an audited package version or integrity value. If the package is not already available locally, `npx` can retrieve and execute the version currently resolved by the package registry. Consequently, the executable installer may differ from the version reviewed when this Skill was audited. Compromise of the registry package, its maintainer account, or a future release could turn the installation command into an arbitrary-code execution channel. No evidence shows that the current `clawhub` package is malicious. The vulnerability is the absence of version and integrity controls around executable third-party code. ### Attack Path 1. An attacker compromises the package publisher, registry entry, or distribution account associated with `clawhub`. 2. The attacker publishes a modified release containing malicious installation behavior. 3. A user follows the README and runs the unpinned `npx clawhub install ...` command. 4. `npx` resolves and downloads the attacker-controlled release. 5. The package executes with the privileges of the user running the command. 6. The malicious package can access files and credentials available to that user, alter the workspace, install persistence, or execute additional payloads. ### Impact Assessment Successful exploitation can result in arbitrary code execution under the installer user's account. The accessible scope may include: - The current project and Agent workspace. - Files readable or writable by the user. - Environment variables and developer credentials available to the process. - Network resources accessible from t ...[truncated 224 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the installer to a specifically audited version: ```bash npx --yes clawhub@<audited-version> install ergopitrez/evolution-toolkit ``` 2. Publish and verify a cryptographic integrity value or signed release before execution. 3. Prefer a lockfile-backed installation workflow where practical. 4. Instruct users to inspect the resolved package version before running it. 5. Avoid automatically accepting future versions merely because they share the same package name. 6. Run the installer in a restricted container or sandbox without production credentials or sensitive workspace mounts. 7. Document the trusted registry and package publisher identity. 8. Establish a release-review process and update the pinned version only after auditing the new release. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/contradiction-scanner.js:19
Finding
Implicit Access to Sensitive Agent Workspace Files When Workspace Configuration Is Missing<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/contradiction-scanner.js:19-20, 37-49, 343-346` - `scripts/session-coherence.js:17-19, 69-77` - `scripts/session-imprint.js:23-25, 226-229` - `scripts/cognitive-fingerprint.js:20-22, 387-393` **Vulnerability Type**: Fail-open workspace selection and excessive access to Agent state **Risk Level**: High ### Vulnerable Code The scripts silently select the default OpenClaw workspace when `EVOLUTION_TOOLKIT_WORKSPACE` is absent: ```js const WORKSPACE = process.env.EVOLUTION_TOOLKIT_WORKSPACE || (process.env.HOME ? require('path').join(process.env.HOME, '.openclaw/workspace') : process.cwd()); ``` The contradiction scanner then enumerates sensitive Agent guidance and state files: ```js const GUIDANCE_FILES = [ 'AGENTS.md', 'SOUL.md', 'TOOLS.md', 'MEMORY.md', 'EVOLUTION.md', 'HEARTBEAT.md', 'CURRENT.md', 'TASKS.md', 'memory/decisions.md', 'memory/workflows.md', 'memory/subagents.md', ].map(f => path.join(WORKSPACE, f)); ``` Those files are read during scanning: ```js GUIDANCE_FILES.forEach(filePath => { const content = readFile(filePath); if (!content) { if (VERBOSE) console.log(c.gray(` ⊘ ${path.relative(WORKSPACE, filePath)} (not found)`)); return; } ``` The session-coherence analyzer reads all matching daily memory logs: ```js function readDailyFiles(maxDays = 30) { const files = fs.readdirSync(MEMORY_DIR) .filter(f => f.match(/^\d{4}-\d{2}-\d{2}\.md$/)) .sort() .slice(-maxDays); return files.map(f => ({ date: f.replace('.md', ''), path: path.join(MEMORY_DIR, f), content: fs.readFileSync(path.join(MEMORY_DIR, f), 'utf8') })); } ``` The session-imprint script also imports task context from `CURRENT.md`: ```js let currentContext = ''; if (fs.existsSync(CURRENT_MD)) { const lines = fs.readFileSync(CURRENT_MD, 'utf8').split('\n').slice(0, 20); currentContext = lines.join('\n'); } ``` ### Technical Analysis The docum ...[truncated 2458 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Fail closed when `EVOLUTION_TOOLKIT_WORKSPACE` is not explicitly set: ```js const WORKSPACE_ENV = process.env.EVOLUTION_TOOLKIT_WORKSPACE; if (!WORKSPACE_ENV) { console.error('EVOLUTION_TOOLKIT_WORKSPACE must be explicitly configured.'); process.exit(1); } const WORKSPACE = path.resolve(WORKSPACE_ENV); ``` 2. Display the resolved workspace and requested files before reading them. 3. Require an explicit confirmation for sensitive files such as `SOUL.md`, `MEMORY.md`, `AGENTS.md`, and daily memory logs. 4. Provide per-command file allowlists rather than automatically scanning every known Agent-state file. 5. Add options such as `--include-memory`, `--include-identity`, and `--include-tasks`, with sensitive categories disabled by default. 6. Resolve each path canonically and verify that it remains inside the approved workspace root. 7. Refuse symbolic links that escape the approved workspace, or resolve them and enforce containment. 8. Warn users that terminal output and generated reports may contain derived sensitive information. 9. Create generated reports with restrictive permissions and avoid placing them in shared directories. 10. Add a dry-run mode that lists intended reads and writes without opening any content. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/skill-optimizer.js:139
Finding
Gemini API Key Included in the Request URL<![CDATA[ ## Vulnerability Details **File Location**: `scripts/skill-optimizer.js:139-165` **Vulnerability Type**: Credential exposure through a URL query parameter **Risk Level**: Medium ### Vulnerable Code ```js async function callGemini(prompt, apiKey, model = 'gemini-2.5-flash-lite') { return new Promise((resolve, reject) => { const body = JSON.stringify({ contents: [{ parts: [{ text: prompt }] }], generationConfig: { temperature: 0.3, maxOutputTokens: 2048 } }); const options = { hostname: 'generativelanguage.googleapis.com', path: `/v1beta/models/${model}:generateContent?key=${apiKey}`, method: 'POST', headers: { 'Content-Type': 'application/json' } }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => data += chunk); res.on('end', () => { try { const json = JSON.parse(data); const text = json.candidates?.[0]?.content?.parts?.[0]?.text; if (!text) { reject(new Error(`No text in response: ${data.slice(0, 200)}`)); return; } resolve(text); } catch (err) { reject(new Error(`Parse error: ${err.message}`)); } }); }); ``` ### Technical Analysis The Gemini API key is interpolated into the HTTP request path as the `key` query parameter. TLS protects the URL while it is transmitted to the intended HTTPS endpoint, but URLs are commonly handled by infrastructure components that may retain request paths, including: - Debugging and instrumentation layers. - Forward proxies. - Application performance monitoring tools. - HTTP request tracing. - Exception and diagnostic logs. A credential in a query string is therefore more exposed to incidental logging than a credential placed in a dedicated authentication header. The reviewed script does not directly print the request path, so exploitation depends on surrounding infrastructure recordi ...[truncated 1361 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Use the provider-supported authentication header or an official SDK when the API supports that authentication method. 2. If the Gemini endpoint requires a query-string key, treat the request URL as sensitive and ensure that no logger, proxy, tracing agent, or error handler records it. 3. Redact parameters named `key`, `api_key`, `token`, or similar values from all HTTP diagnostics. 4. Restrict the API key to the required Gemini API and approved source environments where supported. 5. Use a dedicated key for this tool instead of a broadly privileged project key. 6. Rotate the key immediately if a request URL may have been logged. 7. Avoid storing credentials in the workspace when environment-based or managed-secret injection is available. 8. Apply restrictive permissions to `.secrets` and reject files readable by unrelated users. 9. Validate `model` against a strict allowlist before inserting it into the request path. 10. Document that playbooks, test cases, generated outputs, and evaluation data are transmitted to Google Gemini during live optimization. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (27)

Ae1

High
Category
analysis-evasion
Content
`scripts/session-imprint.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/session-imprint.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/cognitive-fingerprint.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/cognitive-fingerprint.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/contradiction-scanner.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/contradiction-scanner.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/predict.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/predict.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/skill-optimizer.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/skill-optimizer.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/skill-optimizer.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/socratic-mode.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/socratic-mode.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/session-coherence.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/session-coherence.js`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
}
    }
  });
  return directives;
}

function extractFilePaths(content, source) {
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding
The README instructs users to execute `npx clawhub install ergopitrez/evolution-toolkit` without pinning a specific version or commit. This introduces supply-chain risk because the command may fetch and run whatever package/version is current at install time, allowing compromised upstream releases or dependency confusion-style issues to affect operators installing the toolkit.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The phase-detection cues are broad everyday phrases like 'I think', 'Should I', and 'Build', so the protocol can activate or shift behavior based on normal conversation rather than explicit user intent. In a default-engagement protocol, this can silently change the assistant from answering directly to steering with Socratic questioning or vice versa, creating unintended behavior and reducing user control.

Intent-Code Divergence

Medium
Confidence
91% confidence
Finding
The script’s header and usage text describe it as a text analysis tool, but the implementation later auto-saves fingerprint results to a persistent file by default. For a tool analyzing potentially sensitive personal writing, undisclosed persistence creates a privacy and data-retention risk because users may expose behavioral or cognitive-profile data without informed consent.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The code automatically persists a generated cognitive fingerprint for single-file runs unless --no-save is supplied, but the usage/help output does not prominently warn about this behavior. Because cognitive fingerprints are derived from user text and framed as tracking drift and tendencies, silent default storage can accumulate sensitive profiling data on disk and surprise users in shared or less secure environments.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script aggregates potentially sensitive daily memory logs and writes a derived report back to disk automatically, including top words, extracted lessons, energy summaries, and a self-portrait. Even though it stays within the workspace by default, this creates an additional persisted artifact that may broaden exposure of private content, especially if the report directory is synced, shared, or less access-controlled than the source logs.

Ssd 3

Medium
Confidence
93% confidence
Finding
The tool is explicitly designed to preserve and replay prior session context for future runs, including subjective notes and copied task context, which increases the chance that sensitive information persists across sessions and is reused outside its original scope. In an agent workflow, this makes context contamination and privacy leakage more dangerous because future operators or automations may consume stored data without revalidating whether it is still appropriate to access.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script persistently writes free-form interactive notes plus the first 20 lines of CURRENT.md to disk, which can easily include secrets, internal plans, tokens, or sensitive user/session context. There is no consent checkpoint, redaction, minimization, retention control, or access restriction beyond checking writability, so sensitive data may be stored unintentionally and later exposed to other local users, tools, backups, or logs.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The optimizer sends the full playbook, test-case data, and generated outputs to a remote Gemini API without any explicit disclosure, confirmation, or data-minimization controls. In a skill-development context, these artifacts can easily contain proprietary prompts, customer scenarios, or sensitive internal data, so silent transmission creates a real confidentiality risk even if the code is not overtly malicious.

Vague Triggers

Low
Confidence
89% confidence
Finding
The markdown says to "Run this protocol at session end and at the next session start," but does not define what counts as a qualifying session, workspace, or exception case. Because this is a markdown file, the vague activation guidance falls under ambiguous trigger scope and could lead to unnecessary or unintended invocation.

Static analysis

No suspicious patterns detected.