T09 · Insecure Skill Coding Practices
- Location
SKILL.md:19- Finding
Command Injection Through Unquoted Inbound Audio File Paths
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 19–24
Vulnerability Type: OS command injection through unsafe path interpolation
Risk Level: Hightext /usr/bin/ffmpeg -i {input_file} -ar 16000 -ac 1 -c:a pcm_s16le {input_file}.wav Hinweis: Die Zieldatei heißt input_file.wav (Beispiel: /.../aufnahme.ogg → /.../aufnahme.wav) 2) Transkription - Transkribiere die WAV-Datei: /home/sirko/.openclaw/workspace/whisper.cpp/build/bin/whisper-cli -l DE -np -m /home/sirko/.openclaw/workspace/whisper.cpp/models/ggml-small.bin -f {input_wav_file}Technical Analysis
The skill instructs the agent to insert an inbound, potentially attacker-influenced file path directly into command lines. Neither
{input_file}nor{input_wav_file}is quoted, validated, or passed through an argument-safe execution mechanism.If these command templates are executed through a shell, shell metacharacters in a crafted filename—such as command separators, substitutions, redirections, or whitespace—can alter the intended command structure. Merely quoting a path would reduce some risks but would not be as robust as invoking the executables without a shell and supplying each argument separately.
The vulnerability affects both the FFmpeg conversion command and the Whisper transcription command.
Attack Path
- An attacker causes an audio file with a shell-significant filename to be placed in the monitored inbound media directory.
- The skill receives that attacker-controlled path as
{input_file}. - The agent substitutes the path into the documented FFmpeg command without validation or argument-safe handling.
- If the command is passed to a shell, the shell interprets metacharacters in the filename as command syntax rather than as literal filename characters.
- The injected command executes under the identity and privileges of the agent process.
- The same injection condition can occur when the generated WAV pa ...[truncated 668 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not construct shell command strings from inbound file paths. Invoke FFmpeg and Whisper using an API that accepts an argument array and disables shell interpretation.
- Canonicalize the input path and verify that it remains inside the approved inbound media directory.
- Require the input to be a regular file and reject symbolic links or other special file types where appropriate.
- Apply an explicit filename and extension policy. Reject control characters, shell metacharacters, unexpected whitespace, and unsupported media extensions.
- Generate the output WAV path independently using a trusted temporary directory and a random filename rather than deriving a shell command argument directly from the untrusted input name.
- Prevent option injection by using argument arrays and an end-of-options marker where supported.
- Run media processing under a dedicated, least-privileged account with restricted filesystem and network access.
- Add tests covering filenames containing spaces, quotes, semicolons, command substitutions, leading hyphens, newlines, and path traversal sequences.
