T08 · Insecure Dependencies
- Location
SKILL.md:180- Finding
Unsafe installation instructions for standard-library package names
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is meant to manage OpenClaw session files, but it can rewrite or delete history and install recurring cron execution through under-scoped root paths.
Review and modify this skill before installing. Use one-shot manual runs first, avoid setup_cron.sh unless you have fixed the path, schedule, confirmation, and uninstall behavior, remove the pip install line, and treat generated summaries and archives as sensitive session data that may contain commands, private paths, and credentials.
SKILL.md:180Unsafe installation instructions for standard-library package names
scripts/setup_cron.sh:5Persistent cron task executes a mutable external workspace script
scripts/setup_cron.sh:7Installed cron frequency contradicts the documented daily schedule
scripts/cleanup_old_sessions.sh:20Whitespace-unsafe filename handling can delete unintended files
SKILL.md:163Troubleshooting guidance removes active-session lock protection indiscriminately
scripts/session_summarizer.py:178Full session commands and private paths are retained in plaintext summaries
The skill description does not clearly disclose that it may modify crontab, set executable permissions, or perform other system-level changes. Hidden persistence or scheduler modification is especially sensitive in an agent skill because it extends execution beyond the current user request and can repeatedly trigger future file modifications without fresh consent.
The skill description does not clearly disclose that it may modify crontab, set executable permissions, or perform other system-level changes. Hidden persistence or scheduler modification is especially sensitive in an agent skill because it extends execution beyond the current user request and can repeatedly trigger future file modifications without fresh consent.
The skill description does not clearly disclose that it may modify crontab, set executable permissions, or perform other system-level changes. Hidden persistence or scheduler modification is especially sensitive in an agent skill because it extends execution beyond the current user request and can repeatedly trigger future file modifications without fresh consent.
The skill description does not clearly disclose that it may modify crontab, set executable permissions, or perform other system-level changes. Hidden persistence or scheduler modification is especially sensitive in an agent skill because it extends execution beyond the current user request and can repeatedly trigger future file modifications without fresh consent.
The documented rm -f ~/.openclaw/agents/main/sessions/*.lock command performs forceful wildcard deletion without validation of the lock state, ownership, or whether another process is actively using the file. In the context of live session management, indiscriminate lock removal can corrupt concurrent operations, break synchronization, or normalize unsafe operator behavior around destructive shell commands.
如果看到 .lock 文件,先删除:
rm -f ~/.openclaw/agents/main/sessions/*.lock
Using find output piped through xargs rm -f is unsafe because filenames containing spaces, newlines, tabs, or shell-metacharacter-like separators can be split into unintended arguments. In a session/archive management skill that deletes files under privileged paths (/root/.openclaw), this can cause incorrect file deletions or make cleanup behavior attacker-influenceable if a maliciously named file is present.
else
COUNT=$(echo "$OLD_MEMORY" | wc -l)
echo "找到 $COUNT 个旧memory文件"
echo "$OLD_MEMORY" | xargs rm -f
TOTAL_DELETED=$((TOTAL_DELETED + COUNT))
echo "✅ 已删除 $COUNT 个memory文件"
fi
This deletion path has the same unsafe filename-handling flaw: find output is captured and then passed via xargs rm -f, which breaks on unusual filenames and can delete unintended files. Because this skill is explicitly designed to clean up logs and free space automatically, the operational context increases risk: automated execution under root magnifies the impact of malformed or attacker-planted filenames in the logs tree.
else
COUNT=$(echo "$OLD_LOGS" | wc -l)
echo "找到 $COUNT 个旧日志文件"
echo "$OLD_LOGS" | xargs rm -f
TOTAL_DELETED=$((TOTAL_DELETED + COUNT))
echo "✅ 已删除 $COUNT 个日志文件"
fi
The skill advertises and documents shell execution and file modification behavior, including rewriting session files, deleting lock files, changing permissions, and setting up cron jobs, but it declares no explicit tool scope or permission boundaries. In an agent setting, missing scope declarations makes these destructive capabilities harder to constrain or review, increasing the chance of unintended file-system changes or command execution beyond user expectations.
The manifest description and document content are presented entirely in Chinese, which effectively imposes a specific language on users without opt-in or explanation. Under the policy, language constraints should either offer user choice or be clearly documented as necessary for a region-specific use case.
The skill encourages immediate use for session archival and cleanup but does not present a clear warning that data may be rewritten, archived, deleted, or scheduled for automated future processing. In a data-management skill, lack of up-front warning increases the chance of accidental destructive actions on valuable session history.
The script's natural-language comments and console messages are entirely in Chinese, which imposes a specific language on users and operators. The file does not offer any language choice or document a justified locale-specific scope, so this is a language-policy issue under the stated rule.
The script permanently deletes archived session files older than 30 days with rm -f, but the skill description only advertises archiving, summarizing, and cleanup of session space without clearly disclosing retention-based destruction of archived data. In a session-management skill, this can cause silent loss of audit/history data that a user may reasonably expect to remain recoverable after archiving.
The script permanently deletes archived .jsonl.gz files older than 30 days and summary JSON files older than 60 days, which exceeds simple archiving/summarization and creates an undisclosed data-destruction behavior. In a session-management skill, these files may contain audit trails, user history, or recovery material, so silent retention-based deletion can cause irreversible loss and weaken forensic or compliance needs.
The summarizer is explicitly designed to collect and retain sensitive conversation-derived data such as participants, file references, commands run, tool calls, and summary text, then save that information in a new artifact. In the context of session archival, this broadens exposure by making sensitive operational details easier to search, copy, or exfiltrate than the raw session stream, especially if summaries are stored in shared or less protected locations.
The script writes a structured summary of session contents to disk, including metadata and extracted details from conversations, without any consent prompt, warning, retention controls, or redaction. Because session files may contain sensitive prompts, file paths, participant identifiers, commands, and tool activity, persisting a derivative artifact increases the privacy and data-retention risk beyond the original session file.
The module docstring describes taking old content, summarizing it, and archiving that extracted material. In implementation, trim_session() writes a summary file but archives a compressed copy of the full original session (shutil.copy2(self.session_file, backup_file)), then overwrites the original file with only recent messages. This is a meaningful contradiction in documented behavior, not just an omitted detail.
This code file contains natural-language instructions and status text that force a specific language/locale for users. Under the policy, locale constraints should either be optional for the user or clearly justified as region-specific, neither of which is present here.
The summarization logic derives and persists metadata from historical session content, including topics, file paths, timestamps, and activity indicators, into a separate summary artifact. In a session-management skill, this is materially risky because sessions often contain sensitive prompts, operational details, filesystem locations, and workflow history; creating a second, easier-to-read artifact broadens exposure and can bypass expectations that trimming reduces retained sensitive data.
The tool creates a compressed backup containing the entire original session before trimming, preserving all prior conversation data in full. In this skill context, that undermines the expected privacy/storage benefit of trimming and increases the number of copies of potentially sensitive session data, raising risk from local compromise, misconfigured permissions, accidental sharing, or over-retention.
This script installs a persistent hourly cron job under a hard-coded root-owned workspace path, which extends the skill's behavior beyond one-time session archiving into ongoing system-level task management. In the context of an agent skill, persistence increases risk because any later modification to the target script or its environment will be executed automatically and repeatedly, potentially without further user awareness.
Listing and managing crontab entries is part of establishing persistence, and here it supports installing a recurring task that will continue running independently of the initiating session. Within a session-archiving skill, this makes the behavior more dangerous because it creates durable execution on the host rather than performing a bounded maintenance action.
# 检查当前的 cron 任务
echo "当前的 cron 任务:"
crontab -l 2>/dev/null || echo "(暂无定时任务)"
echo ""
# 检查是否已经存在相同的任务
This check determines whether the target script is already present in the user's crontab, enabling silent update of an existing persistent task. The danger is not the grep itself, but that it facilitates maintaining recurring execution, which can repeatedly run a modified or compromised archive script over time.
echo ""
# 检查是否已经存在相同的任务
if crontab -l 2>/dev/null | grep -q "$SCRIPT_PATH"; then
echo "定时任务已存在,正在更新..."
# 删除旧任务
(crontab -l 2>/dev/null | grep -v "$SCRIPT_PATH"; echo "$CRON_JOB") | crontab -
This code rewrites the current crontab to remove matching entries and install a new scheduled command, directly establishing durable execution. Because the script path and log path are hard-coded under /root, successful use in a privileged context could create a high-impact persistence mechanism that repeatedly executes whatever resides at that path.
if crontab -l 2>/dev/null | grep -q "$SCRIPT_PATH"; then
echo "定时任务已存在,正在更新..."
# 删除旧任务
(crontab -l 2>/dev/null | grep -v "$SCRIPT_PATH"; echo "$CRON_JOB") | crontab -
else
echo "添加新的定时任务..."
# 添加新任务
This branch appends a new cron job, creating recurring execution every hour with output redirected to a file in the same workspace. In an agent-skill setting, that persistence is risky because any subsequent tampering with the scheduled script or writable workspace can convert a maintenance helper into an automatic execution foothold.
else
echo "添加新的定时任务..."
# 添加新任务
(crontab -l 2>/dev/null; echo "$CRON_JOB") | crontab -
fi
echo ""
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.
echo ""
echo "=== 完成 ==="
echo "定时任务已设置为每小时运行一次"
echo "可以使用 'crontab -l' 查看当前任务"
echo "可以使用 'tail -f $CRON_LOG' 查看日志"
No suspicious patterns detected.