T09 · Insecure Skill Coding Practices
- Location
SKILL.md:39- Finding
Hard-Coded MiniMax API Credential in Skill Documentation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a plausible video-highlighting tool, but it publishes a live-looking MiniMax API key and can send the wrong local subtitle file to an external AI service.
Install only after the MiniMax key has been revoked and removed, documentation is corrected, and subtitle handling is fixed to use a per-run working directory or exact downloaded subtitle path. Treat any video subtitles processed by this skill as data sent to MiniMax, and avoid using shared output folders containing private SRT files.
SKILL.md:39Hard-Coded MiniMax API Credential in Skill Documentation
clipper.py:51Unrelated Local Subtitle Files Can Be Submitted to an External AI Service
package-lock.json:14Unused SDK Dependency Is Retrieved from a Third-Party npm Mirror
The documented behavior does not accurately match what the skill actually does, including unsupported local video handling, omitted video downloading, and claimed COS integration that is not implemented. Security-relevant mismatches undermine informed consent and review, because users and operators cannot reliably predict what data will be processed or what external actions will occur.
A specific API key is embedded directly in the skill documentation, which is a direct secret disclosure. Anyone who reads the file may reuse the credential to consume the service, incur charges, or impersonate the project when calling the provider.
The skill advertises behavior that clearly requires shell execution and file read/write, but it does not declare any tool scope or permissions boundaries. That increases the chance the agent will execute powerful local operations without explicit review, making misuse or overbroad access harder to govern.
The skill sends subtitle or content-derived data to external AI services and references cloud services, but it does not clearly warn users about that data transfer. This creates a privacy and compliance risk, especially if the video content contains sensitive, copyrighted, or regulated information.
The documentation exposes hard-coded external service credentials/configuration, including a MiniMax API key and cloud service configuration. Embedded secrets can be copied by anyone with repository access and abused for unauthorized API usage, billing fraud, or pivoting into associated cloud resources.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# ── 依赖检查 ──────────────────────────────────────
def check_deps():
for cmd in ["ffmpeg", "ffprobe", "yt-dlp"]:
if subprocess.run(["which", cmd], capture_output=True).returncode != 0:
raise RuntimeError(f"缺少命令: {cmd}")
return True
The code explicitly prioritizes English and Chinese subtitle languages and the surrounding natural-language comments reinforce that fixed preference. This imposes a language/locale choice on users without opt-in or configuration, which matches the policy-violation category for forced language behavior.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-o", "%(title)s.%(ext)s",
video_url
]
r = subprocess.run(cmd, capture_output=True, text=True)
if r.returncode != 0:
raise RuntimeError(f"yt-dlp失败: {r.stderr[:200]}")
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
重要:max_tokens必须足够大(≥2000),否则thinking过程占用所有token导致content为空
"""
r = subprocess.run(
["mmx", "text", "chat", "--message", prompt,
"--model", "MiniMax-M2.7", "--max-tokens", str(max_tokens),
"--output", "json"],
The script reads subtitle content and sends it to an external MiniMax service without an explicit user-facing consent or warning. Subtitles can contain sensitive, private, copyrighted, or regulated content, so this creates a real data-exfiltration/privacy risk in a media-processing skill that users may expect to run locally except for obvious generation steps.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"""用MiniMax图片生成封面"""
prompt = f"{topic}短视频封面,高清,16:9,文字:「{title[:10]}」,专业感,抖音风格"
r = subprocess.run(
["mmx", "image", "generate",
"--prompt", prompt,
"--aspect-ratio", "16:9",
Converting an attacker-controlled subtitle file with ffmpeg can expose the host to parser-level vulnerabilities in complex multimedia tooling. In this skill, subtitles are fetched from remote sources and then handed directly to ffmpeg, increasing risk if a malformed file triggers a crash or exploit in the media stack.
# 将字幕SRT转换为ASS格式(支持样式)
ass_file = output_path.replace(".mp4", ".ass")
cmd = ["ffmpeg", "-y", "-i", subtitle_file, ass_file]
subprocess.run(cmd, capture_output=True)
# 如果视频存在,直接裁剪;否则需要先下载
if video_downloaded and Path(video_downloaded).exists():
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-o", f"{temp_dir}/clip.mp4",
video_url
]
r = subprocess.run(dl_cmd, capture_output=True, text=True)
if r.returncode != 0:
raise RuntimeError(f"下载片段失败: {r.stderr[:100]}")
input_video = f"{temp_dir}/clip.mp4"
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-threads", "2",
output_path
]
r = subprocess.run(cut_cmd, capture_output=True, text=True)
if r.returncode != 0:
# 字幕烧录失败,但视频已裁剪,输出无字幕版本
cut_cmd_no_sub = [
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-c:a", "copy",
output_path
]
subprocess.run(cut_cmd_no_sub, capture_output=True)
return output_path
The manifest description says the skill handles 'YouTube链接/本地视频', but the main flow only accepts a YouTube URL and always calls yt-dlp-based subtitle extraction and clip downloading. There is no code path for opening a local video file, extracting subtitles from it, or clipping it directly as a local source.
The module docstring lists 'ffmpeg 提取音频' and '腾讯COS存储' as workflow steps, but no function performs audio extraction and no code uploads outputs to Tencent COS. This creates a mismatch between the documented behavior of the skill and its actual operations.
Several ffmpeg invocations use the -y flag, which overwrites files without prompting, and the script also copies generated cover images into the output directory. While the script prints progress messages, it does not clearly warn the user that files in the chosen output path may be replaced automatically.
The dependency uses a caret range (^0.2.0), which allows installation of newer compatible releases rather than an exact reviewed version. This creates supply-chain risk because a later published package version could introduce malicious code or breaking behavior without any change to this repository.
"author": "",
"license": "ISC",
"dependencies": {
"@clawvard/sdk": "^0.2.0"
}
}