Back to skill

Security audit

Clawdbot Logs

Security checks for vulnerabilities and agentic risk

Overview

This diagnostics skill is mostly purpose-aligned, but it includes an unsafe shell argument path and a command that can expose raw private conversation text.

Install only if you trust the operator and understand that it can inspect local Clawdbot logs and session records. Avoid using the raw recent-message command unless explicitly needed, scoped to a chosen session, and redacted before sharing. The response-times script should validate count input before use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/response-times.sh:5
Finding

Command Injection Through an Unvalidated Count Argument

Content
View full analysis
/dev/null | \ grep -E "session state.*run_(started|completed)" | \ tail -$((COUNT * 2)) | \ awk ' ``` The value is reused without validation later in the script: ```bash ' | tail -$COUNT ``` ### Technical Analysis The first positional argument is assigned directly to `COUNT` without verifying that it is a decimal integer within an acceptable range. It is subsequently evaluated inside Bash arithmetic expansion: ```bash $((COUNT * 2)) ``` Bash arithmetic evaluation recursively interprets variable values as arithmetic expressions. Specially constructed input can therefore reach expression evaluation features, including array-subscript expansion and command substitution, rather than being handled only as a numeric count. The unquoted use in `tail -$COUNT` is also unsafe. It can cause word splitting, glob expansion, or option manipulation, depending on the supplied value. Although this secondary use is not itself a reliable shell-code reevaluation mechanism, it expands the input-handling attack surface. ### Attack Path 1. An attacker influences the argument passed to `scripts/response-times.sh`. 2. The script stores the argument unchanged in `COUNT`. 3. The expression `tail -$((COUNT * 2))` causes Bash to evaluate the attacker-controlled value as an arithmetic expression. 4. A crafted expression using arithmetic expansion behavior can trigger command substitution. 5. The injected command executes with the operating-system privileges and environment of the user running the Skill script. ### Impact Assessment Successful exploitation permits arbitrary com ...[truncated 550 chars]
Remediation
View remediation
1000 )); then printf 'Usage: %s [count: 1-1000]\n' "$0" >&2 exit 2 fi ``` Use the explicit `-n` option and quote each resulting argument: ```bash tail -n "$((COUNT * 2))" ``` ```bash tail -n "$COUNT" ``` Additional hardening should include: - Enable strict shell behavior where compatible, such as `set -euo pipefail`. - Treat every command-line argument as untrusted input. - Avoid placing unvalidated input in Bash arithmetic contexts. - Add regression tests covering alphabetic input, negative values, oversized values, whitespace, shell metacharacters, arithmetic expressions, and option-like strings. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:75
Finding

Unrestricted Disclosure of Private Conversation Records

Content
View full analysis
/dev/null | tail -10 ``` Related session-file processing is also present in `scripts/session-stats.sh`: ```bash SESSIONS_JSON="$HOME/.clawdbot/agents/main/sessions/sessions.json" SESSION_DIR="$HOME/.clawdbot/agents/main/sessions" ``` ```bash CURRENT_SESSION=$(jq -r '."agent:main:main".sessionId // "unknown"' "$SESSIONS_JSON" 2>/dev/null) SESSION_FILE="$SESSION_DIR/$CURRENT_SESSION.jsonl" if [ -f "$SESSION_FILE" ]; then LINES=$(wc -l < "$SESSION_FILE") SIZE=$(du -h "$SESSION_FILE" | cut -f1) echo " File: $SESSION_FILE" echo " Size: $SIZE" echo " Messages: $LINES" echo "" echo "=== Recent Cost Summary (last 10 API calls) ===" tail -50 "$SESSION_FILE" | \ jq -r 'select(.message.role=="assistant" and .message.usage) | "\(.message.usage.totalTokens // 0) tokens, $\(.message.usage.cost.total // 0 | tostring[0:6])"' 2>/dev/null | \ tail -10 fi ``` ### Technical Analysis The diagnostic command documented in `SKILL.md` uses a wildcard to read every matching JSONL session file and emits recent user-message text. Raw conversation content is substantially more sensitive than the response-time, token-usage, cost, and service-status metadata required by the Skill's routine diagnostic functions. The wildcard is not restricted to the active session. Consequently, executing the documented command can combine records from multiple conversations and expose their contents in terminal output or the current agent context. No consent check, session selection, redaction, secret filtering, or output minimization is specified. The related statistics script demonstrates that session metadata and ...[truncated 1407 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly documents log and session sources that include full conversation history, token usage, costs, and session state, but it provides no privacy warning, access limitation, or guidance to minimize exposure. In a diagnostics skill, this makes accidental over-collection and disclosure of sensitive user content more likely, especially because operators may inspect or share these files during troubleshooting.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The provided command extracts recent user message text directly from session JSONL files, which can expose sensitive conversation content without any warning or consent check. Because this skill is specifically intended for diagnostics, operators may run it routinely, increasing the chance of unnecessary disclosure of private prompts, credentials, or personal data embedded in conversations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.