T09 · Insecure Skill Coding Practices
- Location
bin/voice-agent.sh:106- Finding
Configuration-Based Arbitrary Command Execution Through eval
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This voice assistant skill is mostly purpose-aligned, but it overstates its privacy and completeness and includes unsafe configuration, network, and dependency practices that should be reviewed before use.
Install only if you are comfortable reviewing and hardening it first: remove the shell `eval`, keep the TTS service bound to localhost, avoid remote HTTP TTS unless trusted, pin downloaded dependencies/models, and treat microphone recordings, transcriptions, and cached speech as sensitive local data.
bin/voice-agent.sh:106Configuration-Based Arbitrary Command Execution Through eval
bin/voice-agent.sh:162Predictable Audio Files in an Unverified Shared Temporary Directory
install.sh:50Mutable Third-Party Source Is Downloaded, Built, and Executed Without Integrity Pinning
SKILL.md:67Documentation Exposes the Unauthenticated TTS Service on All Network Interfaces
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
logs/
# Environment
.env
.venv/
venv/
The description significantly overstates what this code does. The supplied script only converts provided text into speech audio and optionally plays it back. It does not capture microphone input, transcribe speech, perform assistant logic, or provide end-to-end voice-to-voice interaction. Additionally, while the description emphasizes fully local/offline operation, the script depends on a configurable TTS server URL and a Python wrapper that may make HTTP requests, so this chunk does not itself prove exclusively local processing. Therefore the declared description does not accurately represent the actual behavior of this code chunk.
The description overstates completeness and functionality. The code does implement substantial voice pipeline behavior: dependency checks, microphone/audio-file input, transcription via a local STT script, TTS generation via a local helper, playback, and interactive looping. However, the central 'process_with_ai' function is explicitly a placeholder that only echoes canned text and says actual OpenClaw integration must be implemented. That makes the declared purpose of a complete OpenClaw voice assistant materially inaccurate. Additionally, while the setup appears intended for local use, it contacts a TTS server over HTTP and merely defaults to localhost based on config; the code chunk alone does not fully substantiate the strict '100% local processing' claim. The extra support for text input and audio-file processing is not harmful, but it is broader than the voice-only framing. Overall, this is a meaningful description-versus-behavior mismatch because the primary promised capability is not actually present.
The declared description presents a full offline voice-to-voice AI assistant with both STT and TTS capabilities and broader assistant use cases. The supplied code chunk only implements a command-line speech-to-text/transcription entrypoint. It checks for python3, PyYAML, and ffmpeg, parses model/language flags, and calls a local stt.py script on an audio file. That is consistent with a local transcription component, but it does not demonstrate the broader declared primary purpose of a complete voice-to-voice assistant, nor any text-to-speech, assistant logic, or voice cloning. This is therefore a material description-to-behavior mismatch rather than a mere partial implementation detail.
The declared description describes a full offline voice-to-voice assistant, implying both speech input and spoken output plus assistant behavior. The supplied code only implements STT/transcription via Whisper.cpp and microphone capture via ffmpeg. It does operate locally and does not use cloud APIs, which is consistent with part of the description, but the primary scope of the code chunk is much narrower than the declared capability set. This is a material description-to-behavior mismatch rather than a minor omission.
The manifest describes a complete voice-to-voice AI assistant for OpenClaw, implying real end-to-end assistant behavior. However, the core AI step is stubbed out with placeholder output instead of invoking OpenClaw, so the implemented behavior materially falls short of the stated capability.
The configuration text explicitly labels the TTS endpoint as a 'VPS instance' while the skill metadata claims '100% local processing, no cloud APIs.' Even though the current URL is localhost, this contradiction is security-relevant because it can mislead users about where audio-derived data may be sent, causing unintended exposure of speech content or generated outputs if deployed with a non-local endpoint.
The README makes strong privacy/security claims such as '100% local processing' and 'No Cloud APIs' while also documenting a configurable HTTP TTS endpoint that can be pointed at a non-local server. This can mislead users into believing voice data never leaves the machine, increasing the risk of accidental transmission of sensitive audio or text to remote infrastructure.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
export POCKET_TTS_URL="http://localhost:5000"
sudo apt-get install -y ffmpeg
### 2. Install Skill
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
export POCKET_TTS_URL="http://localhost:5000"
sudo apt-get install -y ffmpeg
### 2. Install Skill
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
export POCKET_TTS_URL="http://localhost:5000"
sudo apt-get install -y ffmpeg
### 2. Install Skill
The skill advertises and documents capabilities that involve shell execution, filesystem access, and network communication, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity where an agent may grant broader access than users expect, increasing the risk of unintended command execution, file access, or service communication.
The documentation instructs users to send voice recordings and receive generated responses through an HTTP service without warning that this data may contain sensitive personal or operational information. Even when the default endpoint is localhost, a local or misconfigured service can log, retain, proxy, or expose recordings and transcriptions, leading to privacy and confidentiality risks.
The description emphasizes fully local processing, but the code treats TTS as an HTTP service identified by a configurable URL and probes it with curl. While the default points to localhost, the implementation permits non-local endpoints, so the code does not enforce the manifest's strict local-only claim.
This code records from the system microphone and writes the captured audio to a temporary WAV file, which is a privacy-relevant operation. Although it prints that recording is starting, it does not clearly warn the user that spoken audio will be captured and stored in /tmp before transcription.
Caching STT/TTS artifacts creates retention of audio-derived data on disk, which can expose sensitive spoken content, transcriptions, or synthesized outputs to other local users, backups, or forensic recovery. In a voice-assistant context, this is more dangerous because users may speak passwords, personal data, health information, or private requests without realizing those artifacts persist.
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.
SKILLS_DIR="$HOME/.openclaw/workspace/skills/voice-agent"
echo -e "${YELLOW}📦 Installing to: $SKILLS_DIR${NC}"
mkdir -p "$SKILLS_DIR"
cp -r "$VOICE_AGENT_DIR"/* "$SKILLS_DIR/"
# Make scripts executable
The manifest emphasizes fully local processing with no cloud APIs, but this installer clones Whisper.cpp from GitHub and downloads a model over the network. While the runtime voice processing may remain local, the skill as delivered does perform remote network operations during installation, which materially exceeds the plain-language '100% local' claim.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
if ! command -v ffmpeg &> /dev/null; then
echo ""
echo -e "${YELLOW}⚠️ FFmpeg not installed${NC}"
echo -e "${BLUE}💡 Install with: sudo apt-get install -y ffmpeg${NC}"
else
echo -e "${GREEN}✅ FFmpeg already installed${NC}"
fi
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
if ! command -v ffmpeg &> /dev/null; then
echo ""
echo -e "${YELLOW}⚠️ FFmpeg not installed${NC}"
echo -e "${BLUE}💡 Install with: sudo apt-get install -y ffmpeg${NC}"
else
echo -e "${GREEN}✅ FFmpeg already installed${NC}"
fi
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
if ! command -v ffmpeg &> /dev/null; then
echo ""
echo -e "${YELLOW}⚠️ FFmpeg not installed${NC}"
echo -e "${BLUE}💡 Install with: sudo apt-get install -y ffmpeg${NC}"
else
echo -e "${GREEN}✅ FFmpeg already installed${NC}"
fi
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
return path
# Try system path
if subprocess.run(['which', 'whisper-cli'], capture_output=True).returncode == 0:
return 'whisper-cli'
raise FileNotFoundError(
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
wav_path = tmp.name
try:
subprocess.run([
'ffmpeg', '-i', audio_path,
'-ar', '16000', # 16kHz sample rate
'-ac', '1', # Mono
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'--no-timestamps' # Clean output without timestamps
]
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
# Extract transcription (last line after processing info)
output_lines = result.stdout.strip().split('\n')
The function records from the microphone immediately and proceeds to transcription with only a console status message, not a clear consent or privacy warning. In a voice-agent skill, microphone capture is sensitive data collection; if invoked unexpectedly by another component, it can capture private speech without informed user consent.