T09 · Insecure Skill Coding Practices
- Location
scripts/run_voice_chat.py:54- Finding
Untrusted voice transcript is passed directly to a tool-capable current-session agent
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a plausible voice-reply tool, but it asks for persistent automatic handling of voice messages and current agent context without enough privacy or control boundaries.
Review this before installing if the agent has access to private chats, files, or tools. Use it only with explicit user consent for voice processing, avoid reusing privileged sessions for transcript replies, disable or restrict content logging, verify downloaded models and dependencies, and scope any SOUL.md automation to trusted channels/users.
scripts/run_voice_chat.py:54Untrusted voice transcript is passed directly to a tool-capable current-session agent
README.md:106Speech-recognition model archives are downloaded and extracted without integrity verification
requirements.txt:4Python dependencies use open-ended version ranges without a lock file or hashes
scripts/run_voice_chat.py:102Voice transcripts and generated replies are written to application logs
The code does match part of the description: it transcribes audio, creates reply text, and synthesizes a voice reply. However, key described behavior is missing. The declared purpose says it automatically activates when receiving voice/audio messages, but this code is only a local processing script with a CLI entry point and no event/message listener or trigger handling. It also claims to generate an intelligent reply combined with context, but the actual reply is just a formatted template (defaulting to repeating the transcript) with no context retrieval, LLM call, or dialogue logic. Thus the description overstates the implemented behavior in material ways.
The description promises a full pipeline: detect voice/audio messages, transcribe them, generate a context-aware reply, and synthesize a voice response. This code chunk only covers the final synthesis portion. It accepts plain text as input, generates MP3 speech with Edge TTS or pyttsx3, then transcodes it to OGG/Opus for Feishu. There is no logic for receiving messages, identifying triggers, processing audio input, transcription, conversation context, or response generation. While TTS is part of the declared functionality, the actual code's primary purpose is much narrower and omits several core declared behaviors, so this is a material description-behavior mismatch.
The code only implements an STT engine wrapper for transcription routing and does not include the other core behaviors described: generating intelligent replies from context, synthesizing spoken responses, or auto-triggering on incoming voice/audio messages. While speech-to-text is consistent with part of the description, the declared purpose substantially overstates the implemented functionality, so this is a material description-behavior mismatch.
The description promises an automatic voice-message workflow that transcribes audio, uses context to generate an intelligent reply, and returns a synthesized voice reply upon receiving Telegram voice/audio messages. The code only implements a pure local processing function: transcribe local audio, insert transcript into a fixed template, and synthesize TTS. It explicitly removes direct Telegram API download/send functionality, with those functions always raising exceptions. There is also no evidence of contextual reply generation or automatic activation on message receipt in this chunk. Therefore, the actual behavior is materially narrower and different from the declared purpose.
声明描述的是一个完整的语音消息自动处理技能,包含三段核心能力:语音转文字、基于上下文生成回复、以及文字转语音回复,并且应在接收到语音/音频消息时自动触发。但实际提供的代码只是一个独立的音频转写脚本:检查输入文件、调用 ffmpeg 转 WAV、使用 Sherpa-ONNX 或 Vosk 识别、输出转写文本。代码中没有任何对话上下文读取、LLM/回复生成、TTS 语音合成、消息收发或自动触发机制。因此,代码行为仅覆盖了声明中的一部分(STT),整体目的明显比声明更窄,属于描述与实际行为不一致。
The declared description presents a full voice-message automation pipeline: detect incoming audio, transcribe it, generate a reply, and synthesize voice output. The supplied code chunk does not implement that behavior. It only provides helper utilities for validating that an input path is a file and verifying/locating external dependencies (ffmpeg and edge-tts). While these utilities could support an audio-processing skill, they do not themselves carry out the declared primary functions. Therefore, the code chunk does not accurately represent the declared purpose.
The declared description describes a production skill for end-to-end voice message processing, including transcription, reply generation, and speech synthesis. The provided code chunk only modifies sys.path in a pytest conftest file to make a scripts directory importable during tests. This is unrelated test setup infrastructure and does not implement or evidence the declared functionality, triggers, or resource usage. Therefore, the code chunk does not accurately represent the declared purpose.
The declared description presents a full voice-message pipeline: automatic triggering on audio input, transcription, context-based response generation, and voice synthesis. The supplied code chunk does not implement or demonstrate most of that pipeline. It is only a pytest module for TTS-related functions, specifically generating an OGG voice output and validating empty-text errors, with dependency checks for ffmpeg and edge-tts. Because the actual code behavior is narrowly focused on TTS testing and lacks the declared transcription, intelligent reply generation, and auto-activation behavior, this is a material description-behavior mismatch.
The declared description presents a broader end-to-end voice-message assistant: transcribe incoming audio, use context to generate a smart reply, and synthesize a spoken response automatically upon receiving voice/audio messages. The actual supplied code only contains tests for a transcription component, specifically validating transcription on empty audio and error handling for missing files. There is no evidence in this chunk of contextual response generation, text-to-speech, or message-triggered automation. While the transcription portion aligns partially with the description, the overall declared purpose materially overstates the behavior shown in the code chunk.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# This project is now a pure processing skill to be orchestrated by OpenClaw.
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = False
extra = "ignore"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
@lru_cache(maxsize=1)
def get_settings() -> Settings:
# Load .env if present; environment variables still take precedence
load_dotenv(override=False)
return Settings()
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
@lru_cache(maxsize=1)
def get_settings() -> Settings:
# Load .env if present; environment variables still take precedence
load_dotenv(override=False)
return Settings()
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
@lru_cache(maxsize=1)
def get_settings() -> Settings:
# Load .env if present; environment variables still take precedence
load_dotenv(override=False)
return Settings()
process_telegram_voice_message explicitly expects a local audio path from OpenClaw, yet the CLI defines the positional argument as 'file_id' and describes a full round-trip '完整处理并回传'. In practice, the value is passed directly as audio_path, and the optional send path invokes send_telegram_voice, which only raises a deprecation error. This is a direct intent/behavior contradiction likely to mislead integrators about what the skill actually does.
The skill documentation is presented entirely in Chinese and describes defaults such as a Chinese TTS voice, but does not indicate that users can opt into another language or locale for interaction. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.
The design explicitly states Telegram voice messages are automatically downloaded, transcribed, and replied to, but it does not mention any user notice, consent flow, retention policy, or warning that user audio may be processed locally and possibly sent to remote services such as an LLM or Edge TTS. This creates a privacy and compliance risk because sensitive voice content may be handled or transmitted without the user's awareness.
The Feishu integration section describes automatic triggering on voice messages and automatic text replies, but omits any warning that incoming audio will be transcribed and potentially passed through downstream AI components. In a messaging context, silent processing of user speech can expose private, regulated, or confidential information without informed consent.
The skill description and setup emphasize Chinese operation, and the SOUL.md instructions explicitly require generating replies in Chinese while the default voice is fixed to zh-CN. This is a natural-language locale policy issue because the file imposes a language preference without opt-in or a clearly documented region-specific limitation.
The README promotes automatic transcription and response generation for incoming voice messages, while also documenting optional external LLM endpoints and cloud-based Edge TTS. That creates a real privacy and consent risk because user audio and derived text may be transmitted to third-party services without an explicit warning, data-handling notice, or opt-in.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 更新包列表
sudo apt-get update
# 安装 FFmpeg (音频转换必需)
sudo apt-get install -y ffmpeg
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 更新包列表
sudo apt-get update
# 安装 FFmpeg (音频转换必需)
sudo apt-get install -y ffmpeg
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get update
# 安装 FFmpeg (音频转换必需)
sudo apt-get install -y ffmpeg
# 安装 eSpeak-ng (本地 TTS 引擎,可选但推荐)
# 如果 Edge TTS 失败,脚本会自动降级使用本地 TTS,需要此引擎
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get update
# 安装 FFmpeg (音频转换必需)
sudo apt-get install -y ffmpeg
# 安装 eSpeak-ng (本地 TTS 引擎,可选但推荐)
# 如果 Edge TTS 失败,脚本会自动降级使用本地 TTS,需要此引擎
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt-get update
# 安装 FFmpeg (音频转换必需)
sudo apt-get install -y ffmpeg
# 安装 eSpeak-ng (本地 TTS 引擎,可选但推荐)
# 如果 Edge TTS 失败,脚本会自动降级使用本地 TTS,需要此引擎
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
# 创建模型目录
mkdir -p /tmp/sherpa-model
# 下载 Sherpa-ONNX SenseVoice 模型(约 999MB)
cd /tmp/sherpa-model