T09 · Insecure Skill Coding Practices
- Location
scripts/translate.py:111- Finding
Command and Python Code Injection Through Unsanitized Path Interpolation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a Linux command helper, but it can produce unsafe copy-paste commands that modify files or allow command injection if generated output is executed.
Review generated commands manually before running them, especially when prompts or filenames may come from someone else. Do not feed this skill's output directly into an executor, and require dry runs, backups, constrained paths, and explicit confirmation before file writes, batch renames, recursive edits, or package installs.
scripts/translate.py:111Command and Python Code Injection Through Unsanitized Path Interpolation
Without declared permissions the skill's intent is opaque and cannot be validated.
The trigger patterns are broad enough to activate on many ordinary user requests, which can cause this skill to be selected in contexts where direct system-command generation is unsafe or inappropriate. In an agentic environment, overbroad activation increases the chance of producing shell commands for ambiguous tasks, including commands that touch files or system state without sufficient safety review.
The activation guidance uses vague criteria like 'system first' and 'minimize AI inference,' which favor command generation before safety or contextual validation. That ambiguity can cause the skill to activate for tasks that involve sensitive files, privileged operations, or security-relevant changes where human confirmation should come first.
The skill recommends in-place text replacement (sed -i) as a normal solution without a safety warning, backup advice, or confirmation step. That is dangerous because a copied command can irreversibly modify files, and in an automated or semi-automated agent setting this can lead to unintended data corruption at scale.
The batch rename examples include executable rename commands that can affect many files and are not easily reversible if naming collisions or pattern mistakes occur. Although a dry run is shown in one example, the skill lacks a broader safety rule requiring confirmation, backup strategy, or collision checks before bulk renames.
The multi-file in-place replacement examples combine file selection with sed -i, enabling bulk destructive edits across many matching files without explicit warnings. In context, this skill is designed to optimize system-level actions, so omission of safeguards is more dangerous because users may trust and paste commands that silently alter large sets of files.
The skill emits destructive commands that modify files in place without any user-facing warning, dry-run behavior, or confirmation requirement. In the context of an agent skill that converts natural language to commands, this increases the chance that a user or downstream automation will execute a harmful modification believing it to be a routine text-processing action.
The skill generates destructive file-modification commands such as sed -i and Python code that overwrites the target file in place, but it presents itself as a general task-to-command translator without safety gating. In an agent setting, this can cause unintended data loss or unauthorized modification if natural-language input is translated and later executed without explicit confirmation.
The package installation examples modify system state and may require elevated privileges, but they are presented as routine prerequisites without warning. This is lower severity than file-destruction cases, yet it can still lead users to change environments unexpectedly, especially in production, containers, or restricted hosts.
The module docstring states it translates natural language to optimal Linux/Python commands, which imposes a specific platform choice in natural-language behavior. The file does not offer user opt-in, alternative locales/platforms, or a documented reason for this constraint.
For file type detection, the skill's Python output uses subprocess.run(['file', '{file}']) instead of a direct Python-only implementation. Given the stated purpose is to translate tasks into optimal Linux/Python commands for file and text processing, embedding subprocess orchestration inside the Python variant is an unjustified extra capability rather than a direct requirement.
No suspicious patterns detected.