T09 · Insecure Skill Coding Practices
- Location
SKILL.md:11- Finding
Command Injection Risk Through Unquoted URL Interpolation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be a real video downloader, but it needs review because a normal download request can run local commands and automatically install unpinned software on the host.
Install only if you are comfortable with this skill running local commands, downloading media into your Downloads folder, and potentially changing your Python or system package environment. Prefer a version that requires yt-dlp and ffmpeg to be installed ahead of time, passes URLs as structured arguments, validates URLs, and asks before making host changes.
SKILL.md:11Command Injection Risk Through Unquoted URL Interpolation
scripts/main.py:49Automatic Installation of Unpinned Third-Party Dependencies
The declared purpose is only video downloading, but the detected behavior includes installing dependencies, writing to local Downloads, and modifying the host via external commands. This mismatch is dangerous because users and platform policy may not expect host changes or package installation, creating a path for unauthorized environment modification and broader system impact.
Executing pip, apt, brew, or choco from a skill materially increases the blast radius from content processing to host modification. In this context, a downloader does not need package-manager authority at runtime, so this is an unjustified and risky capability that could be abused to install software, alter packages, or fail unpredictably under elevated privileges.
The skill instructs use of an execution tool to run a local command, but it does not declare any explicit tool scope or permission boundary. This is dangerous because the agent may invoke shell-like capabilities without transparent authorization constraints, increasing the risk of unintended command execution or privilege misuse if the skill is triggered with untrusted input.
The skill description does not warn that downloading and merging videos will write files to the local filesystem. This is dangerous because users may unknowingly trigger persistent local changes, consume storage, or overwrite expected locations without informed consent.
The operational instructions are written as mandatory Chinese-language behavior and do not indicate that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the restriction is explicitly justified.
The skill tells the agent to execute a subprocess and return only its output, without warning the user that a local command will be run. This reduces transparency and can hide risky local execution from the user, especially when the command incorporates user-supplied URLs and may trigger additional behavior in the underlying script.
The manifest describes a downloader, but the implementation also installs and upgrades host dependencies. This capability expansion is security-relevant because users and platform operators may grant trust based on a narrower purpose while the code can change system state and reach package repositories.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 检查依赖是否存在
if pkg_name == "ffmpeg":
# ffmpeg 用 -version
subprocess.run([pkg_name, "-version"], check=True, capture_output=True, text=True)
else:
# 其他工具(如 yt-dlp)用 --version
subprocess.run([pkg_name, "--version"], check=True, capture_output=True, text=True)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
subprocess.run([pkg_name, "-version"], check=True, capture_output=True, text=True)
else:
# 其他工具(如 yt-dlp)用 --version
subprocess.run([pkg_name, "--version"], check=True, capture_output=True, text=True)
print(f"✅ {pkg_name} 已安装")
return True
except (subprocess.CalledProcessError, FileNotFoundError):
The script installs missing dependencies automatically after only printing status messages, with no interactive confirmation or explicit authorization boundary. That means a routine request to download a video can unexpectedly trigger software installation and system changes, increasing the chance of unauthorized modification or accidental execution in sensitive environments.
This code automatically executes package-manager installation commands on the host when dependencies are missing. That grants the skill the ability to modify the local system, install or upgrade software, and invoke privileged package managers without explicit user approval, which is dangerous well beyond simple video downloading.
print(f"❌ {pkg_name} 未安装,开始自动安装...")
try:
# 执行安装命令
subprocess.run(
install_cmd,
capture_output=True,
text=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"--quiet" # 减少输出,避免日志过长
]
try:
subprocess.run(
download_cmd,
capture_output=True,
text=True,
The script's docstrings, comments, argument descriptions, and runtime messages are consistently in Chinese, which imposes a specific language on users. There is no option to select another language or indication that the tool is intentionally limited to a Chinese-speaking audience.
No suspicious patterns detected.