T09 · Insecure Skill Coding Practices
- Location
scripts/generate_keyframes_direct.py:38- Finding
Configurable ComfyUI Endpoint Can Disclose Project Prompts to an Arbitrary Host
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches a local video-generation pipeline, but it needs Review because it can run unpinned external Python code, send project prompts or media to configurable services, and perform disruptive local actions without enough scoping.
Install only after reviewing the scripts and using trusted local endpoints. Keep --comfy and --ace on loopback or a trusted HTTPS service, avoid the Qwen GUI fallback unless the module path is known and controlled, review project JSON before composition, expect Korean and adult-glamour defaults unless overridden, and require explicit confirmation before WSL shutdown or Telegram upload.
scripts/generate_keyframes_direct.py:38Configurable ComfyUI Endpoint Can Disclose Project Prompts to an Arbitrary Host
scripts/generate_character_anchor.py:74Configurable External Python Modules Are Imported and Executed Without Integrity Verification
scripts/compose.py:95Unvalidated Subtitle IDs Permit Path Traversal and FFconcat Directive Injection
The skill prescribes a specific ethnicity and national aesthetic ('adult Korean female protagonist' with 'Korean Instagram-model' styling) as the default when the user has not specified appearance. In a public creative tool, this is a biased and non-consensual default that can override user intent, narrow representation, and systematically inject demographic targeting into generated media without opt-in.
The skill describes broad capabilities including shell execution, file read/write, and network use, but declares no explicit tool scope or permissions boundary. In an agent setting, this increases the chance the skill is run with overly broad authority, enabling unintended command execution, local file modification, or network exfiltration beyond the user's expectations.
The description states that the pipeline produces a Korean subtitle script as part of its default behavior. This is a language-specific constraint presented without user opt-in or explanation that the skill is intended only for Korean-language use.
The skill instructs wsl --shutdown, which forcibly stops all WSL instances and can interrupt unrelated workloads, background services, or unsaved work on the host. Without a clear warning or confirmation step, an agent could execute a disruptive system-wide action that exceeds the user's likely expectation for a video pipeline.
The instruction to send output via the Telegram Bot API introduces an external data-transfer path that is not essential to the local generation pipeline and can move user-created media off the local system. That creates avoidable privacy and data-handling risk, especially if the content is sensitive or users assume the workflow remains entirely local.
Recommending Telegram Bot API delivery without a privacy warning can cause users to unknowingly transmit generated videos to a third-party platform. Even if the token is not pasted into logs, the omission of consent and privacy guidance makes accidental external disclosure more likely.
The guidance hard-codes a sexualized default protagonist specification, including body and attractiveness traits unrelated to character-consistency mechanics. In a general-purpose public video-generation skill, this can steer outputs toward objectifying or unsafe content without explicit user request, increasing the chance of policy-violating or inappropriate generated media.
The file embeds sexually explicit or strongly sexualized characterization defaults, but the skill metadata and surrounding documentation do not warn users that such defaults may be inserted into prompts. This creates a transparency and consent problem: users may unknowingly generate sexualized ad content, which is especially risky in a public pipeline and can lead to unsafe outputs if age is ambiguous.
The documentation instructs operators to save raw prompts and model responses to project files without warning about retention, sensitivity, or consent. In practice, prompts and responses can contain proprietary campaign ideas, personal data, or unsafe content, so silent persistence expands the risk of data leakage, unintended reuse, and compliance violations on shared local systems.
The skill embeds sexualized default casting and body-emphasizing prompt guidance as a normative default for ad generation, even when the user has not requested sexual content. This can steer outputs toward objectifying or sexually suggestive material, increasing safety, policy, and brand-risk exposure, and it becomes more concerning because the same section also discusses age-related exceptions, showing the author anticipated boundary issues rather than avoiding them by default.
The example subtitle script is explicitly in Korean, and elsewhere the document repeatedly centers a Korean creative default, but there is no opt-in or statement that the skill is region-specific. This creates a natural-language locale policy concern because the file effectively steers output to a specific language without user choice.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def probe_duration(path):
out = subprocess.check_output([
"ffprobe", "-v", "quiet", "-print_format", "json", "-show_streams", str(path)
], text=True)
v = next(s for s in json.loads(out)["streams"] if s["codec_type"] == "video")
The ffmpeg command embeds user-influenced subtitle text and font path into a filtergraph string. Although subprocess is not using a shell, ffmpeg's filter syntax has its own escaping rules; insufficient escaping can let crafted input break filter parsing, reference unintended files, or alter processing behavior, especially via drawtext=textfile= and an attacker-controlled --font value.
"-pix_fmt", "yuv420p", "-an", str(dst),
]
print(f" {sid}: {printed} + sub")
r = subprocess.run(cmd, capture_output=True, text=True)
if r.returncode != 0:
print(r.stderr[-1000:])
sys.exit(1)
The script generates an ffmpeg concat list from untrusted shot IDs and then runs ffmpeg with -safe 0, which disables path safety checks. If an attacker can control subtitle JSON keys or temp directory contents, they may inject arbitrary file entries into the concat manifest and cause unintended local file reads or processing of attacker-chosen files by ffmpeg.
), encoding="utf-8")
silent_out.parent.mkdir(parents=True, exist_ok=True)
cmd = ["ffmpeg", "-y", "-f", "concat", "-safe", "0", "-i", str(listfile), "-c", "copy", str(silent_out)]
r = subprocess.run(cmd, capture_output=True, text=True)
if r.returncode != 0:
print(r.stderr[-1000:])
sys.exit(1)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-filter_complex", af, "-map", "0:v", "-map", "[a]",
"-c:v", "copy", "-c:a", "aac", "-b:a", "192k", "-shortest", str(final),
]
r = subprocess.run(cmd, capture_output=True, text=True)
if r.returncode != 0:
print(r.stderr[-1000:])
sys.exit(1)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
sys.exit(2)
if actual_total > args.target_duration + 0.05:
trimmed = silent.with_name(silent.stem + "_trimmed.mp4")
r = subprocess.run([
"ffmpeg", "-y", "-i", str(silent), "-t", f"{args.target_duration:.3f}",
"-c", "copy", "-an", str(trimmed)
], capture_output=True, text=True)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def probe_size(video):
out = subprocess.check_output([
"ffprobe", "-v", "quiet", "-print_format", "json", "-show_streams", str(video)
], text=True)
stream = next(s for s in json.loads(out)["streams"] if s["codec_type"] == "video")
The script passes -y to ffmpeg, which forces overwriting the output file without prompting the user. If a user supplies an existing path, important local files could be unintentionally destroyed or replaced, especially in an automation pipeline where paths may be generated or reused.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-vf", vf,
"-frames:v", "1", "-update", "1", args.out,
]
subprocess.run(cmd, check=True)
print(Path(args.out).resolve())
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
wf = build_wf(d, in_name, prompt, seed, prefix)
body = json.dumps({"prompt": wf}).encode()
try:
res = json.loads(urllib.request.urlopen(
urllib.request.Request(f"{d['comfy']}/prompt", data=body,
headers={"Content-Type": "application/json"}),
timeout=60).read())
The script prepends a user-controlled directory to sys.path and then dynamically imports a user-controlled module name via import(). This creates a straightforward arbitrary code execution path because importing a Python module executes its top-level code, so any attacker who can influence --qwen-gui-dir or --module can run code in the context of the script.
args = ap.parse_args()
sys.path.insert(0, args.qwen_gui_dir)
qwen = __import__(args.module) # type: ignore
qwen.COMFYUI_URL = args.comfy
qwen.OUTPUT_DIR = args.output_dir
The script prepends a user-controlled directory to sys.path and then dynamically imports a user-controlled module name via import(). This can execute arbitrary Python code at import time if an attacker can influence --qwen-gui-dir or --module, making it a direct code-execution risk rather than a mere flexibility feature.
wanted = set(args.shots or [])
sys.path.insert(0, args.qwen_gui_dir)
qwen = __import__(args.module) # type: ignore
qwen.COMFYUI_URL = args.comfy
qwen.OUTPUT_DIR = args.output_dir
The script posts the generated workflow to a local HTTP endpoint and then polls history, which transmits user-provided shot instructions and reference-derived workflow data to another service. While this may be part of the implementation, the file provides no explicit runtime warning or confirmation that project content will be sent to the ComfyUI/Qwen service.
The script prepends a user-controllable directory to sys.path and then dynamically imports a user-controllable module name via import. If an attacker can influence --qwen-gui-dir or --module, they can cause arbitrary Python code to execute at import time, which is a direct code-execution risk on the host running the skill.
wanted = set(args.shots or [])
sys.path.insert(0, args.qwen_gui_dir)
qwen = __import__(args.module) # type: ignore
qwen.COMFYUI_URL = args.comfy
qwen.OUTPUT_DIR = args.output_dir
qwen.PROMPT_PREFIX = ""
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(cmd):
result = subprocess.run(cmd, text=True)
if result.returncode != 0:
raise SystemExit(result.returncode)