Back to skill

Security audit

Qqbot Voice Transcribe

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for QQ voice transcription, but its gateway examples expose bot hosts to command injection and its claimed confirmation and safety controls are not actually implemented.

Install only after replacing shell exec examples with execFile/spawn argument arrays, generating safe server-side filenames, pinning dependencies, and adding a real opt-in confirmation step plus privacy and log-retention guidance for voice transcripts. Run it under a dedicated low-privilege account and avoid applying the swap/fstab instructions unless an administrator explicitly wants that host change.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
examples/gateway-integration-v2.ts:46
Finding

Shell Command Injection in Gateway Voice Processing Examples

Content
View full analysis
/dev/null` ); // 4. Whisper 识别 (medium 模型) log?.info(`🤖 正在识别语音...`); await execPromise( `whisper --model medium --language zh ${wavPath} --output_dir ${downloadDir} --verbose False` ); ``` From `examples/gateway-integration.ts:30-54`: ```typescript await new Promise((resolve, reject) => { exec(`bash ${decoderPath}/converter.sh ${fixedPath} mp3`, (err, stdout, stderr) => { if (err) { log.error(`❌ 解码失败:${stderr}`); reject(err); } else { log.info(`✅ 解码完成`); resolve(); } }); }); // 3. Whisper 识别文字 const model = process.env.WHISPER_MODEL || 'base'; const language = process.env.WHISPER_LANGUAGE || 'zh'; const transcript = await new Promise((resolve, reject) => { exec( `whisper --model ${model} --language ${language} ${outputMp3} --output_dir ${os.tmpdir()} --verbose False`, (err, stdout, stderr) => { if (err) { log.error(`❌ 识别失败:${stderr}`); reject(err); } else { const txtPath = outputMp3 + '.txt'; ``` The same unsafe command-construction pattern is presented as recommended integration code in `README.md:98-109` and `SKILL.md:72-80`. ### Technical Analysis Node.js `exec` executes the supplied string through a system shell. The code directly interpolates the following values into shell command strings: - `localPath` and derivative paths such as `fixedPath`, `pcmPath`, ` ...[truncated 2660 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:29
Finding

Mutable and Unpinned Executed Third-Party Dependencies

Content
View full analysis
Remediation
View remediation
``` 2. Verify the checked-out commit or release using a trusted signature or a separately distributed checksum. 3. Pin Whisper and all relevant Python dependencies in a requirements or lock file: ```text openai-whisper== \ --hash=sha256: ``` 4. Use `pip install --require-hashes -r requirements.txt` where practical. 5. Build dependencies in a controlled environment and distribute verified artifacts rather than cloning mutable repository HEAD on production systems. 6. Run the decoder and Whisper under a dedicated, unprivileged service account with access only to required audio and output directories. 7. Document the exact audited dependency versions and update them through an explicit review process. 8. Avoid installing dependencies as root unless packaging constraints require it; prefer a virtual environment or isolated container. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code substantially matches the general purpose of QQ voice-message transcription and gateway integration, but there are material discrepancies in the declared behavior. Most notably, the description claims Whisper medium, while the code defaults to the base model unless overridden by environment variable. It also claims a user confirmation flow, but no confirmation or user-interaction logic exists in the supplied code. The gateway integration is only an example snippet in comments rather than a full integrated workflow. There is no evidence of unrelated or malicious capabilities, but the declared description is not fully accurate compared with the implemented behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents an interactive QQ bot skill with gateway integration, automatic QQ Silk V3 decoding, a specific Whisper medium transcription model, and a user confirmation workflow. This code chunk instead implements a local command-line batch processor for directories of .amr files, with optional dependency checks and JSON reporting. While it may support voice decoding/transcription via imported helpers, the visible behavior is materially different in primary purpose and interface: offline batch file processing rather than bot-triggered gateway handling. Key declared features such as gateway integration, user confirmation flow, and specific model usage are not present in the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The core audio-processing portion of the description is largely accurate: the code does remove a header byte, decode QQ/Silk-style audio via an external decoder, and transcribe it with Whisper, defaulting to the medium model and zh language. However, the declared description materially overstates the surrounding functionality. There is no Gateway integration, no bot event handling, no message-trigger logic, and no user confirmation flow in the supplied code. Instead, this is a standalone local CLI utility for single or batch processing of .amr files. Because those declared integration/workflow features are absent and the operational mode differs from a bot skill, this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill automatically transcribes user voice attachments and then feeds the transcript into downstream execution flow, but the README does not clearly warn about privacy, consent, retention, or handling of potentially sensitive audio/transcript data. In this context, missing disclosure is a real security/privacy weakness because users may not realize their attachments are being converted into text and acted upon.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 55)May include surrounding context.

bash
# 添加 4GB swap(防止 OOM)
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented command hardcodes --language zh, forcing Chinese transcription without describing user choice, locale detection, or fallback behavior. In a bot pipeline where transcripts may be used for later execution, incorrect language forcing can produce unsafe or misleading transcripts and increase the risk of unintended actions after user confirmation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents shell execution, file reads/writes, and environment-variable use, but declares no explicit tool scope or permissions. In an agent ecosystem, this weakens policy enforcement and can allow a skill to obtain broader capabilities than reviewers or operators expect, especially because it invokes external binaries and modifies files in /tmp.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation claims a user confirmation flow, but the shown integration appends transcribed speech directly into bot message content automatically. In this context, that matters because speech transcription is untrusted input; auto-inserting it can trigger unintended downstream bot actions, prompt injection, or disclosure of sensitive spoken content without user approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill automatically transcribes voice attachments and injects their contents into bot-visible messages, but the documentation lacks a clear privacy warning or consent model. In a messaging-bot context this can expose sensitive spoken data, create retention/compliance issues, and surprise users who did not expect audio to be converted into text and propagated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The embedded TypeScript example invokes Whisper with --language zh, forcing a specific language in a natural-language instruction example. While later configuration mentions WHISPER_LANGUAGE, this example does not offer opt-in or explain why Chinese must be enforced, which can violate language/locale choice policy.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code builds shell command strings with unquoted, variable-controlled paths (fixedPath, pcmPath, wavPath, downloadDir) and executes them via child_process.exec. If an attachment filename or path contains shell metacharacters, an attacker could trigger command injection and execute arbitrary commands under the bot's privileges. In a gateway integration that processes remote user-supplied attachments, this is more dangerous than a standalone local transcription script.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The Whisper command is forced to use --language zh, and surrounding comments/output are written as if Chinese is the required language. This is a natural-language locale policy concern because the skill does not provide opt-in, fallback, or justification for restricting recognition to Chinese.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script logs the full speech transcript, which may contain sensitive personal data, credentials, or private conversations. In a bot/gateway context, logs are often retained centrally and accessible to operators or other systems, so this creates an unnecessary data exposure risk even without a direct exploit.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The example executes external programs through shell commands and allows key executable parameters to be influenced by environment variables and file paths. In a gateway context processing untrusted attachments, this increases the attack surface for command injection, unsafe binary execution, and abuse of privileged host tooling if inputs or environment configuration are compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Shell commands are constructed by interpolating localPath-derived filenames and environment-controlled values directly into command strings passed to exec. If an attacker can influence the downloaded filename, path, or process environment, they may inject shell metacharacters and execute arbitrary commands on the host running the bot.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code sets WHISPER_LANGUAGE to 'zh' when no user-selected language is provided, which imposes a specific locale by default. This is a natural-language policy issue because the skill does not offer a language choice or document a justified region-specific constraint.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/process_qq_voice.py (reported line 34)May include surrounding context.

python
# 检查 whisper
    try:
        subprocess.run(["whisper", "--version"], capture_output=True, check=False)
    except FileNotFoundError:
        missing.append("whisper (pip3 install openai-whisper)")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/process_qq_voice.py (reported line 40)May include surrounding context.

python
# 检查 ffmpeg
    try:
        subprocess.run(["ffmpeg", "-version"], capture_output=True, check=False)
    except FileNotFoundError:
        missing.append("ffmpeg (apt install ffmpeg)")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
88% confidence
Finding

The script executes 'bash' on a converter script located under DECODER_PATH, which is derived from an environment variable. If an attacker can influence the environment or place a malicious converter.sh at that path, this becomes arbitrary code execution under the privileges of the bot or user running the script.

Content

Scanner excerpt · scripts/process_qq_voice.py (reported line 91)May include surrounding context.

python
output_mp3 = output_dir / f"{amr_path.stem}.mp3"
        
        print(f"🎵 正在解码...")
        result = subprocess.run(
            ["bash", f"{DECODER_PATH}/converter.sh", str(fixed_path), "mp3"],
            capture_output=True,
            text=True,

Tainted flow: 'DECODER_PATH' from os.getenv (line 19, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
94% confidence
Finding

DECODER_PATH is tainted from the environment and concatenated into the script path executed by bash. In automation or bot environments where env vars may be user-influenced, this creates a realistic arbitrary code execution primitive by redirecting execution to an attacker-controlled decoder directory.

Content

Scanner excerpt · scripts/process_qq_voice.py (reported line 91)May include surrounding context.

python
output_mp3 = output_dir / f"{amr_path.stem}.mp3"
        
        print(f"🎵 正在解码...")
        result = subprocess.run(
            ["bash", f"{DECODER_PATH}/converter.sh", str(fixed_path), "mp3"],
            capture_output=True,
            text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/process_qq_voice.py (reported line 111)May include surrounding context.

python
# 3. Whisper 识别文字
        print(f"🎤 正在识别...")
        result = subprocess.run(
            ["whisper", "--model", WHISPER_MODEL, "--language", WHISPER_LANGUAGE,
             str(output_mp3), "--output_dir", str(output_dir),
             "--verbose", "False"],

Tainted flow: 'WHISPER_MODEL' from os.getenv (line 20, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/process_qq_voice.py (reported line 111)May include surrounding context.

python
# 3. Whisper 识别文字
        print(f"🎤 正在识别...")
        result = subprocess.run(
            ["whisper", "--model", WHISPER_MODEL, "--language", WHISPER_LANGUAGE,
             str(output_mp3), "--output_dir", str(output_dir),
             "--verbose", "False"],

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script prints transcribed voice content directly to stdout and in batch summaries, which can expose sensitive information derived from private audio into logs, terminals, CI output, or bot orchestration telemetry. In a voice-transcription skill, this risk is heightened because the processed content is likely user-generated and may contain secrets or personal data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file uses Chinese-only user-facing descriptions and explicitly references Chinese speech recognition later in the document, but does not mention any option for users to choose another language or locale. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

At L222 the documentation states '默认使用 medium 模型', but the executable integration example invokes whisper --model base at L080 and the environment variable example also sets WHISPER_MODEL=base at L138. This is an active contradiction in the documented intent versus the behavior readers are instructed to implement.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
examples/gateway-integration.ts:30