T09 · Insecure Skill Coding Practices
- Location
scripts/scene-trigger.js:34- Finding
Shell Command Injection Through User-Editable Music Scene Configuration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill's music-and-email purpose is mostly coherent, but it uses unvalidated shell commands and persistent cron setup around editable configuration and SMTP credentials.
Review before installing. This skill needs SMTP credentials, can send recurring emails, can switch local music scenes, and can create cron-based persistence. Only use it from a trusted, non-shared directory; inspect and keep scripts/config.json writable only by trusted users; update nodemailer; and replace the shell command construction with argument-array execution before enabling scheduled jobs.
scripts/scene-trigger.js:34Shell Command Injection Through User-Editable Music Scene Configuration
scripts/setup-cron.js:18Command Injection Risk in Generated Cron Registration Commands
The skill claims automatic scheduling, music control, and IMAP/SMTP functionality, but the described implementation appears inconsistent and may require manual command-line arguments instead of the promised workflow. This discrepancy is dangerous because deceptive or inaccurate capability claims can hide what the skill actually does, undermining informed consent and making malicious substitutions harder to detect.
The skill claims automatic scheduling, music control, and IMAP/SMTP functionality, but the described implementation appears inconsistent and may require manual command-line arguments instead of the promised workflow. This discrepancy is dangerous because deceptive or inaccurate capability claims can hide what the skill actually does, undermining informed consent and making malicious substitutions harder to detect.
The lockfile pins nodemailer to 6.10.1, and the provided advisories indicate this version has multiple known security issues, including header injection, denial-of-service, and content access/bypass behaviors. In this skill's context, the package is directly relevant because the skill sends greeting emails, so vulnerable mail construction and parsing paths are more likely to be exercised and could enable message manipulation, abuse of outbound email behavior, or service disruption.
The dependency set permits resolution to nodemailer 6.10.1, which is reported as having multiple advisories including header injection, denial-of-service, and file-access bypass issues. This skill’s context makes the issue more dangerous because it explicitly sends greeting emails, so vulnerable mail construction and content handling paths are likely reachable in normal operation.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const path = require('path');
const fs = require('fs');
const nodemailer = require('nodemailer');
require('dotenv').config({ path: path.resolve(__dirname, '..', '.env') });
const config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json'), 'utf8'));
const template = fs.readFileSync(path.join(__dirname, '..', 'assets', 'email-template.html'), 'utf8');
The skill advertises behavior that clearly requires access to environment-based secrets such as SMTP credentials, but it does not declare any explicit tool scope or permissions. This weakens reviewability and sandbox enforcement, making it easier for a skill to access sensitive configuration without users understanding the full trust boundary.
The trigger phrases are generic and action-oriented, which increases the chance of accidental or overly broad invocation in unrelated contexts. Because the skill can send emails and potentially execute local commands, unintended triggering could cause unwanted outbound messages or local side effects.
This manifest file's description says the skill will 'Auto-switch music scenes by workday schedule with GIF greeting emails,' but it does not specify the activation conditions, scope, or limits of when the behavior runs. In a manifest context, this is vague enough to leave unclear what triggers the skill and when it should or should not act.
This manifest/config file contains a natural-language locale setting, cronTimezone: "Asia/Shanghai", that forces a specific regional timezone for all scheduled scenes. The file does not indicate user opt-in, configurability, or a region-specific justification, which creates a locale-policy concern under the rule for natural-language policy violations.
This script invokes shell commands with execSync using interpolated values from config and argv, which creates command-injection risk if scene names or related config entries are modified by an attacker. Although shelling out is functionally related to the stated workflow, using a shell is broader than necessary and materially increases risk because a compromised config.json or crafted scene value could lead to arbitrary local command execution.
Using a caret range for dotenv weakens build reproducibility and increases supply-chain risk because installs may pull different versions over time. There is no specific vulnerable dotenv version identified here, so the issue is hygiene-related rather than evidence of active compromise.
{"name": "workday-music-greet", "version": "1.0.0", "description": "Auto-switch music scenes by workday schedule with GIF greeting emails", "private": true, "dependencies": {"nodemailer": "^6.9.0", "dotenv": "^16.3.0"}}
Using a caret range for dotenv weakens build reproducibility and increases supply-chain risk because installs may pull different versions over time. There is no specific vulnerable dotenv version identified here, so the issue is hygiene-related rather than evidence of active compromise.
{"name": "workday-music-greet", "version": "1.0.0", "description": "Auto-switch music scenes by workday schedule with GIF greeting emails", "private": true, "dependencies": {"nodemailer": "^6.9.0", "dotenv": "^16.3.0"}}