T09 · Insecure Skill Coding Practices
- Location
src/index.ts:239- Finding
Shell Command Injection Through Unescaped Video and Timestamp Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This video-editing skill appears purpose-built, but unsafe command handling could let crafted video paths or timestamps run unintended system commands.
Review before installing. Use it only in a constrained account or sandbox until the shell execution is fixed by replacing exec with execFile/spawn argument arrays and validating paths/timestamps. Treat processed videos, subtitles, and extracted audio as sensitive, confirm whether auto_upload should be disabled, and prefer pinned dependency versions or a lockfile.
src/index.ts:239Shell Command Injection Through Unescaped Video and Timestamp Arguments
src/index.ts:302Predictable and Race-Prone Temporary File Creation
requirements.txt:2Unpinned Python Dependencies Permit Unreviewed Package Changes
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
# Ubuntu/Debian
sudo apt update && sudo apt install -y ffmpeg
# macOS
brew install ffmpeg
The README advertises automatic video upload/download, editing, and subtitle generation but does not clearly warn users that their video content will be transferred and processed, which can expose sensitive media and embedded audio/text without informed consent. In a video-editing skill, this omission is especially important because videos often contain confidential visuals, voices, and metadata, so users may unknowingly trigger remote processing of private content.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Ubuntu/Debian
sudo apt update && sudo apt install -y ffmpeg
# macOS
brew install ffmpeg
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Ubuntu/Debian
sudo apt update && sudo apt install -y ffmpeg
# macOS
brew install ffmpeg
The skill processes user videos locally and states that uploads are automatic by default (auto_upload: true), but the warning is only indirect and does not clearly emphasize that edited videos, subtitles, and extracted audio may be sent back to Feishu cloud. This creates a real privacy and data-governance risk because users may submit sensitive media without understanding the default exfiltration path for derived artifacts.
User-facing descriptions, errors, help text, and command aliases are presented only in Chinese, which enforces a specific language experience without offering a user choice. The file does not document a justified locale restriction or provide multilingual/opt-in behavior.
The skill builds a shell command string with user-influenced values such as videoPath and extraArgs, then executes it via child_process.exec. Because exec invokes a shell, specially crafted input can trigger command injection and arbitrary OS command execution, which is especially dangerous in a video-processing skill that expects file paths from users.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'-y', output_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
return {
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'-y', output_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
return {
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'-y', output_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
return {
The subtitle generation API sets language: str = 'zh' and maps that default to 'chinese' during transcription, which imposes a specific language choice by default. This is a natural-language locale policy concern because the user is not offered an explicit language/locale choice before the skill assumes Chinese.
This helper creates a temporary filename with tempfile.mktemp and then asks ffmpeg to write to that path later, introducing a TOCTOU race on the filesystem. A local attacker could pre-create or replace the predictable temp path with a symlink or file, causing overwrite of unintended files or disruption of processing under the privileges of this program.
'-y', audio_path
]
subprocess.run(cmd, capture_output=True)
return audio_path
def _detect_silence(self, audio_path: str) -> list:
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'-y', output_path
]
subprocess.run(cmd, capture_output=True)
def _concat_video_clips(self, video_path: str, output_path: str,
ranges: list) -> None:
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'-y', output_path
]
subprocess.run(cmd, capture_output=True)
def _concat_video_clips(self, video_path: str, output_path: str,
ranges: list) -> None:
This invocation writes to a path produced by tempfile.mktemp, which is insecure because the filename is generated without atomically creating the file. An attacker with local filesystem access could race to create or symlink that path before ffmpeg writes to it, potentially leading to overwriting arbitrary files or corrupting workflow output.
'-c', 'copy', # 快速复制,不重新编码
'-y', temp_path
]
subprocess.run(cmd, capture_output=True)
# 创建文件列表
list_file = tempfile.mktemp(suffix='.txt')
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"author": "Spark",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.0.0",
"typescript": "^5.0.0"
},
"dependencies": {}
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"license": "MIT",
"devDependencies": {
"@types/node": "^20.0.0",
"typescript": "^5.0.0"
},
"dependencies": {}
}
The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens reproducibility and can expose consumers to newly introduced vulnerable or breaking releases through the supply chain, even though the file itself does not directly contain exploitable code.
# Python 依赖(视频处理)
openai-whisper>=20230314
librosa>=0.10.0
pydub>=0.25.1
pysrt>=1.1.2
Using an unpinned version for librosa means installations are not deterministic and may pull in unexpected upstream changes or vulnerable releases. In a requirements manifest, this is a real supply-chain hygiene weakness rather than an immediate runtime exploit.
# Python 依赖(视频处理)
openai-whisper>=20230314
librosa>=0.10.0
pydub>=0.25.1
pysrt>=1.1.2
numpy>=1.24.0
The pydub dependency is not pinned to a specific release, so the environment may resolve to different versions across installs. This increases supply-chain risk and makes it harder to verify whether deployed versions contain known vulnerabilities or incompatible changes.
# Python 依赖(视频处理)
openai-whisper>=20230314
librosa>=0.10.0
pydub>=0.25.1
pysrt>=1.1.2
numpy>=1.24.0
The pysrt package is declared with only a minimum version, which permits uncontrolled upgrades during installation. That creates a genuine but low-severity dependency management weakness because vulnerable or malicious upstream versions could be selected later.
openai-whisper>=20230314
librosa>=0.10.0
pydub>=0.25.1
pysrt>=1.1.2
numpy>=1.24.0
# 飞书 SDK(可选,如果用 Python 调用)
NumPy is unpinned, so consumers cannot know which exact release will be installed. Because NumPy has had multiple advisories historically, leaving the version open-ended makes risk assessment and patch verification difficult and can expose deployments to vulnerable versions.
librosa>=0.10.0
pydub>=0.25.1
pysrt>=1.1.2
numpy>=1.24.0
# 飞书 SDK(可选,如果用 Python 调用)
# lark-oapi>=1.0.0
The manifest references numpy without pinning an exact version, while known advisories exist for some NumPy releases. Because the actual installed version is unverifiable from this file, consumers may unknowingly install an affected release, making this a real supply-chain and patch-management concern.
The description is written only in Chinese ("AI 视频剪辑 Skill - MVP 版本"), which may impose a language expectation without offering any user choice or documenting a locale-specific purpose. Under the policy rule for language/locale, this can be a natural-language policy concern when no opt-in or justification is provided in the file.
saveConfigTemp writes a JSON config file into /tmp for each operation, which modifies the local filesystem. This file contains no user-facing disclosure in help text or operation messages that temporary files are created as part of processing.
No suspicious patterns detected.