Back to skill

Security audit

Exec Error Doctor

Security checks for vulnerabilities and agentic risk

Overview

The skill is disclosed and mostly diagnostic, but it includes an authenticated ClawHub publishing script that can change remote state and has unsafe temporary-file handling.

Review this skill before installing if you want a purely diagnostic helper. Use the triage and GitHub search scripts normally, but run the ClawHub publish wrapper only after explicitly deciding to publish under your account. Prefer adding a confirmation or dry-run gate and replacing the fixed /tmp files with mktemp or /dev/null.

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
scripts/clawhub_publish_safe.sh:35
Finding

Predictable Temporary Files Permit Symlink-Based File Overwrite

Content
View full analysis

Vulnerability Details

File Location: scripts/clawhub_publish_safe.sh, lines 35–36
Vulnerability Type: Insecure temporary-file handling
Risk Level: Medium

Vulnerable Code

bash
if ! clawhub whoami >/tmp/clawhub_publish_whoami.out 2>/tmp/clawhub_publish_whoami.err; then
  echo "ERROR: Not logged in. Run: clawhub login --token <clh_token>" >&2

Technical Analysis

The script redirects standard output and standard error to fixed, globally predictable paths under /tmp. It neither creates these files securely nor verifies that they are regular files rather than symbolic links.

On systems where /tmp is shared among users, a local attacker can create either expected path as a symbolic link before the wrapper runs. Shell redirection occurs before clawhub whoami executes and follows symbolic links, so the linked destination is opened with truncation enabled.

The files are also not deleted after execution. Consequently, output from clawhub whoami or related diagnostics may remain accessible according to the process umask and filesystem permissions.

Attack Path

  1. A local attacker predicts the fixed paths:
    • /tmp/clawhub_publish_whoami.out
    • /tmp/clawhub_publish_whoami.err
  2. The attacker creates one of these paths as a symbolic link to a file writable by the victim account.
  3. The victim invokes scripts/clawhub_publish_safe.sh.
  4. During shell redirection, the victim process follows the attacker-controlled symbolic link.
  5. The target file is truncated and receives output from clawhub whoami.
  6. Depending on the selected target and victim privileges, this can corrupt user or system data and cause denial of service.

Impact Assessment

Successful exploitation does not directly grant new privileges, but it allows an attacker to misuse the invoking account’s existing file-write permissions. The scope is limited to files writable by that account. If the script is run by a privileged user, the impact may exte ...[truncated 233 chars]

Remediation
View remediation

Remediation Suggestions

If the command output is unnecessary, avoid temporary files:

bash
if ! clawhub whoami >/dev/null 2>&1; then
  echo "ERROR: Not logged in. Run: clawhub login --token &lt;clh_token&gt;" >&2
  exit 4
fi

If diagnostic output must be retained:

  1. Create a private temporary directory with mktemp -d.
  2. Apply restrictive permissions with umask 077.
  3. Store output only inside that directory.
  4. Register a cleanup trap to remove it on every exit path.
  5. Quote all generated paths.

Example:

bash
umask 077
TMP_DIR="$(mktemp -d)" || exit 1
trap 'rm -rf -- "$TMP_DIR"' EXIT

if ! clawhub whoami >"$TMP_DIR/whoami.out" 2>"$TMP_DIR/whoami.err"; then
  cat "$TMP_DIR/whoami.err" >&2
  echo "ERROR: Not logged in. Run: clawhub login --token &lt;clh_token&gt;" >&2
  exit 4
fi

Avoid fixed names in shared temporary directories and do not attempt to repair this solely with a pre-execution existence check, because that would remain susceptible to time-of-check/time-of-use races.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a diagnostic helper, but its documented workflow includes operational commands that can publish a skill to ClawHub and poll remote service state. That mismatch is security-relevant because a user or orchestrator may invoke it expecting read-only triage, while it can trigger authenticated network actions and modify remote state, increasing the chance of unintended changes or credential-scoped side effects.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill is presented as a diagnostic helper, but its documented workflow includes operational commands that can publish a skill to ClawHub and poll remote service state. That mismatch is security-relevant because a user or orchestrator may invoke it expecting read-only triage, while it can trigger authenticated network actions and modify remote state, increasing the chance of unintended changes or credential-scoped side effects.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 13)May include surrounding context.

md
- `scripts/exec_error_triage.sh <error_text_or_file>`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 25)May include surrounding context.

md
- `scripts/exec_error_triage.sh <error_text_or_file>`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 50)May include surrounding context.

md
- `scripts/exec_error_triage.sh <error_text_or_file>`

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script checks authentication and then uses that session to publish a skill remotely, giving the skill an unnecessary capability for its stated diagnostic role. In context, this is dangerous because an exec-error triage skill should not need to modify remote resources; a user may grant trust for debugging and unknowingly enable deployment actions to a third-party service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script performs a remote publication action to ClawHub, which is outside the declared purpose of an exec-error diagnosis/mitigation skill. That mismatch increases the chance that users invoke the skill expecting local troubleshooting but instead trigger an external state-changing operation that publishes content under their authenticated account.

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 · scripts/exec_error_triage.sh (reported line 59)May include surrounding context.

sh
fi

if grep -qiE 'permission denied|eacces|operation not permitted' <<<"$LOWER"; then
  emit "permission-error" "high" "Insufficient file/system permissions." "Fix ownership/permissions/executable bit for target files; avoid broad sudo unless required."
fi

if grep -qiE 'timed out|timeout|code 124|deadline exceeded' <<<"$LOWER"; then