T09 · Insecure Skill Coding Practices
- Location
tool.js:26- Finding
Arbitrary Command Execution Through Shell Command Injection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This transcription skill does what it claims, but it has serious unsafe execution and network-fetch behavior that should be reviewed before installation.
Review before installing. Do not use this skill with private recordings, signed URLs, internal service URLs, or confidential meeting audio unless the command-injection issue is fixed and you are comfortable sending the media to third-party transcription providers. A safer version should remove shell-string execution, restrict URL targets, enforce download limits during streaming, clean temporary files on failure, and add explicit external-upload disclosure and consent.
tool.js:26Arbitrary Command Execution Through Shell Command Injection
index.js:27Unrestricted URL Fetching Enables Server-Side Request Forgery and External Relaying of Responses
index.js:32Download Size Limit Bypass and Sensitive Temporary File Retention
The code builds a shell command by concatenating user-controlled values (url, language, and output_format) into a single string and passes it to execSync. This creates a command injection risk, allowing crafted input to break shell argument boundaries and execute arbitrary commands with the privileges of the process.
The skill explicitly routes user-provided media to third-party transcription services but does not warn users that their URLs and underlying audio/video content may be transmitted off-platform. This creates a privacy and consent risk, especially if users submit sensitive recordings, private links, or copyrighted material under the assumption processing is local or first-party only.
This skill declares transmission of user media to an external MyShell API for transcription. External transmission is risky here because uploaded media may contain sensitive speech, personal data, confidential business information, or authenticated file URLs, and the skill does not describe consent, minimization, or privacy safeguards.
此技能使用免费的 Whisper API 服务进行语音识别,无需 API Key,直接调用即可使用。
支持的免费 API 端点:
- https://api.myshell.ai/v1/audio/transcriptions (MyShell Whisper)
- https://api.openai.com/v1/audio/transcriptions (OpenAI,需要Key)
如果主要API不可用,会自动尝试备用方案。
The listed OpenAI transcription endpoint represents another third-party destination for user media, increasing data-sharing surface area and introducing possible credential, billing, and privacy concerns. Because the skill suggests automatic fallback, users may not know which external provider receives their content at runtime.
支持的免费 API 端点:
- https://api.myshell.ai/v1/audio/transcriptions (MyShell Whisper)
- https://api.openai.com/v1/audio/transcriptions (OpenAI,需要Key)
如果主要API不可用,会自动尝试备用方案。
The trigger list includes a very broad phrase, "免费转文字" (free transcription), which can match ordinary user requests that are not clearly intended to invoke this specific skill. Overly broad activation increases the chance of accidental invocation, causing users to send media URLs to an external service without clear intent or awareness.
The tool description says it uses a free Whisper API and requires no API key, but it does not clearly warn that user-supplied media URLs and potentially their contents will be transmitted to an external transcription service. This creates a privacy and consent risk, especially if users provide private recordings, internal meeting audio, or signed URLs that grant temporary access to sensitive files.
The skill is explicitly designed to send user-supplied audio/video content to an external API endpoint, which is a real external data transmission path. In this context, the danger is heightened because the tool downloads arbitrary remote media and forwards it to a third party, potentially exposing sensitive content without strong user awareness or administrative control.
// 配置
const CONFIG = {
// 首选免费 API (MyShell)
primaryApi: 'https://api.myshell.ai/v1/audio/transcriptions',
// 备用 API (OpenAI,需要Key时可配置)
backupApi: 'https://api.openai.com/v1/audio/transcriptions',
maxFileSize: 25 * 1024 * 1024, // 25MB
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
// 首选免费 API (MyShell)
primaryApi: 'https://api.myshell.ai/v1/audio/transcriptions',
// 备用 API (OpenAI,需要Key时可配置)
backupApi: 'https://api.openai.com/v1/audio/transcriptions',
maxFileSize: 25 * 1024 * 1024, // 25MB
};
The code reads the downloaded media file and uploads its full contents to a third-party transcription service without any explicit consent prompt, privacy notice, or host allowlisting. Because audio/video may contain sensitive personal, biometric, or confidential business information, silent transmission to an external service creates a real privacy and data-handling risk.
The transcription function defaults the language parameter to 'zh', and the tool description and CLI usage are written to assume Chinese by default. This can constitute a language/locale policy violation because the skill imposes a specific language choice unless the user explicitly overrides it.
The main entrypoint initializes the language setting to 'zh' before parsing any user input, meaning Chinese is selected even when the user does not request it. This is a natural-language policy concern because the tool forces a locale choice by default rather than obtaining user opt-in.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
cmd = ['ffmpeg', '-i', video_path, '-vn', '-acodec', 'pcm_s16le', '-ar', '16000', '-ac', '1', output_path, '-y']
try:
subprocess.run(cmd, check=True)
print(f"✅ 音频已提取: {output_path}")
return output_path
except subprocess.CalledProcessError:
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
print(f"✅ 音频已提取: {output_path}")
return output_path
except subprocess.CalledProcessError:
print("❌ ffmpeg 未安装,请先安装: sudo apt install ffmpeg")
return None
def transcribe_with_local(video_path, model='base', language='zh'):
The local transcription function defaults to language='zh', and the CLI also defaults --lang to zh, which means the skill assumes a specific language unless the user overrides it. This is a natural-language policy concern because the tool forces a locale choice rather than prompting or auto-detecting by default.
When the AssemblyAI mode is used, the script uploads local audio content to a third-party service without any explicit consent prompt, privacy warning, or data-handling notice. In a transcription tool, media commonly contains sensitive conversations or personal information, so silent external transfer can cause confidentiality and compliance issues.
This code transmits the contents of a local audio file to an external third-party endpoint. In the context of a video-to-text skill, uploaded media may contain confidential or regulated data, so outbound transfer is security-relevant and should not happen without clear user awareness and policy controls.
# 上传音频
with open(audio_path, 'rb') as f:
response = requests.post(
'https://api.assemblyai.com/v2/upload',
headers={'authorization': api_key},
files={'file': f}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 上传音频
with open(audio_path, 'rb') as f:
response = requests.post(
'https://api.assemblyai.com/v2/upload',
headers={'authorization': api_key},
files={'file': f}
)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 上传音频
with open(audio_path, 'rb') as f:
response = requests.post(
'https://api.assemblyai.com/v2/upload',
headers={'authorization': api_key},
files={'file': f}
)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 上传音频
with open(audio_path, 'rb') as f:
response = requests.post(
'https://api.assemblyai.com/v2/upload',
headers={'authorization': api_key},
files={'file': f}
)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
audio_url = response.json()['upload_url']
# 转写
response = requests.post(
'https://api.assemblyai.com/v2/transcript',
headers={'authorization': api_key},
json={'audio_url': audio_url, 'language_code': 'zh'}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
audio_url = response.json()['upload_url']
# 转写
response = requests.post(
'https://api.assemblyai.com/v2/transcript',
headers={'authorization': api_key},
json={'audio_url': audio_url, 'language_code': 'zh'}
The remote transcription branch always sends language_code 'zh' to the API, regardless of user input. This forces a specific language/locale in a way that is not optional or justified in the file.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
# 等待结果
import time
while True:
response = requests.get(
f'https://api.assemblyai.com/v2/transcript/{transcript_id}',
headers={'authorization': api_key}
)
The module comment and function docblock present the code as directly converting video/audio to text. In practice, the function's core behavior is to construct and execute a shell command string calling node on another script, which is a materially different operational behavior than the documentation suggests.
The skill accepts a video/audio file URL and passes it to another script for transcription, implying retrieval or transmission of remote content. The file contains no explicit warning to the user that a provided URL will be fetched/processed, beyond the parameter name and brief function description.