T09 · Insecure Skill Coding Practices
- Location
SHARE_GUIDE.md:43- Finding
Python Code Injection Through Unsafely Interpolated Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a legitimate speech-to-text purpose, but its install guide is under-scoped and unsafe enough that users should review it before installing.
Install only after reviewing and preferably fixing the wrapper. Use safe argument passing instead of python3 -c interpolation, pin and verify model downloads, avoid modifying ~/.bashrc unless you explicitly want a persistent global whisper command, and treat the offline claim as meaning local inference after network setup rather than no network use.
SHARE_GUIDE.md:43Python Code Injection Through Unsafely Interpolated Command-Line Arguments
SHARE_GUIDE.md:64Unverified Model Downloads From a Third-Party Mirror
The documentation says the skill uses whisper.cpp, but the wrapper actually invokes Python and faster_whisper. This mismatch changes the runtime and dependency trust boundary, potentially introducing unreviewed Python packages, dynamic model downloads, and behavior inconsistent with what users and defenders expect to audit.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
uage='$LANGUAGE', task='$TASK') text = ''.join([segment.text for segment in segments]).strip() print(text if text else ''.join([segment.text for segment in segments]).strip()) except Exception as e: print(f'错误: {e}', file=sys.stderr) sys.exit(1) " EOF
chmod +x ~/bin/whisper
if [[ ":$PATH:" != ":$HOME/bin:" ]]; then echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc export PATH="$HOME/bin:$PATH" fi
#### 3. 下载模型(首次使用时需要)
```bash
# 设置国内镜像
export HF_ENDPOINT=https://hf-mirror.com
export HF_HOME=/tmp/hf_mirror_cache
# 下载tiny模型(约75MB)
mkdir -p /tmp/whisper.cpp/models
cd /tmp/whisper.cpp/models
wget -O ggml-tiny.bin https://hf-mirror.com/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin
# 转录语音文件(默认使用tiny模型和中文)
whisper /path/to/your/audio.ogg
# 指定不同模
The guide claims the solution is 'completely offline' while the documented setup explicitly downloads models from external Hugging Face mirror URLs and the wrapper may also trigger model downloads at runtime. This can mislead operators about network exposure, supply-chain risk, and data-handling assumptions during installation and first use.
The guide instructs users to create a persistent executable wrapper in ~/bin, altering the user's command environment beyond the current session. Persistent shell modifications increase the blast radius of any mistake or later abuse because future commands may resolve to this wrapper unexpectedly.
# 创建目录
mkdir -p ~/bin
# 创建whisper包装器
cat > ~/bin/whisper << 'EOF'
The wrapper sets LANGUAGE="zh" by default, which forces a specific locale unless the caller explicitly overrides it. This is a natural-language policy concern because the skill imposes a language choice rather than prompting for or auto-detecting user preference.
The document says incoming voice messages are automatically transcribed using a Chinese model, which indicates a fixed language/locale behavior. Because the user is not presented with a choice or explicit opt-in at this point, this conflicts with the language/locale policy criteria.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| `whisper: command not found` | 确认`~/bin`在PATH中,运行 `source ~/.bashrc` 重新加载 |
| 模型下载失败 | 检查网络连接,确认可访问 `https://hf-mirror.com` |
| 转录结果为空 | 检查音频文件格式,尝试不同模型大小 |
| `ffmpeg: command not found` | 安装ffmpeg:`sudo apt install ffmpeg` (Ubuntu/Debian) |
### ✅ 功能验证
安装后可使用以下命令测试:
The trigger guidance uses the vague phrase '或类似关键词', which broadens activation beyond a clearly bounded set of intents. In an agent environment, ambiguous trigger rules can cause the skill to run on unrelated user inputs, increasing the chance of unintended file/network/tool usage and surprising behavior.
SQP-3 适用于所有文件类型。L03 明确声明“支持中文”,并在后文持续强调中文语音识别,但未说明这是可选语言、仅面向特定区域,或如何让用户选择其他语言,因此可能构成未经用户选择的语言限定。
The trigger term '听写' is very short and semantically broad, so it may match benign conversation or unrelated dictation references. This can cause accidental activation of a skill that has execution permissions for ffmpeg, wget, and curl, making unintended invocation more consequential than a harmless metadata issue.