T09 · Insecure Skill Coding Practices
- Location
scripts/platform-render.py:216- Finding
Unescaped Title and CTA Values Permit FFmpeg Filter-Graph Injection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Roblox video helper is mostly purpose-aligned, but it needs Review because its FFmpeg wrappers have unsafe text/path handling, silent overwrite behavior, and documentation that overstates implemented editing features.
Install only if you are comfortable running local FFmpeg/Python media scripts from this package. Use trusted input values for titles, CTAs, subtitle paths, music paths, and output paths; avoid letting untrusted text or filenames flow into the rendering commands. Expect existing output files to be replaced, and pin/review Python dependencies before use in a production or team environment.
scripts/platform-render.py:216Unescaped Title and CTA Values Permit FFmpeg Filter-Graph Injection
scripts/caption-sync.py:107Incomplete Subtitle-Path Escaping Permits FFmpeg Filter Injection
SKILL.md:124Unpinned Third-Party Dependencies Create a Mutable Supply-Chain Boundary
The declared description promises an end-to-end promotional video creation/editing tool, but the supplied code only performs footage analysis. It reads a local video file, invokes ffprobe/ffmpeg to detect scene changes, silence, and audio levels, then writes analysis results and recommendations to JSON. While this analysis could support smart trimming, it does not implement the core advertised capabilities of producing edited TikTok/Shorts/Reels content, adding captions, syncing music, converting aspect ratios, or applying overlays. Therefore the actual behavior is materially narrower and different from the declared primary purpose.
The declared description suggests a broad end-to-end promotional video editing pipeline for Roblox gameplay footage. However, the supplied code chunk implements only one narrow feature: generating synchronized captions from audio and optionally embedding them into the video. There is no evidence of clip selection, trimming, reframing for TikTok/Shorts/Reels, music synchronization, branding overlays, or general promotional content assembly. While captions are one part of the declared feature set, the code’s primary purpose is materially narrower than the declared purpose, so this is a clear description-behavior mismatch.
The description claims a broad promotional-video creation tool for Roblox recordings, including multiple concrete editing features. The code chunk only performs music analysis on an input audio file using librosa and outputs beat/peak metadata plus suggested cut points. Although music synchronization is mentioned in the description, even the video sync function here is a stub and does not actually edit video. This is therefore a material mismatch in primary purpose and implemented capabilities.
The code generally aligns with the stated purpose of rendering promotional social video variants from gameplay footage, but there are meaningful description/behavior gaps. Aspect ratio conversion, optional music, and brand/title/CTA overlays are implemented. Analysis-based segment selection exists, but the selected segments are never actually used to cut and concatenate clips in the FFmpeg command, so 'smart trimming' is not truly carried out as described. The description also explicitly includes captions, but the code has no caption-generation or subtitle-overlay implementation; it only supports simple drawtext title/CTA overlays. Finally, the declaration emphasizes TikTok, YouTube Shorts, and Reels, while the code supports a generic 'youtube' 16:9 output rather than a dedicated Shorts mode. These are substantive mismatches in represented capability, though the overall domain and intent are close.
The skill advertises and demonstrates shell execution and output file creation, but it does not declare any tool scope such as allowed-tools or permissions. In an agent environment, this can lead to overbroad execution authority, making it easier for the skill to invoke shell commands or write files without explicit review or least-privilege constraints.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
### Smart Trimming
Automatically removes:
- Menu screens
- Loading screens
- AFK/idle moments
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format", "-show_streams",
video_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"ffprobe failed: {result.stderr}")
return json.loads(result.stdout)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format", "-show_streams",
video_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"ffprobe failed: {result.stderr}")
return json.loads(result.stdout)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format", "-show_streams",
video_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"ffprobe failed: {result.stderr}")
return json.loads(result.stdout)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format", "-show_streams",
video_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"ffprobe failed: {result.stderr}")
return json.loads(result.stdout)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format", "-show_streams",
video_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"ffprobe failed: {result.stderr}")
return json.loads(result.stdout)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"-show_format", "-show_streams",
video_path
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"ffprobe failed: {result.stderr}")
return json.loads(result.stdout)
The module docstring says the script uses beat detection 'to synchronize video transitions with music rhythm', implying automated transition syncing. In practice, the code only analyzes audio and emits beat/peak metadata; the only video-sync function is unimplemented and does not perform transitions.
The docstring at L140 says this function will 'Create video synced to beats using FFmpeg', but all transition branches are placeholders with pass statements and no FFmpeg invocation occurs. The function instead prints that beat sync data was saved for manual use and returns True, which actively contradicts the documented behavior.
The manifest advertises 'captions' as part of the automatic editing pipeline, but the code only supports title and CTA text overlays. The build_filter_chain signature includes an add_captions parameter that is never used, and no subtitle/caption input, generation, or FFmpeg subtitle filter is present.
The FFmpeg command is built with the '-y' flag, which forces overwriting of the output file if it already exists. Although the script's purpose is rendering video, there is no confirmation prompt or explicit user-facing warning that an existing output file will be replaced automatically.
Although ffmpeg is also invoked via an argument list, this code builds the -vf filter string from untrusted title/cta values without escaping FFmpeg filter syntax. An attacker controlling these fields can break filter parsing or potentially trigger unintended FFmpeg behavior, creating a command-to-interpreter injection issue within FFmpeg's own mini-language even without shell=True.
if verbose:
print(f"Running: {' '.join(cmd)}")
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
print(f"FFmpeg error: {result.stderr}")
The script writes analysis results to the user-supplied or auto-derived output path using open(..., 'w'), which can overwrite an existing JSON file. Although writing output is part of the tool's purpose, there is no explicit warning or confirmation when an existing file may be replaced.
The comments explicitly describe a crop-based transformation, yet the FFmpeg filters create a split stream, blur a background layer, scale the foreground with aspect preservation, and overlay it centered. This is an active contradiction between implementation comments and actual behavior, not just missing detail.