Back to skill

Security audit

openclaw-agentlog

Security checks for vulnerabilities and agentic risk

Overview

This skill performs real trace logging, but it also captures highly sensitive agent data and automatically patches the OpenClaw runtime outside the skill boundary.

Review before installing. Use only in an environment where operators explicitly accept full trace logging of tool inputs, outputs, and reasoning, and avoid ordinary npm install until the automatic OpenClaw runtime patching is removed or made an explicit admin-only step with clear rollback and version checks.

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

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/postinstall.js:17
Finding

Automatic Modification of the Globally Installed OpenClaw Runtime

Content
View full analysis
f.endsWith('.js')) .map(f => path.join(distDir, f)); } function isAlreadyPatched(content) { return content.includes('New trace started') && !content.includes('New session started'); } function patchFile(filepath) { const content = fs.readFileSync(fil ...[truncated 2859 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/index.ts:623
Finding

Unredacted Tool Inputs, Tool Outputs, and Reasoning Sent to an Unrestricted Endpoint

Content
View full analysis
( method: string, endpoint: string, body?: unknown ): Promise { const url = `${BACKEND_URL}${endpoint}`; const options: RequestInit = { method, headers: { "Content-Type": "application/json" }, ...(body ? { body: JSON.stringify(body) } : {}), }; const response = await fetch(url, options); if (!response.ok) { throw new Error(`API error: ${response.status} ${response.statusText}`); } return response.json() as Promise; } ``` ```typescript async function createSpan(traceId: string, span: { role: string; content: string; tool_name?: string; toolInput?: Record; toolOutput?: unknown; duration_ms?: number; timestamp?: string; }): Promise { try { const result = await apiRequest<{ success: boolean }>( "POST", "/api/spans", { traceId, actorType: span.role === "tool" ? "agent" : span.role, actorName: span.tool_name || "agent", payload: { event: span.role, content: span.content, toolName: span.tool_name, durationMs: span.duration_ms, timestamp: span.timestamp || new Date().toISOString(), toolInput: span.toolInput, toolOutput: span.toolOutput, }, } ); return result.success; } catch (error) { console.error("[openclaw-agentlog] Failed to create span:", error); return false; } } ``` ```typescript const contentObj = { tool: event. ...[truncated 3752 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/index.ts:1065
Finding

Manifest Privacy Controls Are Ignored and Sensitive Capture Remains Enabled

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill as a runtime agent logging and trace lifecycle management capability. However, the supplied code chunk is not implementing trace/session capture logic itself; it is an installation and deployment script for a plugin/hot patch on a remote OpenClaw Gateway host. Its primary behavior is operational: copying files, backing up configs, patching application dist assets, restarting services, and rollback. These are materially different and undeclared capabilities compared with automatic session evidence capture and trace management. While such an installer could support the described skill indirectly, this code chunk's actual purpose is deployment/maintenance rather than the declared end-user logging functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a runtime OpenClaw Agent skill responsible for automatic session evidence capture and full trace lifecycle management (creation, claim, completion, handoff, reasoning/tool/response capture). The supplied code does none of that. Instead, it is a deprecated filesystem patcher that edits OpenClaw distribution JavaScript files to change a displayed startup message and include a trace ID suffix. It does not implement hooks, trace lifecycle APIs, session persistence, reasoning capture, tool logging, response capture, or handoff logic. Its primary purpose and behavior are materially different from the declared skill description, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents this skill as an OpenClaw Agent logging and trace lifecycle management component that captures sessions, reasoning, tool calls, responses, and supports trace handoff. The supplied code does not implement those behaviors. Instead, it is an installation-time patcher that searches for the OpenClaw dist directory, backs up files, and rewrites a specific hardcoded message in compiled JavaScript to change 'New session started' to 'New trace started' and append an environment-provided trace ID. This is a materially different primary purpose and introduces undeclared capabilities: filesystem modification of another installed package, backup creation, and automatic execution on npm postinstall. While the patch may be related to trace labeling, it does not itself provide the described automatic evidence capture or lifecycle management features.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a concrete OpenClaw Agent skill that actively performs automatic session evidence capture and trace lifecycle operations. However, the provided code chunk is purely a .d.ts declaration file containing SDK type/interface definitions and hook signatures. While these types could support building such a skill, they do not themselves implement the described functionality. Therefore the code’s actual behavior is materially different from the declared purpose: it serves as type scaffolding for plugin development rather than an operational auto-recording and trace-management skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises automatic capture of reasoning, tool calls, and responses and transmission to a backend, but it does not present a clear warning about the sensitivity of that data or the privacy/security implications. Users and operators may unknowingly enable logging of secrets, personal data, credentials, proprietary prompts, and tool outputs to an external service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The installer performs privileged remote administration actions that exceed a narrow logging/trace skill boundary: it deploys files to a remote host, installs dependencies, patches OpenClaw core dist files, restarts the Gateway, and provides rollback logic. Even if intended for legitimate operations, this materially increases the skill's capability surface and creates a powerful supply-chain and integrity risk if the skill or its patch script is tampered with.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The installer copies and executes a patch script on the remote host and modifies OpenClaw core dist files in place. Core hot-patching is especially risky because it bypasses normal extension boundaries, can alter trusted platform behavior globally, and becomes a high-value persistence or supply-chain mechanism if the local plugin directory is compromised.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script can stop, start, and restart the OpenClaw Gateway service on a remote host via SSH. This is dangerous because a skill marketed for logging/trace management gains operational control over service availability, enabling denial of service, unsafe restarts, or disruption if misused or compromised.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nanoid==5.1.7 — 2 advisory(ies): CVE-2026-67214 (nanoid: non-secure generators can loop indefinitely with negative size); CVE-2026-73086 (nanoid: Integer Overflow or Wraparound)

High
Category
Supply Chain
Confidence
92% confidence
Finding

The lockfile pins nanoid to version 5.1.7, and the supplied advisory data indicates this exact version is affected by two high-severity issues involving negative-size infinite looping and integer overflow/wraparound. In this skill's context, an agent logging and trace-management component may generate IDs automatically during normal operation, so malformed or attacker-influenced size inputs could trigger denial of service or unstable ID generation in a central logging path.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nanoid==5.1.7 — 2 advisory(ies): CVE-2026-67214 (nanoid: non-secure generators can loop indefinitely with negative size); CVE-2026-73086 (nanoid: Integer Overflow or Wraparound)

High
Category
Supply Chain
Confidence
93% confidence
Finding

The package declares nanoid 5.1.7, which is reported as having vulnerabilities including an infinite-loop condition for negative sizes and an integer overflow/wraparound issue. In an agent logging and trace-management skill, identifier generation is likely central to session, trace, or handoff handling, so faults in ID generation can lead to denial of service, crashes, or unstable lifecycle management if attacker-controlled or malformed inputs reach the generator.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The package installs a postinstall hook that locates another package’s OpenClaw dist directory, backs it up, and modifies its compiled JavaScript in place. This is a supply-chain integrity risk because installing the skill silently changes host application behavior outside the package’s own boundary, which is far more invasive than the declared logging/trace-management purpose and can break updates, bypass review, or normalize unauthorized code injection into a trusted dependency.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

At installation time, the script enumerates JS files in the host OpenClaw dist directory, copies them to a backup directory, and rewrites matching files automatically. Running code during npm install that mutates another installed package creates a powerful and opaque execution path typical of supply-chain abuse; even if the current patch only changes status text, the capability enables arbitrary host modification and is especially dangerous in agent environments where trust in installed skills is high.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is explicitly designed to collect model reasoning, tool inputs/outputs, and prompt-derived content for persistence to an external service. In a security context, this is dangerous because those channels frequently contain credentials, proprietary source, internal prompts, and other highly sensitive material that should not be broadly retained or exported.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The createSpan flow sends raw content, toolInput, and toolOutput to the backend, which can directly include secrets, tokens, code, file contents, or user data. Because this occurs as part of routine operation and without shown filtering, it materially increases the blast radius of any backend compromise, misconfiguration, or unauthorized logging.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Uploading a joined reasoning summary and file-context data at trace finalization creates a concentrated sensitive record of the model’s internal deliberation and work context. This is especially risky because summaries may aggregate details that were scattered across the session, making exfiltrated data easier to exploit.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code deliberately extracts assistant thinking/reasoning blocks and stores them for later logging, turning otherwise ephemeral model deliberation into durable telemetry. This is dangerous because reasoning text can include hidden instructions, sensitive intermediate inferences, reproduced secrets, or confidential user/context data not intended for persistence or external sharing.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documentation describes capabilities that inherently require access to environment variables, files, network endpoints, and potentially shell-adjacent operations, but it declares no explicit tool scope or permission boundaries. This creates an overprivileged, under-specified integration surface where an agent may invoke broad capabilities without user-visible constraints or review.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation criteria are extremely broad, effectively covering all OpenClaw agent logging needs and handoff scenarios, which increases the chance of automatic invocation in contexts where users did not intend comprehensive logging. Overbroad trigger conditions are dangerous here because the skill also claims to capture reasoning, tool calls, and responses, amplifying accidental data collection.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Capturing reasoning, tool parameters, and responses creates a high-risk logging path for sensitive natural-language and structured data, including secrets, tokens, internal plans, customer data, and confidential outputs. Because this collection is described as automatic, it increases the likelihood of silent overcollection and long-lived retention in the backend.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The hook definitions explicitly instruct logging of tool-call parameters and execution results for all sessions, which can directly expose sensitive inputs and outputs in centralized logs. In agent environments, tool parameters often contain file contents, API tokens, customer data, or operational commands, making broad automatic logging especially risky.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documented data flow normalizes end-to-end automatic logging of parameters and results throughout execution, creating a system-wide retention channel for potentially sensitive session content. This is more dangerous in this skill context because the entire purpose is persistent evidence collection and trace management, which may encourage broad retention beyond operational necessity.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · install.sh (reported line 94)May include surrounding context.

sh
backup_openclaw_config() {
    log_info "备份 OpenClaw 配置..."
    
    ssh "$REMOTE_HOST" "mkdir -p ~/.openclaw/backup && cp ~/.openclaw/openclaw.json ~/.openclaw/backup/openclaw.json.bak_\$(date +%Y%m%d_%H%M%S)"
    
    log_info "配置已备份到 ~/.openclaw/backup/"
}

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes an automatic evidence/logging and trace lifecycle management skill for OpenClaw agents, but this file directly patches installed OpenClaw distribution JavaScript files under the global node_modules path. Modifying product bundles is a materially different operational behavior from recording agent activity or managing trace state, and is not presented as part of the skill’s stated scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code targets a hard-coded OpenClaw installation directory, creates backups, and overwrites .js files to alter runtime behavior and inject environment-based trace display. A trace logging and lifecycle skill would be expected to capture sessions and manage traces, but not to rewrite globally installed application bundles as an implementation capability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language comments and console messages in Chinese, including operational instructions shown to users after install. The file does not offer any language selection or explain a justified locale restriction, which creates a language/locale policy violation under the stated rules.

Content

No source excerpt is available for this finding.