Back to skill

Security audit

Audio Editor

Security checks for vulnerabilities and agentic risk

Overview

This audio-editing skill includes an under-disclosed shell execution path that can run arbitrary commands instead of only audio operations.

Review before installing. This skill should not be used as-is unless the command execution path is removed, unsupported requests fail closed, ffmpeg arguments are passed safely without eval, and overwrite behavior is made explicit and user-controlled.

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

Error
Location
scripts/audio_run.sh:35
Finding
Arbitrary Shell Command Execution Through Unsafe eval<![CDATA[ ## Vulnerability Details **File Location**: `scripts/audio_run.sh`, lines 35-45 **Vulnerability Type**: OS command injection **Risk Level**: Critical ### Vulnerable Code ```bash else echo "$cmd" fi } # 主逻辑 COMMAND="$1" OUTPUT="${2:-$DEFAULT_OUTPUT}" AUDIO_CMD=$(parse_natural_language "$COMMAND" "$OUTPUT") echo "[OpenClaw] 执行音频命令:$AUDIO_CMD" eval "$AUDIO_CMD" ``` ### Technical Analysis The script accepts its first command-line argument as `COMMAND` and passes it to `parse_natural_language`. If the input does not match one of the recognized audio-processing patterns, the parser returns the supplied value unchanged: ```bash else echo "$cmd" fi ``` The returned text is assigned to `AUDIO_CMD` and executed by `eval`. Because `eval` interprets shell operators, substitutions, redirections, pipelines, and command separators, an attacker can provide an arbitrary shell command instead of an audio-processing instruction. Recognized operations are also assembled as command strings using attacker-controlled input and output values before reaching `eval`. In particular, the output argument is inserted into generated FFmpeg commands without shell-safe argument handling. This creates additional injection opportunities through shell metacharacters in the output value. ### Attack Path 1. An attacker invokes the script with an unrecognized command containing a shell payload: ```bash ./scripts/audio_run.sh 'id > /tmp/pwned' ``` 2. The input does not match the supported Chinese audio-command patterns. 3. The fallback branch emits `id > /tmp/pwned` unchanged. 4. Command substitution assigns that text to `AUDIO_CMD`. 5. `eval "$AUDIO_CMD"` parses and executes the payload. 6. The output of `id` is written to `/tmp/pwned`, demonstrating arbitrary command execution. A malicious output argument can also inject commands into a recognized operation because the output is concatenated into an FFmpeg command string and subsequently evaluat ...[truncated 783 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `eval` entirely. Never execute a string derived from user-controlled natural-language input. 2. Reject unsupported commands instead of returning and executing them: ```bash else printf '%s\n' "Unsupported audio operation" >&2 return 1 fi ``` 3. Invoke FFmpeg directly using separately quoted arguments: ```bash ffmpeg -y -i "$input" -vn -acodec mp3 "$output" ``` 4. Represent commands as Bash arrays if commands must be assembled dynamically: ```bash args=(ffmpeg -y -i "$input" -vn -acodec mp3 "$output") "${args[@]}" ``` 5. Validate all inputs: - Require input files to use explicitly supported media extensions. - Resolve and restrict paths to approved directories where appropriate. - Reject missing files and non-regular files. - Validate volume as a numeric value within an explicitly permitted range. - Reject output paths containing control characters and enforce an approved destination policy. 6. Use `set -euo pipefail` and quote every variable expansion, while recognizing that quoting alone does not make `eval` safe. 7. Add regression tests using command separators, substitutions, redirections, and crafted output paths to ensure they are treated as data rather than executable syntax. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (7)

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The script converts natural-language input into a shell command string and then executes it with eval. For unmatched input, parse_natural_language returns the raw user input unchanged, so an attacker can supply arbitrary shell commands unrelated to audio processing and achieve command execution with the user's privileges.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill description does not warn users that audio operations may modify files, create outputs in attacker- or user-specified locations, or overwrite existing content. Missing warnings increase the chance of unsafe use, especially when combined with broad natural-language editing and optional output paths that could affect sensitive files or produce unexpected filesystem changes.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The edit_audio command is activated by a very broad natural-language description ('自然语言执行音频处理') without constraints on permitted operations, target files, or safety checks. In a skill that can modify files and invoke ffmpeg-style processing, this can lead to unintended destructive edits, overwriting outputs, or execution of risky transformations from ambiguous user prompts.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Comments, trigger parsing, and user-facing log messages are all written for Chinese-language use, and the natural-language parser only recognizes Chinese phrases such as '提取音频' and '调整音量'. This imposes a specific language requirement without opt-in or documentation of a justified region-specific constraint.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The function is presented as natural-language parsing for audio actions, but when parsing fails it returns the original text for execution by the shell. This mismatch is dangerous because users may believe only audio-related intents are accepted, while arbitrary shell payloads can be smuggled through the 'unmatched' path.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script immediately executes the generated command and uses ffmpeg -y, which overwrites output files without prompting. In combination with user-supplied command text and a default output path, this can cause unintended file modification or destructive behavior without any confirmation step.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The natural-language descriptions, command explanations, and parameter notes are entirely in Chinese, which can impose a language requirement on users without opt-in. Under the policy, forced language or locale constraints should either offer user choice or be explicitly justified and documented.

Static analysis

No suspicious patterns detected.