T09 · Insecure Skill Coding Practices
- Location
scripts/transcribe_collection.py:122- Finding
Arbitrary Python Code Execution Through an Untrusted Video Identifier
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to be a legitimate media transcription pipeline, but its transcription script has unsafe handling of video IDs that could let a crafted collection file run Python code or delete files outside the intended temp directory.
Review before installing. Only run this on collection JSON files you generated yourself or have inspected, use a dedicated temp/output directory, and avoid processing sensitive transcripts through remote LLM APIs unless you understand where the text is sent. The code should validate video IDs, remove python -c interpolation, confine generated paths, and delete only exact files it created.
scripts/transcribe_collection.py:122Arbitrary Python Code Execution Through an Untrusted Video Identifier
scripts/transcribe_collection.py:143Path Traversal and Arbitrary File Deletion Through Unvalidated Video Identifiers
requirements.txt:1Non-Reproducible Installation Through Unpinned Python Dependencies
The README states that LLM post-processing can use DeepSeek/OpenAI/LM Studio but does not warn that transcript contents may be transmitted to third-party services. Because transcripts can contain sensitive, copyrighted, private, or regulated content, users may unknowingly exfiltrate data outside their environment when enabling this optional feature.
The supplied script's real function is narrow: it detects whether the input is a Bilibili or YouTube URL, queries Bilibili APIs or invokes yt-dlp in flat-playlist metadata mode, builds a list of videos with titles/durations/URLs, prints a summary, and writes the result to a JSON file. The declared description describes a larger end-to-end transcription workflow including downloading videos, transcribing with Whisper, semantic chunking, and Markdown output. None of those later stages appear in this code chunk. The only overlap is the initial '拉取列表' step. Because the declared purpose presents the skill as a batch transcription pipeline while the code here only implements playlist/collection fetching, this is a material description-behavior mismatch.
The code substantially matches the core batch transcription workflow for Bilibili/YouTube collections: it downloads content, extracts audio, transcribes with Whisper, and saves Markdown outputs. However, the declared description explicitly says '拉取列表→下载→Whisper转录→语义分段→Markdown'. In this code chunk, list fetching is not present; instead it consumes an existing JSON file generated elsewhere. More importantly, there is no semantic segmentation stage: the script simply concatenates Whisper segment text and writes it directly to .txt/.md without topic segmentation or structured chunking. No obvious unrelated or risky undeclared capabilities are present beyond normal subprocess use for yt-dlp/ffmpeg/you-get.
This markdown file documents bulk download, audio extraction, transcription, and archive generation, which will create files and consume local storage, but it does not include any caution about disk usage, overwriting/creating output directories, or handling downloaded content. Under the markdown-specific warning rule, descriptions of behaviors affecting user data or system integrity should disclose these effects.
The skill advertises and requires behaviors that imply shell execution, network access, and filesystem reads/writes, but it does not declare any explicit tool scope or allowed-tools boundary. This is dangerous because an agent may grant broader-than-necessary capabilities to fetch remote media and write many files without clear user-visible permission constraints, increasing the chance of unintended downloads, overwrites, or command execution.
The skill does not clearly warn that running it will download untrusted external media and create multiple output and progress files on disk. In an agent setting, insufficient disclosure is risky because users may authorize execution without realizing it can consume bandwidth/storage, leave persistent artifacts, or process content from remote sources.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# ── Helpers ──
def run_cmd(args, timeout=30):
result = subprocess.run(args, capture_output=True, timeout=timeout)
try:
return (result.returncode,
result.stdout.decode('utf-8', errors='replace'),
The natural-language behavior is specialized to Chinese via Chinese connector/reference vocabularies and emits fixed Chinese headings like '## 段落{i}'. This enforces a specific language/locale in user-visible output without opt-in or clear documentation that the tool is intentionally limited to Chinese transcripts.
This code reads a user-supplied .md file and writes the transformed result back to the same path, replacing the original content. Although the script prints status messages after processing, there is no confirmation prompt or explicit user-facing warning in comments/docstrings that the operation modifies files in place and may remove existing segmentation markers when forced or during cleanup.
The dependency faster-whisper is specified with a lower bound only, so installations may resolve to different versions over time. This creates a supply-chain risk because builds are not reproducible and a future compromised or breaking release could be pulled in without review.
faster-whisper>=1.1.0
requests>=2.28.0
requests is also unpinned, which means the environment may install any later version satisfying the constraint. That weakens reproducibility and can expose the skill to vulnerable or malicious upstream releases, especially since this pipeline likely performs network access to fetch remote content.
faster-whisper>=1.1.0
requests>=2.28.0
The manifest does not pin requests, and the package has multiple published advisories across versions, so there is no way to verify that deployments will avoid affected releases. In this skill's context, requests is especially relevant because the pipeline fetches remote resources; if an affected version is installed, issues such as credential leakage or TLS/verification flaws could be reachable.