T09 · Insecure Skill Coding Practices
- Location
scripts/screenshot_tool.py:365- Finding
Arbitrary Python Expression Evaluation of Media-Derived Metadata
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill broadly does what it claims, but it handles Bilibili login/video data and contains unsafe parsing, dependency, and disclosure gaps that users should review before installing.
Install only in an isolated environment, avoid using a high-value Bilibili account, review dependency versions before installing, and do not process private or sensitive videos unless you are comfortable storing transcripts/screenshots locally and sending transcript content to an external LLM. The eval() parsing issue should be fixed before using untrusted media.
scripts/screenshot_tool.py:365Arbitrary Python Expression Evaluation of Media-Derived Metadata
scripts/llm_analyzer.py:39Indirect Prompt Injection Through Untrusted Video Metadata and Subtitles
scripts/report_generator.py:92Unsanitized LLM and Video Content Written to Markdown Reports
requirements.txt:1Unpinned Third-Party Dependencies Without Integrity Verification
A second description/behavior mismatch finding points to the same core issue: the skill claims link-based Bilibili video analysis and report generation, while the shown implementation excerpts primarily operate on local artifacts such as SRT files and FFmpeg commands. This can mislead operators into granting broader trust or access than warranted and obscures the true attack surface.
A second description/behavior mismatch finding points to the same core issue: the skill claims link-based Bilibili video analysis and report generation, while the shown implementation excerpts primarily operate on local artifacts such as SRT files and FFmpeg commands. This can mislead operators into granting broader trust or access than warranted and obscures the true attack surface.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
请开始分析并返回标准JSON格式的结果。"""
return prompt
def interactive_analyze(video_info: Dict, srt_content: str) -> Dict[str, Any]:
Using eval() on ffprobe-derived data is dangerous because it executes arbitrary Python expressions if the parsed value is attacker-controlled or if ffprobe output is spoofed or malformed. In a skill that analyzes user-supplied videos, this creates a plausible code-execution path in the host process rather than merely a parsing bug.
'duration': float(data.get('format', {}).get('duration', 0)),
'width': int(video_stream.get('width', 0)),
'height': int(video_stream.get('height', 0)),
'fps': eval(video_stream.get('r_frame_rate', '0/1'))
}
return info
The README promotes video downloading, login use, subtitle transcription, and third-party AI analysis, but does not warn users that credentials may be used, copyrighted/private content may be processed, and transcripts or metadata may be transmitted to external services such as Claude or Whisper-backed components. In this skill context, the omission is more significant because the workflow explicitly involves authentication and cloud AI processing, which can expose account, content, or privacy-sensitive data if users are not informed.
The skill documents shell execution, file reads, and file writes, but does not declare any tool scope such as allowed-tools or permissions. This creates an authorization and review gap: an agent may invoke filesystem and shell capabilities that users or platform policy did not explicitly approve, including downloading content and writing large local artifacts.
The skill omits an explicit warning that it downloads third-party video content and stores potentially large local files and screenshots. This is risky because users may not realize the privacy, copyright, storage, and retention implications before the agent performs disk- and content-handling actions.
The listed trigger phrases such as "帮我总结这个视频的知识点", "生成这个视频的学习报告", and "提取这个视频的关键内容" are generic video-summary requests and are not limited to Bilibili links or educational content. Without tighter constraints or negative examples, the skill could be invoked for unrelated video-analysis tasks.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Ubuntu/Debian:
sudo apt install ffmpeg
Windows:
Suspicious Unicode normalization or mixed-script content
该最佳实践文档从标题到全部操作说明均固定为中文,且未说明这是面向中文用户或特定区域场景的限定文档。根据语言/locale 政策,若技能内容强制单一语言而无用户选择或明确、合理的区域性说明,属于自然语言层面的策略问题。
Suspicious Unicode normalization or mixed-script content
This markdown checklist appears to require Chinese as the operating language for the skill content, and there is no indication that users may choose another language or that the restriction is justified by a region-specific purpose. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
The script's banner, prompts, help text, and status messages are written in Chinese throughout, which effectively forces a specific language for all users. The file does not provide any opt-in language selection or document that the tool is intentionally limited to a Chinese-speaking audience.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f"执行命令: {' '.join(cmd)}\n")
try:
result = subprocess.run(cmd, check=True)
if result.returncode == 0:
# 查找下载的视频文件
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f"执行命令: {' '.join(cmd)}\n")
try:
result = subprocess.run(cmd, check=True)
if result.returncode == 0:
# 查找下载的视频文件
The full subtitle content is read and passed into an LLM analysis function without any visible consent, warning, or privacy guardrails. If the analyzer sends content to a remote model provider, sensitive or copyrighted transcript material could be transmitted off-device unexpectedly.
The prompt text requires the LLM to analyze and return results entirely in Chinese, including Chinese academic phrasing and field descriptions. This imposes a language/locale choice on the user without opt-in, which matches the policy category for forced language constraints.
The module description explicitly defines the skill as a Chinese-language markdown report generator. Across the file, user-facing output and generated report labels are fixed in Chinese, with no indication that the user can choose another language or locale.
The module description, docstrings, CLI usage text, and user-facing messages are all presented in Chinese, which effectively forces a specific language for interaction. The file does not offer an alternative language or explain that the tool is intentionally limited to a Chinese-speaking context.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
"❌ 未找到 FFmpeg!\n\n"
"请先安装 FFmpeg:\n"
" macOS: brew install ffmpeg\n"
" Ubuntu: sudo apt install ffmpeg\n"
" Windows: 从 https://ffmpeg.org/download.html 下载\n"
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
)
try:
result = subprocess.run(
['ffmpeg', '-version'],
capture_output=True,
text=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 重试机制
for attempt in range(retry):
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
]
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
]
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
Detected: suspicious.dynamic_code_execution