T09 · Insecure Skill Coding Practices
- Location
doubao_video_analyzer.py:71- Finding
Unrestricted API Endpoint Can Exfiltrate Credentials and Private Video Content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill performs the advertised video analysis, but it can automatically send sensitive video frames and transcripts to a configurable external API and writes unescaped HTML reports.
Install only if you are comfortable sending video frames, speech transcripts, prompts, and your model API key to the configured provider. Use a trusted HTTPS endpoint, avoid auto-analysis for sensitive chats or unknown attachments, and treat generated HTML reports as untrusted until the skill escapes or sanitizes model and transcript content.
doubao_video_analyzer.py:71Unrestricted API Endpoint Can Exfiltrate Credentials and Private Video Content
doubao_video_analyzer.py:302Stored HTML Injection Through Unescaped Model and Transcript Content
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
retry=retry_if_exception_type((requests.exceptions.ConnectionError, requests.exceptions.Timeout))
)
def call_api():
resp = requests.post(f"{BASE_URL}/chat/completions", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
return resp.json()
The README describes automatic video analysis, frame extraction, speech transcription, and use of external model APIs, but does not clearly warn that video/audio content may be transmitted to third-party providers. Because videos and speech often contain personal, confidential, or regulated data, the absence of a privacy notice creates a significant data exposure risk.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
::SetEnvironmentVariable("VIDEO_ANALYZER_API_KEY", "你的API密钥", "User") [Environment]::SetEnvironmentVariable("VIDEO_ANALYZER_MODEL", "doubao-seed-2-0-pro-260215", "User") [Environment]::SetEnvironmentVariable("VIDEO_ANALYZER_BASE_URL", "https://ark.cn-beijing.volces.com/api/v3", "User")
设置后重启终端即可生效。
**Linux/macOS**:追加到 `~/.bashrc` 或 `~/.zshrc`
```bash
echo 'export VIDEO_ANALYZER_API_KEY="你的API密钥"' >> ~/.bashrc
echo 'export VIDEO_ANALYZER_MODEL="doubao-seed-2-0-pro-260215"' >> ~/.bashrc
source ~/.bashrc
在技能目录下创建 .env 文件:
VIDEO_ANALYZER_API_KEY=你的API密钥
VIDEO_ANALYZER_MODEL=doubao-seed-2-0-pro-260215
VIDEO_ANALYZER_BASE_URL=https://ark.cn-beijing.volces.com/api/v3
| 模型提供商 | MODEL 值 | BASE_URL | API Key 申请 |
|---|---|---|---|
| 豆包 | doubao-seed-2-0-pro-260215 | `h |
The WeChat auto-trigger workflow instructs users to send message attachments for automatic analysis but omits any warning that attachments and derived transcripts may be processed and potentially sent to external APIs. In a messaging environment, this omission is especially dangerous because users may assume chat attachments remain private to the conversation.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
openai-whisper>=20231106
torch>=2.0.0
# 可选依赖(支持 .env 文件)
python-dotenv>=1.0.0
# 优化依赖(API 重试、图像处理)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
openai-whisper>=20231106
torch>=2.0.0
# 可选依赖(支持 .env 文件)
python-dotenv>=1.0.0
# 优化依赖(API 重试、图像处理)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
openai-whisper>=20231106
torch>=2.0.0
# 可选依赖(支持 .env 文件)
python-dotenv>=1.0.0
# 优化依赖(API 重试、图像处理)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
openai-whisper>=20231106
torch>=2.0.0
# 可选依赖(支持 .env 文件)
python-dotenv>=1.0.0
# 优化依赖(API 重试、图像处理)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
openai-whisper>=20231106
torch>=2.0.0
# 可选依赖(支持 .env 文件)
python-dotenv>=1.0.0
# 优化依赖(API 重试、图像处理)
The README states that the skill generates a structured Chinese report, which imposes a specific language behavior by default. There is no indication that users can choose another output language or explicitly opt into Chinese-only responses.
The README advertises '零门槛使用' and automatic triggering from WeChat video messages without defining scope, authorization boundaries, or exclusions. In a messaging context, broad auto-activation can cause unintended processing of any received video, increasing the chance of privacy violations, surprise execution, and abuse through unsolicited content.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
### 3. 安装 ffmpeg
- **Windows**: `winget install Gyan.FFmpeg` 或从 [ffmpeg.org](https://ffmpeg.org/download.html) 下载
- **macOS**: `brew install ffmpeg`
- **Linux**: `sudo apt install ffmpeg`
## ⚙️ 配置
The invocation instructions say users can 'directly send a video file in WeChat' and analysis will auto-trigger, but do not describe any gating or consent mechanism. In a chat-integrated skill, that makes the trigger surface extremely broad and can lead to accidental processing of sensitive attachments.
The core usage scenario repeats the claim that simply sending a video file will automatically return an analysis report, again without exceptions or opt-in controls. Repetition of broad auto-trigger behavior in a skill intended for messaging platforms raises the risk that operators deploy it without considering minimum-necessary activation constraints.
The skill declares broad capabilities in practice (environment variable access, shell execution, network access, and local file writes) but does not declare any explicit tool scope or permissions. This weakens reviewability and containment because consumers cannot easily understand or restrict what the skill will do before execution, especially since it sends video-derived data to external APIs and writes reports locally.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def get_video_duration(video_path: Path) -> float:
"""获取视频时长(秒)"""
try:
result = subprocess.run(
["ffprobe", "-v", "error", "-show_entries", "format=duration",
"-of", "default=noprint_wrappers=1:nokey=1", str(video_path)],
capture_output=True, text=True, timeout=10
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 1. 抽关键帧(I帧)
logger.info("⏳ 正在提取关键帧...")
try:
subprocess.run(
["ffmpeg", "-i", str(VIDEO_PATH),
"-vf", "select='eq(pict_type,I)'",
"-vsync", "vfr",
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 2. 提取音频
logger.info("⏳ 正在提取音频...")
try:
subprocess.run(
["ffmpeg", "-i", str(VIDEO_PATH),
"-ac", "1", "-ar", "16000",
str(AUDIO_PATH)],
The tool sends extracted video frames and audio transcript content to a remote multimodal API without an explicit in-script warning or consent step. Because videos often contain sensitive images, speech, and personal data, transmitting them off-host to a third party is a significant privacy and data-governance risk in this context.
This network call transmits user-derived content—prompt text, audio transcript, and base64-encoded video frames—to an external service. In a video-analysis skill this behavior is functionally expected, but it is still security-relevant because it exports potentially sensitive material to a third party and therefore requires strong disclosure and trust controls.
retry=retry_if_exception_type((requests.exceptions.ConnectionError, requests.exceptions.Timeout))
)
def call_api():
resp = requests.post(f"{BASE_URL}/chat/completions", headers=headers, json=payload, timeout=60)
resp.raise_for_status()
return resp.json()
The script persists extracted keyframes and an HTML visualization to disk, which expands data retention beyond the core analysis described and may unexpectedly store sensitive visual content. In a video-analysis tool, frames can contain personal, confidential, or regulated information, so silent long-term export increases privacy and leakage risk.
The module docstring states that it generates a structured Chinese report, and later the HTML markup hard-codes the zh-CN locale. This imposes a language/locale preference without offering users a choice, which matches the policy category for language or locale violations.
The code comments and structure imply temporary data is automatically cleaned up, but later copies keyframes to a persistent output directory. This mismatch can mislead users into believing sensitive frame data is ephemeral when it is actually retained, creating a transparency and privacy problem.
This markdown file presents all instructions and warnings exclusively in Chinese, and it does not indicate that the skill is region-specific or provide an opt-in language choice. Under the policy, forcing a specific language without user choice can be a natural-language policy violation.