T07 · Tool Hijacking and Spoofing
- Location
scripts/batch_generate_reports.py:14- Finding
Batch Generator Executes a Hardcoded External Template
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent video-analysis purpose, but its scripts include unsafe file operations, hardcoded external execution paths, and persistent environment changes that users should review before installing.
Install only in an isolated, non-admin Python environment and review the scripts first. Confirm the exact video folder, temp directory, output directory, and archive behavior before running; avoid untrusted config JSON files; and replace hardcoded external paths with package-relative paths before using batch generation.
scripts/batch_generate_reports.py:14Batch Generator Executes a Hardcoded External Template
scripts/extract_video_one_shot.py:38Caller-Controlled Temporary Path Is Recursively Deleted Without Containment Validation
scripts/gen_report_template.py:18Configuration Values Permit Output Path Traversal and Stored HTML Injection
SKILL.md:217Installation Instructions Use Unpinned Third-Party Dependencies
该代码块的实际功能是一个批量任务运行器:读取目录中的 config_*.json,并通过 subprocess 调用固定路径的 gen_report_template.py。虽然这可能是整体系统中的辅助脚本,但就当前提供的代码而言,其主要目的与声明的“短视频反向工程分析”不一致。它没有直接处理视频、音频、帧、OCR/ASR、视觉模型、合规检查,也没有展示生成报告内容的实现。因此,这属于描述与代码行为的实质性不匹配,而不仅仅是实现细节缺失。
声明描述的是一个端到端的短视频分析与二创辅助工具,但该代码块的功能范围明显更窄,主要是媒体预处理与转写。已实现的部分只有关键帧提取、音频提取、中文语音转文字,以及生成供后续分析使用的 contact sheet 和 JSON/转录文件。声明中的多个核心输出和分析能力——尤其是逐帧视觉分析、HTML 报告、中文提示词、制作建议、合规审查、10 秒改编方案——在代码中都没有体现。因此描述显著高于实际行为,属于能力不匹配。
The description states that the generated analysis report includes AI prompts '仅中文', imposing a language restriction by default. This is a natural-language policy concern because the file does not offer the user a language choice or document a justified region-specific requirement.
The skill describes shell execution, file reads/writes, environment access, and automated movement of user files, yet it declares no explicit tool scope or permission boundaries. In an agent environment this can lead to overbroad execution authority, making it easier for the skill to process unintended files, move data, or invoke local commands without clear user-visible constraints.
The invocation triggers are broad enough to match ordinary user requests like 'analyze this video' or 'turn this into a script,' increasing the chance the skill auto-activates without clear user intent for reverse-engineering, file scanning, or batch processing. In this skill, that matters because activation can lead to shell execution, directory scanning, report generation, and movement of local files.
L231-L232 明确宣称 extract_video_one_shot.py 已“新增 msys 路径自动转换”,L242 和 L257 也再次说明路径可用 msys 或任意格式并自动转换。但 L297 又写明调用该脚本时“视频路径和 temp_dir 都必须使用 Windows 风格路径,不能使用 msys 风格”,这与前述能力描述直接冲突,属于文档/注释层面的主动矛盾。
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
for cfg_path in config_files:
print(f"\n[Processing] {os.path.basename(cfg_path)}")
r = subprocess.run([PYTHON, TEMPLATE, cfg_path], capture_output=True, text=True)
if r.stdout:
print(r.stdout)
if r.stderr:
The manifest describes a skill for analyzing short videos and generating reports, but this helper script implements arbitrary subprocess execution via a hardcoded external Python binary and target script. Launching external processes is not an obvious requirement of the declared analysis capability itself and expands execution power beyond the stated purpose.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
os.makedirs(frames_dir)
cmd = [ffmpeg, "-y", "-i", video, "-vf", f"fps={fps}", "-q:v", "2",
os.path.join(frames_dir, "frame_%04d.jpg")]
subprocess.run(cmd, capture_output=True, timeout=120)
frames = sorted([f for f in os.listdir(frames_dir) if f.endswith('.jpg')])
return frames_dir, frames
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
os.makedirs(frames_dir)
cmd = [ffmpeg, "-y", "-i", video, "-vf", f"fps={fps}", "-q:v", "2",
os.path.join(frames_dir, "frame_%04d.jpg")]
subprocess.run(cmd, capture_output=True, timeout=120)
frames = sorted([f for f in os.listdir(frames_dir) if f.endswith('.jpg')])
return frames_dir, frames
The docstring states 'Whisper 中文转写' and the code hard-codes language='Chinese', which enforces a specific language behavior for all inputs. This is a natural-language policy violation because the skill does not offer language selection or explain why the locale restriction is required.
The script copies an ffmpeg binary into a hard-coded Python environment outside the working directory, modifying host tooling as a side effect of normal execution. This is dangerous because it breaks workspace isolation, can persistently alter other workflows or users’ environments, and may replace a trusted binary with an unexpected one if the source path is influenced or compromised.
The generated HTML is explicitly tagged with lang="zh-CN", and the report content and UI strings throughout the file are fixed in Chinese. This imposes a specific language/locale without offering user opt-in or documenting that the skill is intended only for a Chinese-language workflow.
The module docstring presents the script purpose and usage entirely in Chinese, and the script does not indicate that language selection is optional or that the tool is intended only for a Chinese-speaking locale. Under the policy criteria, forcing a specific language without user opt-in is a natural-language policy concern.
The docstring says '提取关键帧', which implies keyframe-based extraction, but the ffmpeg command uses a regular fps filter (fps=0.5) rather than selecting codec/GOP keyframes. This is an active documentation-to-code mismatch about what kind of visual sampling the skill performs.
No suspicious patterns detected.