T09 · Insecure Skill Coding Practices
- Location
scripts/tts_simple.py:103- Finding
Unrestricted API Endpoint Can Receive API Credentials and User-Supplied Text
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill coherently provides text-to-speech generation, but users should know their text and API key may be sent to the configured online TTS provider.
Install this only if you are comfortable sending TTS input text to Microsoft edge-tts or to the OpenAI-compatible API endpoint you configure. Avoid putting secrets or private regulated data in text to synthesize, use a trusted HTTPS API URL, prefer environment variables over command-line API keys, and consider pinning dependencies in a virtual environment before use.
scripts/tts_simple.py:103Unrestricted API Endpoint Can Receive API Credentials and User-Supplied Text
requirements.txt:11Unpinned Third-Party Dependencies Allow Non-Reproducible and Potentially Unsafe Installations
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
The skill documents capabilities that read environment variables, read files, and write output files, but it does not declare any tool scope or permission boundary. In an agent ecosystem, missing explicit scope can cause the orchestrator or reviewer to underestimate what the skill can access, increasing the chance of unintended file or secret exposure.
The trigger list includes broad natural-language phrases like '语音回复' and '语音对话' that could match ordinary conversation and invoke the skill unexpectedly. Because this skill can write files and send user text to external TTS services, overbroad activation raises the risk of accidental data processing or transmission without clear user intent.
The skill supports online synthesis via Microsoft edge-tts and OpenAI-compatible APIs, but the description does not prominently warn that input text may be transmitted to third-party services. Users may provide sensitive content expecting local processing, causing unintentional disclosure of private or regulated data.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
python3 scripts/tts_simple.py "你好" --engine api
--api-url https://api.openai.com/v1
--api-key sk-xxx
--voice alloy
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Install: pip install -r requirements.txt
#
# ⚠️ System dependencies required (install separately):
# Ubuntu/Debian: sudo apt install ffmpeg libopus-tools
# macOS: brew install ffmpeg
# Windows: download ffmpeg and add to PATH
This script sends user-provided text to the external edge-tts service for synthesis, which means potentially sensitive content leaves the local environment. The code and metadata describe an online TTS backend, but there is no explicit warning, consent prompt, or privacy notice at the point of transmission, so users may unknowingly disclose confidential text.
The function default sets voice="zh-CN-XiaoxiaoNeural", which imposes a specific language/locale choice by default. The file does not document that this locale is required for a region-specific purpose or ask the user to opt in before using it.
The command-line interface defaults --voice to zh-CN-XiaoxiaoNeural, meaning the skill will use a specific language/locale unless the user overrides it. This is a natural-language locale policy concern because no opt-in or documented justification is provided in the file.
The manifest states edge-tts performs online synthesis, while the inline dependency comment labels it as "offline." This is a direct documentation contradiction about how the TTS backend operates, which could mislead users about network usage and runtime behavior.
Using a lower-bound version specifier for edge-tts allows future releases to be installed automatically, which can introduce breaking changes or newly vulnerable versions without review. In a supply-chain context, this reduces build reproducibility and makes it harder to verify exactly what code is deployed.
# ── Core TTS ─────────────────────────────────────────────────────────────────
# edge-tts: Microsoft Neural TTS (free, high quality, offline)
edge-tts>=7.0.0
# ── API Support ───────────────────────────────────────────────────────────────
# For OpenAI-compatible API TTS
An unpinned openai dependency permits installation of any later major/minor release satisfying the constraint, creating supply-chain and reproducibility risk. If a compromised or incompatible version is resolved, the skill could behave unexpectedly or inherit vulnerable transitive code.
# ── API Support ───────────────────────────────────────────────────────────────
# For OpenAI-compatible API TTS
openai>=1.0.0
# ── Audio Conversion ─────────────────────────────────────────────────────────
# av (PyAV): audio/video conversion, required for OGG/Opus conversion
The av package is unpinned, so builds may resolve to different versions over time, which is particularly relevant for media-processing libraries that often wrap complex native components. This increases supply-chain exposure and makes it difficult to guarantee that deployed environments are free from known defects.
# ── Audio Conversion ─────────────────────────────────────────────────────────
# av (PyAV): audio/video conversion, required for OGG/Opus conversion
av>=10.0.0
# ── Core ─────────────────────────────────────────────────────────────────────
aiohttp>=3.8.0
Leaving aiohttp unpinned exposes the skill to non-deterministic dependency resolution and potential installation of versions affected by known advisories. Because aiohttp is a network-facing library, unresolved version drift can materially increase attack surface if vulnerable releases are pulled in.
av>=10.0.0
# ── Core ─────────────────────────────────────────────────────────────────────
aiohttp>=3.8.0
The manifest references aiohttp without pinning a version even though the package has multiple known advisories, making it impossible to determine from this file whether installations will be safe. In a skill that performs network operations, an affected aiohttp version could expose the runtime to request-handling, header-injection, cookie, or denial-of-service issues depending on actual usage.
The argument help says the output audio file may be ".ogg for voice, .mp3 for API" and exposes a --keep-mp3 flag, implying API mode can retain MP3 output. In practice, tts_with_api always writes MP3 temporarily, converts it to OGG, deletes the MP3, and the --keep-mp3 flag is never used, so the documentation contradicts actual behavior.
No suspicious patterns detected.