Back to skill

Security audit

Buddy Followup

Security checks for vulnerabilities and agentic risk

Overview

This follow-up timer skill does what it advertises, but its scheduler has a real command-injection bug and can automatically broadcast saved task context to every configured channel.

Review before installing. Use only simple delay values like 30s, 5m, or 2h, avoid putting secrets or private project details in the task context, and be aware that follow-ups may go to every configured messaging channel. Prefer a pinned, verified install command and a hardened delay parser before relying on this in sensitive environments.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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/followup.sh:11
Finding

Command Execution Through Unsafe Delay Arithmetic Evaluation

Content
View full analysis

Vulnerability Details

File Location: scripts/followup.sh, lines 11–22
Vulnerability Type: Shell command injection through arithmetic expansion
Risk Level: High

Vulnerable Code:

bash
# Parse delay to seconds
parse_seconds() {
  local d="$1"
  if [[ "$d" =~ ^([0-9]+)s$ ]]; then echo "${BASH_REMATCH[1]}"
  elif [[ "$d" =~ ^([0-9]+)m$ ]]; then echo $(( BASH_REMATCH[1] * 60 ))
  elif [[ "$d" =~ ^([0-9]+)h$ ]]; then echo $(( BASH_REMATCH[1] * 3600 ))
  else echo "$d"
  fi
}
SECS=$(parse_seconds "$DELAY")
AT=$(date -u -d "@$(( $(date +%s) + SECS ))" +"%Y-%m-%dT%H:%M:%SZ")

Technical Analysis

The parser accepts recognized values such as 30s, 5m, and 2h, but returns unrecognized input unchanged. That attacker-controlled result is subsequently referenced inside Bash arithmetic expansion.

Bash arithmetic expressions recursively interpret variable values as arithmetic syntax. In particular, crafted array-subscript expressions may cause embedded command substitutions to be evaluated. Quoting the original script argument does not make its later use in an arithmetic context safe.

The vulnerable behavior can be avoided only by rejecting invalid input rather than returning it for arithmetic evaluation.

Attack Path

  1. An attacker gains control over, or influences, the first argument passed to followup.sh.
  2. The attacker supplies a quoted malformed delay containing arithmetic syntax and command substitution, such as:
    bash
    bash scripts/followup.sh 'x[$(touch /tmp/pwn)0]' 'task'
    
  3. The value does not match any supported delay expression, so parse_seconds returns it unchanged.
  4. The value is assigned to SECS.
  5. Bash evaluates SECS as part of $(( $(date +%s) + SECS )).
  6. The embedded command substitution executes with the privileges of the process running the Skill.

Impact Assessment

Successful exploitation permits arbitrary local comman ...[truncated 537 chars]

Remediation
View remediation

Remediation Suggestions

  • Reject every delay that does not exactly match an approved format.
  • Convert only the numeric regular-expression capture to seconds.
  • Verify that the converted result consists exclusively of decimal digits before using it in arithmetic.
  • Apply reasonable upper and lower bounds to prevent immediate or excessively distant schedules.
  • Return a nonzero exit status for malformed input instead of echoing it.
  • Avoid evaluating any user-controlled string as a Bash arithmetic expression.

Example hardened implementation:

bash
parse_seconds() {
  local d="$1"
  local number unit

  if [[ ! "$d" =~ ^([0-9]+)([smh])$ ]]; then
    printf 'Invalid delay: %s\n' "$d" >&2
    return 1
  fi

  number="${BASH_REMATCH[1]}"
  unit="${BASH_REMATCH[2]}"

  case "$unit" in
    s) printf '%d\n' "$number" ;;
    m) printf '%d\n' "$((10#$number * 60))" ;;
    h) printf '%d\n' "$((10#$number * 3600))" ;;
  esac
}

SECS="$(parse_seconds "$DELAY")" || exit 2
[[ "$SECS" =~ ^[0-9]+$ ]] || exit 2
AT="$(date -u -d "@$(( $(date +%s) + 10#$SECS ))" +"%Y-%m-%dT%H:%M:%SZ")"

Add regression tests covering valid delays, malformed units, whitespace, signs, arithmetic operators, array syntax, and command substitutions.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:23
Finding

Unpinned Package Execution in Installation Instructions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 23–27
Vulnerability Type: Unpinned executable dependency and mutable installation source
Risk Level: Medium

Vulnerable Code:

markdown
## Installation

Via ClawHub (recommended):
```bash
npx clawhub install buddy-followup
text

### Technical Analysis

The documented installation command invokes `clawhub` through `npx` without specifying a package version or integrity value. If the package is not already available locally, `npx` may resolve and execute a mutable release from the configured npm registry.

The `buddy-followup` Skill release is also installed without an explicit version. Consequently, both the installer and installed artifact can differ from the versions reviewed during this audit. This creates a supply-chain trust gap: compromise of the package publisher, registry, distribution account, or mutable latest release could cause users to execute unreviewed code.

No malicious dependency or active compromise was observed in the audited files. The issue is the unsafe, non-reproducible installation procedure.

### Attack Path

1. A user follows the installation instructions in `SKILL.md`.
2. `npx` resolves the unpinned `clawhub` package using the configured registry.
3. A compromised publisher or registry serves a malicious or unexpectedly changed latest package release.
4. `npx` downloads and executes that package in the user’s environment.
5. The installer may then retrieve an unpinned `buddy-followup` release that differs from the audited artifact.

### Impact Assessment

A compromised installer executes with the privileges of the user performing installation. It could read user-accessible credentials and configuration, modify files, install altered Skills, or run additional commands.

The impact may extend to OpenClaw data and messaging configuration available to that user. This finding does not demonstrate current compromise 
...[truncated 102 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the clawhub CLI to a reviewed, trusted version rather than allowing mutable latest-version resolution.
  • Pin the buddy-followup Skill version to the specific audited release.
  • Use package-lock or integrity verification mechanisms where supported.
  • Document the expected registry and trusted package publisher.
  • Prefer a previously installed and verified CLI over downloading executable code during installation.
  • Where operationally feasible, use offline installation or a controlled internal package mirror.

A safer documented command should use explicit reviewed versions, for example:

bash
npx --yes clawhub@<reviewed-version> install buddy-followup@1.0.0

The exact syntax should be validated against the supported ClawHub CLI interface. If supported, include a checksum or signature-verification step for the downloaded Skill artifact.

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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly states that follow-up messages wake up and deliver the original task context on every configured channel, but it does not warn that this can broadcast potentially sensitive operational context across multiple endpoints. In a multi-channel setup, private task details, internal URLs, deployment notes, or user data could be disclosed more broadly than intended.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The usage and follow-up sections instruct the agent to pass raw task context into a scheduling script and note that timers create cron jobs and later send follow-up messages automatically, but they omit a safety warning about persistence and automatic disclosure. This increases the chance that secrets, internal project details, or personal data are stored in cron entries and later emitted to configured channels without review.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.