Back to skill

Security audit

Sessmgr

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed local session manager, but one session-creation path fails to validate names before emitting agent control output.

Review before installing. The skill is local and purpose-aligned, but it can switch or create OpenClaw sessions and writes persistent session-name metadata. Avoid using untrusted or unusual session names until the new-session validation gap is fixed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/session_mgr.py:225
Finding

Unvalidated Session Name Allows Control-Signal and Output Injection

Content
View full analysis
") return 1 session_name = args[0].strip() names = load_names() if session_name in names: print(f"Error: a session named '{session_name}' already exists. Use /reload-session {session_name} to return to it.") return 1 print(f"NEW_SESSION:{session_name}") return 0 ``` ### Technical Analysis `cmd_new_session()` accepts the first command-line argument as a session name and embeds it directly into the `NEW_SESSION:` control output. It does not enforce the documented session-name allowlist or the documented 64-character maximum. Elsewhere, `cmd_name()` and `cmd_rename()` partially validate names as letters, digits, underscores, and hyphens. The missing equivalent validation in `cmd_new_session()` creates inconsistent trust boundaries. An argument can contain newline characters, terminal escape sequences, delimiters, or an excessively long value. Because `NEW_SESSION:` is intended to be consumed as an agent control signal rather than ordinary text, unescaped attacker-controlled content can alter the apparent structure of the output. Depending on downstream parsing behavior, this may create additional forged lines, spoof messages, confuse signal handling, or inject terminal control sequences. No evidence shows direct operating-system command execution through this flaw. ### Attack Path 1. An attacker or untrusted caller invokes the script's `new-session` command with a crafted first argument containing a newline, control sequence, delimiter, or excessive length. 2. `cmd_new_session()` strips only leading and trailing whitespace; it pe ...[truncated 1144 chars]
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

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 · SKILL.md (reported line 117)May include surrounding context.

/sessmgr new project-alpha

text

**Natural language:** *"start a new session called project-alpha"* / *"create a new session named staging"*

**Output on success:**

Vague Triggers

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The description says natural language works for phrases like "switch to my-dev-session" and similar free-form requests, but it does not define the full trigger scope or provide exclusion examples. This can increase the chance of unintended invocation from ordinary conversational phrasing about sessions.

Content

No source excerpt is available for this finding.