Back to skill

Security audit

Rename Session

Security checks for vulnerabilities and agentic risk

Overview

This skill renames local OpenClaw session labels as advertised and shows no evidence of hidden network access, credential access, or deceptive behavior.

Install only if you want a local command that edits OpenClaw session metadata directly. Use --root and --agent deliberately, consider backing up sessions.json if labels matter, and prefer a reviewed or pinned install path over the optional unpinned npx command.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
README.md:22
Finding

Unpinned Third-Party Package Execution Through npx

Content
View full analysis

Vulnerability Details

File Location: README.md:22-24
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: Medium

Vulnerable Code:

bash
npx skills add Songhonglei/better-agent-skills -s rename-session

Technical Analysis

The documented installation command invokes the third-party skills package through npx without specifying an exact package version or integrity value. If the package is not already available locally, npx can retrieve its currently resolved release from the configured npm registry and execute its CLI code with the invoking user's privileges.

Because package resolution is mutable, the code executed when a user follows this instruction may differ from the code available when this project was audited. The referenced GitHub repository is also not pinned to an immutable commit in this command. Consequently, compromise of the npm package, its publisher account, registry resolution, or the upstream repository could introduce unreviewed code into the installation process.

This finding concerns the documented installation path. The audited scripts/rename_session.py implementation itself contains no network requests, subprocess execution, or third-party Python dependencies.

Attack Path

  1. An attacker compromises the publisher account, release process, or another relevant part of the supply chain for the unpinned skills package.
  2. The attacker publishes a malicious release that remains compatible with the documented command.
  3. A user follows the README and executes npx skills add Songhonglei/better-agent-skills -s rename-session.
  4. npx resolves and downloads the malicious or unexpectedly changed package release.
  5. The package's CLI or lifecycle code executes with the user's privileges.
  6. The malicious code can access resources available to that user before, during, or instead of performing the expected Skill installation.

Impact Assess

...[truncated 462 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin the installer package to an audited exact version rather than allowing mutable resolution, for example by using an explicit skills@X.Y.Z version.
  • Pin the requested repository content to an immutable commit or verified release tag if the installer supports such references.
  • Publish and verify expected package and artifact integrity hashes.
  • Document the expected npm publisher, registry, package version, repository commit, and verification procedure.
  • Prefer installation from a locally reviewed artifact or a lockfile-controlled workflow.
  • In automated environments, configure an approved registry, disable unnecessary lifecycle scripts where compatible, and run installation with a minimally privileged account.
  • Re-audit package updates before changing the pinned version or repository revision.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/TESTING.md (reported line 120)May include surrounding context.

Cleanup

bash
rm -rf /tmp/rs-test-root ~/.local/share/rename-session
unset RENAME_SESSION_ROOT

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/TESTING.md (reported line 120)May include surrounding context.

Cleanup

bash
rm -rf /tmp/rs-test-root ~/.local/share/rename-session
unset RENAME_SESSION_ROOT

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/TESTING.md (reported line 120)May include surrounding context.

Cleanup

bash
rm -rf /tmp/rs-test-root ~/.local/share/rename-session
unset RENAME_SESSION_ROOT

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill explicitly describes direct reads and writes to session files and use of environment variables, but it does not declare any tool scope or permission boundaries. In an agent ecosystem, undeclared file and environment access weakens reviewability and least-privilege controls, increasing the chance the skill can be invoked with broader access than users expect.

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 · references/TESTING.md (reported line 8)May include surrounding context.

Setup (one-time)

bash
mkdir -p /tmp/rs-test-root/testagent/sessions
cat > /tmp/rs-test-root/testagent/sessions/sessions.json << 'EOF'
{
  "agent:testagent:main": { "label": "original label" },

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · references/TESTING.md (reported line 111)May include surrounding context.

T9 - history file (XDG)

bash
ls -la ~/.local/share/rename-session/history.json
cat ~/.local/share/rename-session/history.json

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 · scripts/rename_session.py (reported line 271)May include surrounding context.

python
print(f"ERROR: failed to rename session after {MAX_RETRIES} attempts.", file=sys.stderr)
    print(f"  Possible reasons:", file=sys.stderr)
    print(f"  1. File permission issues (check write access to {path})", file=sys.stderr)
    print(f"  2. Disk is full or read-only", file=sys.stderr)
    print(f"  3. Another process is continuously modifying sessions.json", file=sys.stderr)
    print(f"  4. File system corruption or I/O error", file=sys.stderr)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The markdown explains that the tool edits sessions.json directly to rename a session, and later notes it stores history in a local JSON file. However, it does not explicitly warn users that running the skill will modify local metadata files on disk, which is a data-affecting operation covered by the missing-warning rule for markdown files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The description states the tool supports random labels with 'zh/en with locale auto-detect', and the CLI docs say language defaults are auto-detected from locale environment variables. This imposes a language choice based on system settings rather than explicit user opt-in, which matches the policy concern for locale-forcing behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script derives the label language from locale environment variables and maps any non-Chinese locale to English automatically. This is a natural-language locale policy concern because the user is not explicitly asked to choose a language unless they discover and use the optional --lang flag.

Content

No source excerpt is available for this finding.