Back to skill

Security audit

Telegram Voice To Voice Macos

Security checks for vulnerabilities and agentic risk

Overview

This Telegram voice skill is mostly coherent, but its fallback can transcribe the newest stored voice message instead of one tied to the current chat, which could expose another user's audio.

Install only if you are comfortable with local Telegram voice files being read and generated voice replies being stored locally. Avoid using the pathless transcription fallback in shared or multi-user environments; require an attachment path tied to the current Telegram message before transcribing.

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
scripts/transcribe_telegram_ogg.sh:4
Finding
Unscoped Audio Fallback May Transcribe Another User's Voice Message## Vulnerability Details **File Location**: `scripts/transcribe_telegram_ogg.sh`, lines 4–7; behavior is also recommended in `SKILL.md`, lines 42–47 **Vulnerability Type**: Cross-user data exposure caused by insecure file selection **Risk Level**: Medium ### Vulnerable Code ```bash OGG_PATH="${1:-}" if [[ -z "${OGG_PATH}" ]]; then OGG_PATH="$(ls -t "${HOME}/.openclaw/media/inbound"/*.ogg 2>/dev/null | head -n 1 || true)" fi ``` The corresponding skill instructions state: ```markdown Recommended approach: 1) If the inbound message context includes an attachment path, use it. 2) Otherwise, take the most recent `*.ogg` from `~/.openclaw/media/inbound/`. ``` ### Technical Analysis When no explicit attachment path is supplied, the script selects the most recently modified OGG file from a shared inbound-media directory. It does not verify that the selected file belongs to the current Telegram sender, chat, message, or invocation. File recency is not an authorization or ownership boundary. In concurrent or multi-user deployments, the newest file can belong to an unrelated conversation. The script will then pass that file to `yap` for transcription: ```bash yap transcribe --locale "${YAP_LOCALE}" "${OGG_PATH}" ``` The resulting transcript may influence or be included in a response sent to the wrong user. The implementation therefore creates a cross-conversation data-isolation flaw even though its shell arguments are quoted and no command injection was identified. ### Attack Path 1. A victim sends a private Telegram voice note, which OpenClaw stores as an OGG file under `~/.openclaw/media/inbound/`. 2. Another user triggers the skill in a conversation where no trusted attachment path is available or passed to the helper. 3. Before the fallback selection occurs, the victim's file is the most recent OGG file in the shared directory. 4. The helper selects the victim's file solely according to modification time. 5. `yap` transcribes the victim's voice note in ...[truncated 835 chars]
Remediation
## Remediation Suggestions 1. Remove the global “most recent OGG” fallback and require an explicit attachment path for every transcription. 2. Obtain the path from trusted Telegram/OpenClaw message metadata and bind it to the current message, chat, and sender. 3. Fail closed when attachment metadata is absent or ambiguous rather than selecting an unrelated file by modification time. 4. Canonicalize the supplied path and verify that it resides within the intended inbound-media directory. 5. Where platform metadata permits, verify that the attachment identifier and file ownership metadata match the active invocation. 6. Prefer per-chat or per-message directories so files from unrelated conversations do not share the same selection namespace. 7. Update `SKILL.md` to remove the recommendation to select the newest shared OGG file. 8. Add concurrency tests covering multiple users uploading voice notes at nearly the same time and confirm that each invocation can process only its associated attachment. A safer minimal behavior would be: ```bash OGG_PATH="${1:-}" if [[ -z "${OGG_PATH}" ]]; then echo "ERROR: an attachment path tied to the current message is required" >&2 exit 2 fi INBOUND_ROOT="${HOME}/.openclaw/media/inbound" CANONICAL_ROOT="$(cd "${INBOUND_ROOT}" && pwd -P)" CANONICAL_FILE="$(cd "$(dirname "${OGG_PATH}")" 2>/dev/null && printf '%s/%s\n' "$(pwd -P)" "$(basename "${OGG_PATH}")")" if [[ ! -f "${CANONICAL_FILE}" || "${CANONICAL_FILE}" != "${CANONICAL_ROOT}/"* ]]; then echo "ERROR: invalid inbound attachment path" >&2 exit 2 fi ``` Path containment validation should supplement—not replace—message-level ownership validation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared description presents a full Telegram voice-to-voice workflow with both inbound voice transcription and outbound Telegram voice-note replies. The provided code chunk only implements text-to-speech plus audio conversion on macOS using `say` and `ffmpeg`. It does not read or transcribe `.ogg` input, does not invoke yap or Speech.framework, and does not interact with Telegram APIs or send replies. While the outbound OGG generation aligns with part of the description, the overall declared purpose materially overstates the implemented behavior.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The skill reads inbound Telegram voice attachments from local disk and stores per-user reply preferences in a workspace file, but the top-level description does not clearly warn users about this local data handling. While this is not direct code execution or privilege escalation, insufficient disclosure can lead to unexpected retention of user-linked data and voice artifacts, which is a privacy and transparency issue.

Missing User Warnings

Low
Confidence
90% confidence
Finding
The script removes the intermediate AIFF file with `rm -f` after conversion, but there is no user-facing warning beyond internal comments that a generated file will be deleted. For a code file, file deletion is a safety-relevant operation and this script provides no prompt, visible disclosure, or external documentation in the file itself.

Static analysis

No suspicious patterns detected.