Back to skill

Security audit

Workday Music Greeter

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its advertised automation, but unsafe shell scripting and persistent cron scheduling create recurring user-level command-execution risk from editable configuration.

Install only if you are comfortable with recurring weekday cron jobs under your user account. Before use, remove eval-style command execution, avoid sourcing .env as shell code, restrict .env permissions, verify the SMTP helper path, and add a clear way to uninstall the cron entries.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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 (3)

T06 · System Persistence

Warning
Location
install-cron.sh:18
Finding

Persistent weekday execution through user crontab modification

Content
View full analysis
> /tmp/wmg.log 2>&1 0 12 * * 1-5 ${LOAD_ENV}"$RUN" chill >> /tmp/wmg.log 2>&1 0 14 * * 1-5 ${LOAD_ENV}"$RUN" focus >> /tmp/wmg.log 2>&1 0 18 * * 1-5 ${LOAD_ENV}"$RUN" off >> /tmp/wmg.log 2>&1 $END CRON current="$(crontab -l 2>/dev/null || true)" cleaned="$(printf '%s\n' "$current" | sed "/$MARKER/,/$END/d")" printf '%s\n%s\n' "$cleaned" "$BLOCK" | sed '/^$/N;/^\n$/D' | crontab - ``` ### Technical Analysis The installer modifies the current operating-system user's crontab and registers four recurring weekday jobs. These jobs survive completion of the installer, terminal sessions, and system restarts, and therefore constitute system persistence. Scheduling is explicitly disclosed in `SKILL.md`, is installed only when the user invokes `install-cron.sh`, and directly supports the declared weekday-automation feature. The mechanism therefore has a legitimate functional purpose. It also operates in the user crontab rather than requesting administrator privileges, which limits its privilege scope. Nevertheless, the persistent jobs repeatedly execute files from the Skill directory and source environment configuration. If the Skill directory, `run.sh`, `.env`, or a resolved dependency is later modified, the modified content will be executed automatically. The installer provides no ownership, permission, or integrity checks and does not include a corresponding uninstall operation. ### Attack Path 1. The user invokes `install-cron.sh`. 2. The script adds four persistent entries to the user's crontab. 3. An attacker who can subsequently modify `run.sh`, `.env`, or an invoked dependency places malicious commands in that component. 4. At the next configured weekday time, cron invokes the ...[truncated 739 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
run.sh:35
Finding

Arbitrary command execution through string-built commands and eval

Content
View full analysis
$SCENE" run "\"$HOME_MUSIC_BIN\" \"$SCENE\"" fi ``` ```bash ATTACH_ARG="" [[ -n "$GIF_FILE" ]] && ATTACH_ARG="--attach \"$GIF_FILE\"" if [[ "$DRY_RUN" != "1" && ! -f "$SMTP_SCRIPT" ]]; then warn "smtp script not found at $SMTP_SCRIPT; cannot send email." else log "sending greeting email -> $WMG_MAIL_TO" run "node \"$SMTP_SCRIPT\" send --to \"$WMG_MAIL_TO\" --subject \"$SUBJECT\" --html-file \"$HTML_FILE\" $ATTACH_ARG" fi ``` ### Technical Analysis The `run` function accepts a command represented as a string and passes it to `eval`. `eval` causes the shell to parse the assembled text a second time. Consequently, quoting applied while constructing the string does not safely preserve argument boundaries when an interpolated value contains quotes, command substitutions, redirection operators, semicolons, or other shell syntax. Potentially attacker-influenced values reaching these command strings include: - `WMG_MAIL_TO` from the environment or `.env` - `WMG_SMTP_SCRIPT` from the environment or `.env` - `SUBJECT` and scene data from `scenes.conf` - `GIF_FILE`, selected from filenames produced or found in GIF directories - `HOME_MUSIC_BIN`, resolved through `PATH` or a fallback path - `SCENE`, supplied as a command-line argument For example, a malicious recipient value that terminates the intended quoted argument and adds a shell command will become executa ...[truncated 1420 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
install-cron.sh:13
Finding

Credential configuration file is sourced as executable shell code

Content
View full analysis
>> workday-music-greeter >>>" END="# <<< workday-music-greeter <<<" LOAD_ENV="" [[ -f "$ENV_FILE" ]] && LOAD_ENV="set -a; . '$ENV_FILE'; set +a; " # minute hour * * 1-5 (Mon–Fri). Cols: scene at its hour-start. read -r -d '' BLOCK <> /tmp/wmg.log 2>&1 0 12 * * 1-5 ${LOAD_ENV}"$RUN" chill >> /tmp/wmg.log 2>&1 0 14 * * 1-5 ${LOAD_ENV}"$RUN" focus >> /tmp/wmg.log 2>&1 0 18 * * 1-5 ${LOAD_ENV}"$RUN" off >> /tmp/wmg.log 2>&1 $END CRON ``` ### Technical Analysis The generated cron entries use the shell `.` command to source `.env`. Sourcing does not merely load variable assignments: it parses and executes the entire file as shell code. Any command substitution, function definition, redirection, or standalone command placed in `.env` therefore executes before every scheduled invocation of `run.sh`. The file is intended to contain recipient information and SMTP credentials. Treating a credential/configuration file as executable code violates the separation between data and instructions. The installer checks only whether `.env` exists; it does not verify that it is a regular file, that it is owned by the current user, or that its permissions prevent modification or disclosure by other local users. ### Attack Path 1. The user installs the cron entries while a `.env` file exists. 2. An attacker with write access to `.env`, its containing directory, or a symlink target adds a shell command to the file. 3. At the next configured weekday time, cron executes the generated command. 4. The cron shell sources `.env`. 5. The attacker's command runs before `run.sh`, with the permissions and environment of the user who owns the crontab. 6. The malicious command continues to run at ...[truncated 608 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

Quick start

bash
cp .env.example .env && $EDITOR .env      # set WMG_MAIL_TO + SMTP_* creds
WMG_MAIL_TO=you@example.com ./run.sh morning --dry-run   # preview, touches nothing
WMG_MAIL_TO=you@example.com ./run.sh auto                # pick scene by current time
./install-cron.sh                          # schedule Mon–Fri

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./install-cron.sh # schedule Mon–Fri

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./install-cron.sh # schedule Mon–Fri

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
./install-cron.sh # schedule Mon–Fri

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · install-cron.sh (reported line 12)May include surrounding context.

sh
set -euo pipefail
SKILL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RUN="$SKILL_DIR/run.sh"
ENV_FILE="$SKILL_DIR/.env"
MARKER="# >>> workday-music-greeter >>>"
END="# <<< workday-music-greeter <<<"

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

This script installs persistent weekday cron entries that repeatedly execute the skill, which is a persistence mechanism even if used here for declared automation purposes. In the context of an agent skill, unattended scheduled execution increases risk because any unsafe behavior in run.sh will continue automatically and repeatedly without additional user approval.

Content

Scanner excerpt · install-cron.sh (reported line 29)May include surrounding context.

sh
$END
CRON

current="$(crontab -l 2>/dev/null || true)"
cleaned="$(printf '%s\n' "$current" | sed "/$MARKER/,/$END/d")"
printf '%s\n%s\n' "$cleaned" "$BLOCK" | sed '/^$/N;/^\n$/D' | crontab -
echo "Installed weekday cron entries. View with: crontab -l"

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

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.

Content

Scanner excerpt · install-cron.sh (reported line 32)May include surrounding context.

sh
current="$(crontab -l 2>/dev/null || true)"
cleaned="$(printf '%s\n' "$current" | sed "/$MARKER/,/$END/d")"
printf '%s\n%s\n' "$cleaned" "$BLOCK" | sed '/^$/N;/^\n$/D' | crontab -
echo "Installed weekday cron entries. View with: crontab -l"

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The manifest says this skill switches a music scene, fetches a GIF, and sends a greeting email, but the implementation delegates email sending to an arbitrary external script path via WMG_SMTP_SCRIPT or a sibling skill directory. That introduces a general code-execution/integration capability beyond the narrowly described workflow, because the actual behavior depends on whatever smtp.js does rather than a self-contained mail send step.

Content

No source excerpt is available for this finding.