Back to skill

Security audit

Active Maintenance

Security checks for vulnerabilities and agentic risk

Overview

The skill describes useful maintenance behavior, but it tells the agent to run an unbundled absolute-path optimizer that can delete files and mutate memory without enough visible scope or safeguards.

Treat this as a Review item before installing. Only use it if you can independently inspect and trust the exact `nightly_optimizer.py` on the target machine, confirm its cleanup allowlist and memory behavior, and run it first in dry-run or with backups where possible.

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
SKILL.md:22
Finding
Execution of Unreviewable External Maintenance Script## Vulnerability Details **File Location**: `SKILL.md`, lines 22-25 **Vulnerability Type**: Execution of code outside the reviewed skill package **Risk Level**: Medium **Complete Code Snippet**: ```markdown ### Run Full Maintenance ```bash python3 /root/.openclaw/workspace/scripts/nightly_optimizer.py ``` ``` ### Technical Analysis The skill instructs users or agents to execute an absolute-path Python script that is not included in the audited project. Because `/root/.openclaw/workspace/scripts/nightly_optimizer.py` is outside this package, its implementation, integrity, ownership, cleanup boundaries, and memory-handling behavior cannot be verified during review. The documented features indicate that this external script may delete temporary files, modify memory data, and write decision logs. If another process or user can create or modify the referenced file, following the documented command will execute that party's code with the permissions of the invoking process. No integrity verification, trusted ownership check, path validation, or execution isolation is documented. The `/root/` path does not by itself prove privilege escalation or that execution occurs as root. The maximum effective privileges are those already held by the user or agent invoking the command. ### Attack Path 1. An attacker or compromised local component obtains the ability to create or modify `/root/.openclaw/workspace/scripts/nightly_optimizer.py`. 2. The attacker inserts arbitrary Python instructions into that script. 3. A user or agent follows the maintenance instructions in `SKILL.md`. 4. `python3` executes the externally controlled script without an integrity or ownership check. 5. The payload performs actions available to the invoking account, potentially including file deletion, memory modification, data access, or further command execution. This exploitation path depends on the attacker first obtaining write access to the reference ...[truncated 743 chars]
Remediation
## Remediation Suggestions 1. Include `nightly_optimizer.py` inside the skill package so its exact implementation can be reviewed and versioned with `SKILL.md`. 2. Reference the bundled script through a package-relative path resolved from a trusted base directory rather than a mutable absolute workspace path. 3. Verify the script's ownership, permissions, canonical path, and cryptographic digest before execution when external placement is unavoidable. 4. Restrict write access to the script and all parent directories; do not execute it from a location writable by less-trusted users or processes. 5. Run maintenance under a dedicated least-privileged account and limit filesystem access to explicitly approved directories. 6. Validate cleanup targets using canonical paths and an allowlist. Reject root directories, symlinks escaping approved directories, empty paths, and traversal sequences. 7. Provide a dry-run mode, explicit deletion limits, structured audit logs, and recovery or backup controls before modifying files or persistent memory. 8. Require explicit authorization for destructive operations and memory mutation rather than relying solely on age or disk-usage thresholds.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill explicitly advertises automatic cleanup that removes aged temporary files and artifacts, but the documentation provides no warning about deletion behavior, scope, safeguards, or risk of accidental data loss. In an agent skill context, undocumented file deletion is dangerous because users may invoke maintenance assuming it is non-destructive, while the referenced optimizer script may remove files from configured directories without confirmation or backup.