Back to skill

Security audit

Exec Inspector

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its stated history-inspection purpose, but it needs review because it broadly exposes private OpenClaw session history and supports persistent monitoring.

Install only if you are comfortable letting the agent inspect OpenClaw session history across past sessions. Treat outputs and exports as sensitive, avoid sharing them without redaction, and do not start the monitoring daemon unless you have verified the script and understand how to stop it.

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 (2)

other

Warning
Location
SKILL.md:145
Finding

Cross-Session Disclosure of Sensitive Command and Agent History

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 145-192
Vulnerability Type: Sensitive Agent session and command-history disclosure
Risk Level: Medium

Vulnerable Code

bash
# View the last 10 exec command records
grep '"name":"exec"' ~/.openclaw/agents/main/sessions/*.jsonl | tail -10 | while read line; do echo "$line" | jq -r '.message.content[0].arguments.command'; done

# Or use a more detailed format
grep '"name":"exec"' ~/.openclaw/agents/main/sessions/*.jsonl | tail -10 | jq -r '"\(.timestamp) | \(.message.content[0].arguments.command)"'

# Count the frequency of all exec commands
grep '"name":"exec"' ~/.openclaw/agents/main/sessions/*.jsonl | jq -r '.message.content[0].arguments.command' | sort | uniq -c | sort -rn

# View the execution history for a specific session
SESSION_ID="aa19ccb2-19ff-4458-84b4-d20e688fd797"
grep '"name":"exec"' ~/.openclaw/agents/main/sessions/${SESSION_ID}.jsonl | jq -r '"\(.timestamp) | \(.message.content[0].arguments.command)"'

# Search command records containing a particular keyword
grep '"name":"exec"' ~/.openclaw/agents/main/sessions/*.jsonl | jq -r 'select(.message.content[0].arguments.command | contains("git")) | "\(.timestamp) | \(.message.content[0].arguments.command)"'

# View complete records, including inputs and outputs
grep '"name":"exec"' ~/.openclaw/agents/main/sessions/*.jsonl | jq -C '.'

# Count all tool usage
grep -o '"name":"[^"]*"' ~/.openclaw/agents/main/sessions/*.jsonl | sort | uniq -c | sort -rn

# View today's exec records
TODAY=$(date +%Y-%m-%d)
grep '"name":"exec"' ~/.openclaw/agents/main/sessions/*.jsonl | jq -r "select(.timestamp | startswith(\"$TODAY\")) | \"\(.timestamp) | \(.message.content[0].arguments.command)\""

Technical Analysis

The Skill instructs the Agent to scan every JSONL file under ~/.openclaw/agents/main/sessions/, rather than limiting access to the current session or a user-approved file. ...[truncated 2113 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require explicit user confirmation before reading session-history files, especially when the request spans multiple sessions.
  2. Default to the current session and require the user to opt in before accessing other session files.
  3. Display the exact directory, file count, and requested scope before executing a search.
  4. Redact secret-like values before presenting results, including:
    • API keys and access tokens
    • Password arguments
    • Authorization and cookie headers
    • URLs containing embedded credentials
    • Private keys
    • Secret-bearing environment-variable assignments
  5. Remove full-record output as a default operation. Provide a narrowly selected field set instead.
  6. Require an additional confirmation before displaying raw JSON or exporting records.
  7. Apply strict permissions to session files and generated exports.
  8. Avoid copying sensitive results into persistent Agent memory, logs, or unrelated conversations.
  9. Document the privacy boundary clearly and warn that command-line arguments may contain secrets.

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:66
Finding

Execution of an Unbundled and Unverified Monitoring Script

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 66-129
Vulnerability Type: Execution of an unverified local executable
Risk Level: Low

Vulnerable Code

bash
# Start the background monitoring daemon
~/.openclaw/scripts/exec-monitor-daemon.sh start

# View real-time output
~/.openclaw/scripts/exec-monitor-daemon.sh tail
bash
# Start the daemon
~/.openclaw/scripts/exec-monitor-daemon.sh start

# View output in another terminal
~/.openclaw/scripts/exec-monitor-daemon.sh tail

# Stop monitoring
~/.openclaw/scripts/exec-monitor-daemon.sh stop
bash
alias exec-monitor='~/.openclaw/scripts/exec-monitor-daemon.sh'
alias exec-monitor-start='~/.openclaw/scripts/exec-monitor-daemon.sh start && ~/.openclaw/scripts/exec-monitor-daemon.sh tail'
alias exec-monitor-stop='~/.openclaw/scripts/exec-monitor-daemon.sh stop'

Technical Analysis

The Skill recommends executing ~/.openclaw/scripts/exec-monitor-daemon.sh, but that script is not included in the audited project. Consequently, its implementation, integrity, ownership, permissions, and provenance cannot be verified from this package.

A fixed path alone does not establish trust. If another local process, installer, compromised package, or user with write access can create or replace the file, the Agent may execute attacker-controlled shell code while treating it as a legitimate component of the Skill. The start operation is especially sensitive because it is represented as launching a background daemon.

No malicious daemon implementation was found in this project. Exploitation therefore requires a separately planted or modified local file, making this a hardening weakness rather than evidence of a bundled payload.

Attack Path

  1. An attacker or compromised local component obtains write access to ~/.openclaw/scripts/ or the target script.
  2. The attacker creates or replaces `exec-monitor-daemon. ...[truncated 972 chars]
Remediation
View remediation

Remediation Suggestions

  1. Bundle the daemon script in the reviewed Skill package so its implementation can be audited.
  2. Resolve the script's canonical path and reject symbolic links or paths outside the expected installation directory.
  3. Before execution, verify that the file:
    • Is owned by the expected user
    • Is not group- or world-writable
    • Is a regular file rather than a symbolic link
    • Matches a release-pinned cryptographic checksum or signature
  4. Require explicit confirmation before starting any background process.
  5. Show the verified script path and checksum to the user before execution.
  6. Install the script through a trusted, atomic installation process with restrictive permissions.
  7. Document the daemon's PID-file location, logs, shutdown behavior, and persistence characteristics.
  8. Apply least privilege and prevent the daemon from reading files unrelated to the monitoring task.
  9. Fail closed when integrity or ownership checks cannot be completed.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · QUICKSTART.md (reported line 26)May include surrounding context.

/.zshrc echo "alias exec-list='/.openclaw/scripts/exec-history.sh list'" >> /.zshrc echo "alias exec-stats='/.openclaw/scripts/exec-history.sh stats'" >> /.zshrc echo "alias exec-today='/.openclaw/scripts/exec-history.sh today'" >> /.zshrc echo "alias exec-search='/.openclaw/scripts/exec-history.sh search'" >> ~/.zshrc source ~/.zshrc

text

**对于 Bash 用户** (`~/.bashrc`):
```bash
echo "# OpenClaw Exec History 别名" >> ~/.bashrc
echo "alias exec-history='~/.openclaw/scripts/exec-history.sh'" >> ~/.bashrc
echo "alias exec-list='~/.openclaw/scripts/exec-history.sh list'" >> ~/.bashrc
echo "alias exec-stats='~/.openclaw/scripts/exec-history.sh stats'" >> ~/.bashrc
echo "alias exec-today='~/.openclaw/scripts/exec-history.sh today'" >> ~/.bashrc
echo "alias exec-search='~/.openclaw/scripts/exec-history.sh search'" >> ~/.bashrc
source ~/.bashrc

第二步:立即尝试

bash
# 查看最近执行的命令
exec-list

# 或者直接使用脚本(不需要别名)

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This section promotes broad, continuous collection and live output of all exec activity, which is a strong data-exposure pattern. In an agent environment, such monitoring can capture sensitive commands, secrets typed into shell invocations, and operational context continuously, making accidental or secondary disclosure much more likely.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly recommends viewing complete exec tool call details, including inputs, outputs, and arguments, which can expose sensitive conversation content and command data wholesale. Because session logs may contain secrets, tokens, proprietary paths, or confidential workflow details, encouraging full-record dumping significantly raises disclosure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The entire quickstart is written in Chinese and includes example invocation language in Chinese, but there is no indication that language selection is optional or that this is a region-specific variant. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The quickstart tells users to append aliases directly into persistent shell startup files and immediately source them, but it does not clearly warn that this permanently changes the user's shell configuration. While the aliases themselves are not overtly malicious, silently normalizing persistent modification increases risk because users may not understand they are granting future execution paths to a script under ~/.openclaw/scripts.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · QUICKSTART.md (reported line 112)May include surrounding context.

brew install jq

Ubuntu/Debian 安装

sudo apt-get install jq

text

## 📚 完整文档

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 305)May include surrounding context.

brew install jq

Ubuntu/Debian 安装

sudo apt-get install jq

text

## 📚 完整文档

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation repeatedly encourages listing, searching, and inspecting command and session history without warning that the displayed records may expose secrets, internal file paths, credentials typed into commands, or other sensitive activity. Because this skill is specifically designed to surface historical execution data, omission of privacy/security guidance makes misuse and accidental exposure more likely in normal operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly promotes exporting full execution history, which can include sensitive shell commands, session identifiers, paths, tokens embedded in commands, and operational metadata, but it provides no warning about handling that data safely. In a monitoring/audit tool, encouraging export without redaction or storage guidance materially increases the risk of accidental disclosure via shared files, backups, tickets, or source control.

Content

No source excerpt is available for this finding.

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

bash
# 确认脚本存在
ls -l ~/.openclaw/scripts/exec-history.sh

# 确认有执行权限
chmod +x ~/.openclaw/scripts/exec-history.sh

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

bash
# 确认脚本存在
ls -l ~/.openclaw/scripts/exec-history.sh

# 确认有执行权限
chmod +x ~/.openclaw/scripts/exec-history.sh

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill tells the AI to immediately execute history-inspection commands and present results, which can disclose sensitive command history, file paths, secrets embedded in commands, and session-derived metadata without an explicit consent or warning step. In this context, the data source is the user's private agent session logs, so automatic retrieval materially increases the risk of unintended disclosure.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs the AI to directly retrieve and summarize exec/session history, which can transform sensitive raw command data into a more readable disclosure. Even if intended for convenience, natural-language summaries can amplify leakage by highlighting private activity, secret-bearing commands, or behavioral patterns without the user realizing the exposure scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented daemon continuously captures and streams all exec activity in real time, but the feature description does not foreground the privacy and surveillance implications. Continuous monitoring of all commands can expose credentials, internal paths, repo contents, and sensitive operational behavior far beyond a one-time troubleshooting action.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.