Back to skill

Security audit

Workday Music Greeting

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated email-and-music automation purpose, but its music-command configuration can execute arbitrary shell commands and scheduled runs can perform real side effects automatically.

Review before installing. Only use this under a low-privilege account, keep .env protected, avoid setting MUSIC_CMD from untrusted input, and do not enable cron until the music command is changed to a fixed allowlisted executable with non-shell arguments. Also update the mail dependency before using it for real SMTP credentials.

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

Error
Location
scripts/workday-greeting.js:45
Finding

OS Command Injection Through the MUSIC_CMD Environment Variable

Content
View full analysis

Vulnerability Details

File Location: scripts/workday-greeting.js, lines 45–47
Vulnerability Type: OS command injection
Risk Level: High

Vulnerable Code:

js
const cmd = process.env.MUSIC_CMD || 'home-music';
try {
  execSync(`${cmd} ${slot}`, { stdio: 'inherit', timeout: 15000 });

Technical Analysis

The application reads MUSIC_CMD from the process environment or the project-level .env file and interpolates it directly into a string passed to child_process.execSync().

execSync() executes its string argument through a command shell. Consequently, shell metacharacters and additional commands contained in MUSIC_CMD are interpreted by the shell rather than treated as part of a literal executable path. No allowlist, executable-path validation, or shell-character rejection is performed.

This allows a party who can influence the runtime environment, deployment configuration, or project .env file to turn the documented music-scene operation into arbitrary command execution. The 15-second timeout limits execution duration but does not prevent commands from reading data, modifying files, starting detached processes, or making network connections.

Attack Path

  1. An attacker gains the ability to modify the Skill's .env file or supply environment variables to its runtime, such as through an insecure deployment configuration or automation interface.
  2. The attacker sets MUSIC_CMD to a value containing the expected command followed by shell syntax and an additional operating-system command.
  3. A user or scheduled job invokes node scripts/workday-greeting.js.
  4. Unless --email-only or --dry-run is used, switchScene() constructs a shell command by concatenating the malicious MUSIC_CMD value with the selected slot.
  5. execSync() passes the resulting string to a shell, which executes the injected command with the privileges of the Node.js process.

Impact Assessment

...[truncated 723 chars]

Remediation
View remediation

Remediation Suggestions

Replace shell-based execution with execFileSync() or spawnSync() using separate arguments:

js
const { execFileSync } = require('child_process');

function switchScene(slot) {
  const allowedSlots = new Set([
    'morning',
    'focus',
    'working',
    'chill',
    'off',
  ]);

  if (!allowedSlots.has(slot)) {
    throw new Error(`Invalid music slot: ${slot}`);
  }

  const allowedCommands = new Map([
    ['home-music', '/usr/local/bin/home-music'],
  ]);

  const configuredCommand = process.env.MUSIC_CMD || 'home-music';
  const executable = allowedCommands.get(configuredCommand);

  if (!executable) {
    throw new Error('MUSIC_CMD is not an approved executable');
  }

  execFileSync(executable, [slot], {
    stdio: 'inherit',
    timeout: 15000,
    shell: false,
  });
}

Additional hardening measures:

  1. Restrict the executable to an explicit allowlist and preferably resolve it to a trusted absolute path.
  2. Never accept command-line flags, arguments, or shell fragments through MUSIC_CMD.
  3. Validate forced slot values against the known greeting and scene names before accessing or executing them.
  4. Protect .env and scheduler configuration with restrictive file permissions and trusted ownership.
  5. Run the automation under a dedicated least-privileged account without administrative permissions.
  6. Keep shell: false explicit when using process-spawning APIs and pass every argument as a separate array element.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This mismatch is security-relevant because the skill appears to send email without declared permissions and execute a shell command via home-music or MUSIC_CMD, while presenting itself as a simple automation. Hidden or under-declared command execution is particularly dangerous because an attacker or misconfiguration could redirect MUSIC_CMD to an unintended program.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This mismatch is security-relevant because the skill appears to send email without declared permissions and execute a shell command via home-music or MUSIC_CMD, while presenting itself as a simple automation. Hidden or under-declared command execution is particularly dangerous because an attacker or misconfiguration could redirect MUSIC_CMD to an unintended program.

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 44)May include surrounding context.

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/workday-greeting.js

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| Email not sending | Check `.env` SMTP credentials; test with `node scripts/send-greeting.js --test` |

Known Vulnerable Dependency: nodemailer==6.10.1 — 12 advisory(ies): CVE-2026-82661 (Nodemailer: CRLF injection in Nodemailer List-* header comments allows arbitrary); GHSA-2x7j-588g-ccc2 (Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote den); GHSA-8m3c-c648-2xjj (Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disable) +9 more

High
Category
Supply Chain
Confidence
96% confidence
Finding

The lockfile pins nodemailer to 6.10.1, and the supplied advisory list indicates this version has multiple known security issues, including header injection, denial of service, and content/file access bypass classes of flaws. In this skill’s context, the dependency is not incidental: the skill explicitly sends greeting emails, so vulnerable mail-construction and content-resolution paths are directly relevant and increase the likelihood of exploitable impact.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nodemailer==6.10.1 — 12 advisory(ies): CVE-2026-82661 (Nodemailer: CRLF injection in Nodemailer List-* header comments allows arbitrary); GHSA-2x7j-588g-ccc2 (Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote den); GHSA-8m3c-c648-2xjj (Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disable) +9 more

High
Category
Supply Chain
Confidence
98% confidence
Finding

The package resolves to nodemailer 6.10.1, which is flagged with multiple known advisories including header injection and denial-of-service issues. In this skill's context, Nodemailer is directly relevant because the automation sends greeting emails, so vulnerable mail-handling code is on an exposed execution path rather than being merely incidental.

Content

No source excerpt is available for this finding.

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 · scripts/workday-greeting.js (reported line 7)May include surrounding context.

js
const path = require('path');
const { execSync } = require('child_process');

// Load .env if present
try { require('dotenv').config({ path: path.resolve(__dirname, '..', '.env') }); } catch {}

const slots = require('./slots.json');

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 · scripts/send-greeting.js (reported line 12)May include surrounding context.

js
const { execSync } = require('child_process');

// Load .env if present
try { require('dotenv').config({ path: path.resolve(__dirname, '..', '.env') }); } catch {}

const slots = require('./slots.json');
const gifs = require('./gifs.json');

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 · scripts/workday-greeting.js (reported line 8)May include surrounding context.

js
const { execSync } = require('child_process');

// Load .env if present
try { require('dotenv').config({ path: path.resolve(__dirname, '..', '.env') }); } catch {}

const slots = require('./slots.json');
const gifs = require('./gifs.json');

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents use of environment variables for SMTP credentials and an external command for music control, but it does not declare any explicit tool scope or permissions. This weakens review and enforcement boundaries, increasing the chance that a skill with email-sending and command-execution behavior runs with broader access than users expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The cron automation examples emphasize convenience but do not clearly warn that scheduled runs will automatically send outbound emails and change music scenes without interactive confirmation. In an automation context, undisclosed autonomous side effects can lead to spam, privacy issues, or unwanted actions recurring until noticed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code sends an outbound email using SMTP, which is a network operation that transmits recipient and message data. Although the file has a brief usage comment and success log, it does not disclose before execution that running the script will send a real email to the configured recipient.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script builds a shell command with an untrusted environment variable and executes it via execSync, allowing arbitrary command execution if MUSIC_CMD is modified. In this skill’s context, the stated purpose is only to switch a music scene, so exposing unrestricted shell execution is far broader than necessary and could lead to full host compromise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example cron payload sets the schedule timezone to Asia/Shanghai, which imposes a locale-specific default in natural-language/config guidance. The file does not offer an opt-in choice or explain why that region is required, so it may violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

The dependency uses a caret range, which permits automatic installation of newer minor/patch releases instead of an exact reviewed version. In a skill that sends email, this weakens supply-chain control and can unexpectedly pull in a vulnerable or behavior-changing release.

Content

Scanner excerpt · package.json (reported line 11)May include surrounding context.

json
"test": "node scripts/workday-greeting.js --dry-run"
  },
  "dependencies": {
    "nodemailer": "^6.9.0",
    "dotenv": "^16.3.0"
  },
  "license": "MIT"

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The dotenv dependency is also specified with a caret range, so builds are not fully reproducible and may consume unreviewed updates. While lower risk than a network-facing library, it still increases supply-chain exposure and complicates auditability.

Content

Scanner excerpt · package.json (reported line 12)May include surrounding context.

json
},
  "dependencies": {
    "nodemailer": "^6.9.0",
    "dotenv": "^16.3.0"
  },
  "license": "MIT"
}