Back to skill

Security audit

Tts Responder

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it advertises, but it sends generated responses through Telegram when credentials are present and leaves audio output in a predictable shared temp file.

Install only if you are comfortable with response content being sent to a configured Telegram chat. Avoid using it for sensitive conversations until the skill declares its Telegram credentials clearly, requires explicit send control, and uses private per-run temporary files with full cleanup.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
tts-responder.sh:7
Finding

Predictable Shared Temporary Files Permit Disclosure, Races, and File Clobbering

Content
View full analysis

Vulnerability Details

File Location: tts-responder.sh, lines 7–8, 20–23, 29, and 37
Vulnerability Type: Predictable and insecure temporary-file handling
Risk Level: Medium

Vulnerable Code

bash
OUTPUT_WAV="/tmp/tts-output.wav"
OUTPUT_OGG="/tmp/tts-output.ogg"
bash
piper --model "$VOICE" --output_file "$OUTPUT_WAV" --length_scale $(echo "$SPEED" | awk '{print 1/$1}') <<< "$TEXT"

ffmpeg -y -i "$OUTPUT_WAV" -c:a libopus -b:a 32k -ar 48000 "$OUTPUT_OGG" > /dev/null 2>&1
bash
-F "voice=@${OUTPUT_OGG}" \
bash
rm -f "$OUTPUT_WAV"

Technical Analysis

The script stores generated audio under fixed, globally predictable names in the shared /tmp directory. It neither creates a private temporary directory nor securely creates and validates the output files before passing their paths to Piper and FFmpeg.

Because the filenames are known in advance, another local user or process can pre-create, replace, inspect, or link these paths. In particular, symbolic-link or race-condition attacks may cause the audio tools to operate on attacker-selected files. The use of ffmpeg -y explicitly permits overwriting the destination without confirmation.

Every invocation also shares the same filenames. Concurrent runs can overwrite or consume each other's intermediate files, potentially sending audio generated from the wrong input. Only the WAV file is deleted; /tmp/tts-output.ogg remains after execution and may disclose synthesized conversation content depending on file permissions and the process umask.

Attack Path

  1. A local attacker predicts /tmp/tts-output.wav or /tmp/tts-output.ogg.
  2. Before or during execution, the attacker creates a symbolic link at one of those paths to a file writable by the victim account, or repeatedly replaces the path during processing.
  3. Piper or FFmpeg follows or operates on the attacker-controlled path. In the OG ...[truncated 1196 chars]
Remediation
View remediation

Remediation Suggestions

Create a private temporary directory for each invocation, restrict its permissions, and remove it on every exit path:

bash
umask 077
TMP_DIR="$(mktemp -d "${TMPDIR:-/tmp}/tts-responder.XXXXXX")"
trap 'rm -rf -- "$TMP_DIR"' EXIT HUP INT TERM

OUTPUT_WAV="$TMP_DIR/output.wav"
OUTPUT_OGG="$TMP_DIR/output.ogg"

Additional hardening measures should include:

  • Never reuse fixed temporary paths across invocations.
  • Keep both generated files inside the private directory.
  • Remove the entire directory through an EXIT trap so cleanup also occurs after command failures.
  • Ensure output files are created with owner-only permissions.
  • Avoid operating on paths that may have been replaced by untrusted local processes.
  • Do not preserve the final OGG unless persistence is explicitly required; if it must be retained, place it in a private application-owned directory with restrictive permissions and a unique filename.
  • Consider serialization or request-specific identifiers if the surrounding integration can launch concurrent jobs.
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 28)May include surrounding context.

Instalación en Ubuntu/Debian:

bash
sudo apt-get update
sudo apt-get install -y piper ffmpeg sox

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 29)May include surrounding context.

Instalación en Ubuntu/Debian:

bash
sudo apt-get update
sudo apt-get install -y piper ffmpeg sox

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly states that generated audio is sent via the Telegram API, which means response content leaves the local system and is transmitted to an external service. Even if the TTS synthesis is local, users may assume the whole flow is local unless the data-transfer/privacy implication is clearly disclosed, creating a real privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

No manifest is available, so there is no declared purpose establishing that sending generated audio to an external Telegram chat is in scope. The code does more than local text-to-speech conversion by conditionally uploading the output and a text-derived caption to a remote service using environment-provided credentials.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script sends synthesized audio and a caption derived from user text to Telegram without an explicit user-facing warning at runtime. In an agent skill context, this can expose sensitive prompts or generated content to an external service unexpectedly, especially if environment credentials are already set.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The script performs an external POST to the Telegram Bot API carrying generated audio and a text-derived caption. In a skill/agent setting, undisclosed outbound transmission can leak potentially sensitive content to a third party, making the context more dangerous than a standalone user-invoked utility.

Content

Scanner excerpt · tts-responder.sh (reported line 28)May include surrounding context.

sh
# 3. Enviar por Telegram (requiere BOT_TOKEN y CHAT_ID en variables de entorno)
if [[ -n "${BOT_TOKEN:-}" && -n "${CHAT_ID:-}" ]]; then
  curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendVoice" \
    -F "chat_id=${CHAT_ID}" \
    -F "voice=@${OUTPUT_OGG}" \
    -F "caption=${TEXT:0:100}..." > /dev/null

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The configuration specifies a default voice model es_ES/carlfm/x_low, which imposes a Spanish locale by default. The file does not explicitly present this as an opt-in language choice or explain that the skill is intentionally Spanish-specific, creating a minor language/locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Natural-language strings and the default voice model are hardcoded to Spanish (es_ES), which imposes a language/locale choice by default. The file does not present this as an opt-in preference or explain that the tool is intentionally limited to Spanish output.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script accesses BOT_TOKEN and CHAT_ID to authenticate and target a Telegram API request. Without a manifest or declared purpose indicating that the skill is a messaging or notification tool, this credential-driven remote capability is unjustified by the available intent context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script relies on BOT_TOKEN and CHAT_ID from the environment to perform external delivery, which involves credential use. While the comment notes the requirement, there is no user-visible notice at execution time that stored credentials will be used to contact a third-party service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.