Back to skill

Security audit

Audio Gen 1.0.0

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate audio-generation purpose, but its command examples handle generated text in a way that could let crafted content run unintended shell commands.

Review before installing. This skill should only be used in an environment that safely passes script text and output paths to the TTS tool without shell parsing, and users should avoid sensitive content because script text is sent to external providers and can incur API costs.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:192
Finding

Shell Command Injection Through Heredoc-Based TTS Input

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 192-199
Vulnerability Type: Shell command injection through unsafe heredoc construction
Risk Level: High

The skill instructs the agent to embed generated, user-influenced script content directly into shell source:

bash
uv run /home/clawdbot/clawdbot/skills/sag/scripts/tts.py \
  -o /tmp/audio-gen-[timestamp]-[topic-slug].mp3 \
  -m eleven_multilingual_v2 \
  "$(cat <<'EOF'
[formatted_script]
EOF
)"

Technical Analysis

Using a quoted heredoc delimiter prevents parameter and command expansion inside the intended heredoc body, but it does not prevent untrusted content from terminating the heredoc. A generated script containing a line consisting exactly of EOF closes the heredoc prematurely.

Any subsequent lines are parsed as shell syntax inside the command substitution. Because the script is generated from user-supplied topics and instructions, an attacker can request content containing a standalone delimiter followed by a shell command. The documentation provides no validation, delimiter randomization, or non-shell transport mechanism.

For example, an attacker-controlled script segment could conceptually take this form:

text
Ordinary narration.
EOF
attacker-controlled-command

When inserted into the documented command template, the second line ends the heredoc and the third line is interpreted by the shell rather than passed to the TTS program.

Attack Path

  1. An attacker requests audio content and causes the generated script to include a line containing only EOF.
  2. The attacker places shell syntax on one or more following lines.
  3. The agent follows the documented long-script workflow and interpolates that content into the heredoc command.
  4. The shell treats the injected EOF as the heredoc terminator.
  5. The following attacker-controlled text executes as shell commands with the privileges of the ...[truncated 614 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not interpolate generated or user-controlled text into shell source.
  • Invoke the TTS program through a process API that accepts an argument array rather than a shell command.
  • Prefer sending the script through the child process's standard input.
  • If the TTS program requires a file, create it with a secure temporary-file API, write the content through a file API, and pass the resulting path as a discrete argument.
  • Do not rely solely on a fixed or quoted heredoc delimiter. Randomizing the delimiter reduces accidental collisions but is not an adequate replacement for avoiding shell interpretation.
  • Apply execution timeouts and environment allowlisting. Pass only the environment variables required by the TTS process.
  • Add regression tests containing standalone EOF lines, command substitutions, quotes, newlines, and shell metacharacters to verify that all content is treated strictly as data.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:185
Finding

Unquoted User-Derived Output Path and Predictable Temporary File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 185-195
Vulnerability Type: Unsafe shell argument construction and insecure temporary-file handling
Risk Level: Medium

The documented commands construct an output path from a timestamp and topic slug, place it in a shared temporary directory, and pass it to the shell without quoting:

bash
uv run /home/clawdbot/clawdbot/skills/sag/scripts/tts.py \
  -o /tmp/audio-gen-[timestamp]-[topic-slug].mp3 \
  -m eleven_multilingual_v2 \
  "[formatted_script]"

The same unsafe output construction is repeated for long scripts:

bash
uv run /home/clawdbot/clawdbot/skills/sag/scripts/tts.py \
  -o /tmp/audio-gen-[timestamp]-[topic-slug].mp3 \
  -m eleven_multilingual_v2 \
  "$(cat <<'EOF'
[formatted_script]
EOF
)"

Technical Analysis

The topic originates from a user request, but the skill does not define a strict slug-generation or validation procedure. If shell metacharacters, whitespace, substitutions, or option-like text survive slug construction, the unquoted output path can be split or interpreted by the shell rather than passed as one literal argument.

The timestamp-based filename is also potentially predictable and is stored under the shared /tmp namespace. If the TTS implementation opens the destination path normally, another local user may be able to pre-create a symbolic link at the expected path. The generated audio could then overwrite a different file writable by the agent account. The external sag/scripts/tts.py implementation is not included in the audited project, so whether it applies secure no-follow and exclusive-creation protections could not be verified.

Attack Path

Unquoted-path scenario:

  1. An attacker supplies a crafted topic containing characters that are unsafe in shell source.
  2. The agent derives a topic slug without strict allowlist validation.
  3. The slug is inserted into the unquo ...[truncated 1291 chars]
Remediation
View remediation

Remediation Suggestions

  • Generate output files with a secure temporary-file API that uses cryptographically unpredictable names and atomic exclusive creation.
  • Create a private temporary directory owned by the agent account with permissions such as 0700.
  • Reject symbolic links and use no-follow semantics when opening output files where supported.
  • Define a strict slug allowlist, such as ASCII letters, digits, underscores, and hyphens. Enforce a conservative maximum length.
  • Never treat sanitization as the sole command-injection defense. Invoke the process with an argument array so the output path is passed as one argument without shell parsing.
  • If shell invocation cannot be eliminated, quote every dynamic path using a robust shell-escaping routine rather than manual concatenation.
  • Ensure the external TTS implementation refuses to overwrite existing files unless explicitly required.
  • Add tests covering spaces, leading hyphens, path separators, quotes, command substitutions, semicolons, newlines, and pre-existing symbolic links.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

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

md
---
name: audio-gen
description: Generate audiobooks, podcasts, or educational audio content on demand. User provides an idea or topic, Claude AI writes a script, and ElevenLabs converts it to high-quality audio. Supports multiple formats (audiobook, podcast, educational), custom lengths, and voice effects. Use when asked to create audio content, make a podcast, generate an audiobook, or produce educational audio. Returns MP3 audio file via MEDIA token.
homepage: https://github.com/clawdbot/clawdbot
metadata: {"clawdbot":{"emoji":"🎙️","requires":{"skills":["sag"],"env":["ANTHROPIC_API_KEY","ELEVENLABS_API_KEY"]},"primaryEnv":"ANTHROPIC_API_KEY"}}
---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill sends user-provided topics or scripts to external APIs including Anthropic and ElevenLabs, and it also incurs billable usage, but the top-level description does not warn users up front. This can lead to inadvertent disclosure of sensitive content and unexpected cost-generating actions, especially when invoked from a broader agent workflow where users may not realize third parties are involved.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language limitation says the skill is 'Primarily English' and that content generation is optimized for English, but it does not present language choice as optional or ask for user preference. This can amount to a locale/language policy violation because the skill defaults users into English rather than offering an explicit opt-in or clearly justified regional constraint.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The technical notes state that generated audio is stored in /tmp/audio-gen/, but the actual command examples write to /tmp/audio-gen-[timestamp]-[topic-slug].mp3 without that subdirectory. This is a direct contradiction between documentation and instructed behavior, even though the impact appears limited to operator expectations rather than expanded capability.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.