T09 · Insecure Skill Coding Practices
- Location
scripts/analyzer.cjs:280- Finding
Arbitrary OS Command Execution Through Unescaped Log Content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This log analyzer has a coherent purpose, but it can automatically send raw operational logs to a fixed Discord channel and contains a command-injection flaw.
Review this carefully before installing. Only use it after removing the hard-coded Discord destination, making external notifications opt-in, limiting log sources to paths you choose, adding secret redaction, and replacing shell-string execSync with an argument-based command or API call.
scripts/analyzer.cjs:280Arbitrary OS Command Execution Through Unescaped Log Content
scripts/analyzer.cjs:280Automatic Disclosure of Raw Operational Data to a Hard-Coded Discord Recipient
scripts/analyzer.cjs:18Overbroad User-Specific Filesystem Collection Combined with Recurring Execution
The skill explicitly states that reports are pushed to Discord, but it does not warn users that log-derived data may leave the local system and be sent to a third-party service. Because logs can contain stack traces, hostnames, file paths, tokens, or other sensitive operational data, this omission creates a real data-exposure risk rather than a purely documentation issue.
The skill documents monitoring of system logs and application logs, including user behavior, without any privacy notice, scoping limits, or minimization guidance. This is dangerous because such logs may contain sensitive personal data, authentication artifacts, operational secrets, and behavioral telemetry, and the skill encourages broad collection without informing the user of those implications.
The cron invocation message explicitly says "报告格式用中文," which forces report output to Chinese. Under the language/locale policy, a skill should not impose a specific language unless the user opts in or the locale constraint is clearly documented and justified.
The generated report can include raw log contents and cron job error details, and the script automatically transmits that data to Discord. Logs frequently contain secrets, internal paths, tokens, stack traces, or personal data, so sending them to an external service without explicit consent, redaction, or classification controls creates a real data-exfiltration/privacy risk.
The script invokes execSync with a shell command that embeds report content directly into the command line. Because the report includes untrusted log lines and task error text, a crafted quote or shell metacharacter in those inputs can break out of the intended argument and trigger command injection, while also granting broader external-command capability than needed for simple notification delivery.
This JSON manifest contains multiple natural-language description values in Chinese, such as at L07, L13, L19, L27, L33, and L41, but the file does not indicate that the skill is Chinese-only or region-specific. Under the policy, forcing a specific language without user opt-in or documented justification is a natural-language policy concern.
The manifest says the tool supports automatic error detection, log aggregation, and Discord notifications. In the implementation, log handling is limited to enumerating .log files from one hard-coded local directory and analyzing them individually; there is no evident cross-source collection or aggregation mechanism beyond simple per-run scanning.
The report timestamp is generated with a fixed 'zh-CN' locale and 'Asia/Shanghai' timezone, which imposes a specific language/locale behavior regardless of user preference. The file does not provide opt-in, configurability, or a documented regional justification for this constraint.
Detected: suspicious.dangerous_exec