Back to skill

Security audit

Auto Rename Session Label

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it installs an always-on hook with broad activation language and has a real path-scoping flaw around agent IDs.

Install only if you want an operator-managed hook that automatically labels sessions after future messages. Review the broad trigger wording before use, prefer explicit confirmation for installation, and consider patching the agent ID path validation plus documenting that first-message content may be sent to the active model provider for title generation.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
hook/handler.ts:34
Finding

Path Traversal Through an Unvalidated Agent Identifier

Content
View full analysis
:: function resolveAgentId(event: any): string { const ctxAgent = event?.context?.agentId; if (ctxAgent && String(ctxAgent).trim()) return String(ctxAgent).trim(); const sk = event?.sessionKey ? String(event.sessionKey) : ""; const m = sk.match(/^agent:([^:]+):/); if (m) return m[1]; const envAgent = process.env.OPENCLAW_AGENT_ID && process.env.OPENCLAW_AGENT_ID.trim(); if (envAgent) return envAgent; return "main"; } function sessionsFileFor(agentId: string): string { return path.join(openclawHome(), "agents", agentId, "sessions", "sessions.json"); } ``` The path is subsequently read: ```ts const agentId = resolveAgentId(event); const sessionsFile = sessionsFileFor(agentId); let sessions: any; try { sessions = JSON.parse(fs.readFileSync(sessionsFile, "utf8")); } catch { return; } ``` It is later written without validating that it remains under the expected agents directory: ```ts try { const fresh = JSON.parse(fs.readFileSync(sessionsFile, "utf8")); const target = fresh[sessionKey]; if (!target) return; if (target.label && String(target.label).trim()) return; target.label = label; fs.writeFileSync(sessionsFile, JSON.stringify(fresh, null, 2), "utf8"); } catch {} ``` ### Technical Analysis The hook treats `event.context.agentId` as a trusted filesystem path component. If that field is absent, it also accepts an agent identifier parsed from `event.sessionKey`. Neither source is restricted to a safe identifier syntax. An identifier containing parent-directory components or path separators can cause `path.join() ...[truncated 2579 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (10)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instruction See / hear any → run the install workflow below is dangerously over-broad because it can cause the agent to install a persistent hook on vague or accidental matches rather than explicit user authorization. In a skill that performs file writes and enables a hook, ambiguous activation increases the chance of unintended persistent system modification.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

The uninstall command uses rm -rf with an environment-derived base path, which is a hazardous deletion primitive if variables are unexpectedly set or expanded in an unsafe context. Although the target path is relatively constrained here, destructive recursive deletion in skill instructions increases the risk of operator error or path-manipulation accidents.

Content

Scanner excerpt · SKILL.md (reported line 89)May include surrounding context.

bash
openclaw hooks disable auto-rename-session-label
rm -rf "${OPENCLAW_HOME:-$HOME/.openclaw}/hooks/auto-rename-session-label"

Notes

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explains that the hook asks the current model to generate a title from session content, but it does not clearly and explicitly warn that message text is sent to the model for this purpose. This matters because first-message content may contain sensitive data, and using it for auto-titling creates an additional processing path and possible data exposure to the configured model provider.

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.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest's stated purpose is narrowly scoped to installing an internal OpenClaw hook for auto-titling sessions. While reading, writing, and editing files are expected for installation, declaring exec grants a broader capability than the documented purpose justifies and would allow arbitrary command execution beyond the described hook installation behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The listed trigger phrases include generic language such as auto title sessions, which is broad enough to match normal discussion or requests for conceptual help rather than consent to installation. Because this skill installs and enables a persistent hook, weak trigger specificity creates a meaningful risk of unintended execution.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
92% confidence
Finding

This skill persists files into the managed hooks directory under the user's OpenClaw home, creating a durable foothold that survives beyond the current interaction. Persistent installation is not inherently malicious, but it is security-relevant because future message processing will execute the installed hook automatically once enabled.

Content

Scanner excerpt · SKILL.md (reported line 51)May include surrounding context.

bash
   OPENCLAW_HOME="${OPENCLAW_HOME:-$HOME/.openclaw}"
   SKILL_DIR="<absolute path to this skill directory>"
   mkdir -p "$OPENCLAW_HOME/hooks/auto-rename-session-label"
   cp "$SKILL_DIR/hook/HOOK.md" "$SKILL_DIR/hook/handler.ts" \
      "$OPENCLAW_HOME/hooks/auto-rename-session-label/"

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code forwards the first user message verbatim into a separate completion request for title generation, which broadens exposure of potentially sensitive user input beyond the primary chat flow. Because this occurs automatically on message receipt and is framed as an internal hook, the privacy risk is heightened: users may not realize their text is being reused for auxiliary processing and possibly logged again by the provider or intermediaries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The hook sends the user's first message to a model/provider to generate a session title, and this file provides no notice, consent, or opt-in boundary for that secondary processing. Even if it uses the same configured provider/model as the session, it still forwards user text for an additional purpose, which can expose sensitive content in environments where users do not expect background metadata generation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The README states that the hook automatically writes session labels in the background on inbound messages, but it does not prominently warn users that session metadata will be modified automatically after installation. In a hook that runs implicitly on every message, lack of clear disclosure reduces informed consent and can cause unexpected metadata changes, especially in shared or audited environments.

Content

No source excerpt is available for this finding.