T09 · Insecure Skill Coding Practices
- Location
scripts/render_cuts.py:20- Finding
Unvalidated EDL Values Allow FFmpeg Filter-Graph Injection in the Hard-Cut Renderer
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a local multicam video editor, but it needs Review because crafted edit-plan files can be fed into FFmpeg without enough validation.
Use this only with EDL files you generated yourself from trusted media, or after validating the JSON fields and bounds. Avoid rendering EDLs from other people in an unrestricted environment, and keep backups because FFmpeg runs with overwrite enabled for the chosen output path.
scripts/render_cuts.py:20Unvalidated EDL Values Allow FFmpeg Filter-Graph Injection in the Hard-Cut Renderer
scripts/render_pip.py:84Unvalidated EDL Values Allow FFmpeg Filter-Graph Injection in the PiP Renderer
The core behavior broadly aligns with multicam auto-editing from synced recordings using audio energy and sidecar timing data. However, the declared description overstates the delivered functionality in material ways. This script performs analysis and edit decision generation only: it extracts audio, computes envelopes, aligns them by sidecar offsets, selects camera segments, and writes an EDL JSON file. There is no code here to render or mux a final combined MP4, and no picture-in-picture overlay implementation. Those are significant user-visible capability gaps rather than minor implementation details, so this should be flagged as a mismatch.
The declared description presents this skill as an end-to-end multicam auto-editing tool that ingests multiple synced recordings and combines them by automatically selecting cameras based on audio energy, optionally with PiP. The supplied code chunk only renders a previously generated edit decision list (EDL) into an MP4. It performs trimming, scaling, padding, concatenation, and audio trimming via ffmpeg. The docstring explicitly states 'Hard cuts only (no transitions / no PiP),' and there is no logic for analyzing audio energy or choosing camera switches. Therefore, the code's actual behavior is materially narrower and different from the declared primary purpose.
The skill describes capabilities that read and write files and invoke shell-based tooling like ffmpeg, but it does not declare any explicit tool scope or permissions boundary. In an agent environment, that omission can cause over-broad tool access, making it easier for the skill to operate on unintended files or execute commands beyond its stated purpose.
The documentation says each input must have a .sync.json sidecar, but the implementation silently falls back to delta=0 and full coverage when sidecars are missing or malformed. In this editing context, that can cause misaligned timelines and incorrect camera selection without failing fast, producing deceptive or materially wrong output from untrusted or incomplete inputs.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
SCHEMA_VERSION = 1
def extract(video: Path, dst: Path):
subprocess.run(["ffmpeg", "-nostdin", "-y", "-i", str(video),
"-map", "0:a:0", "-ac", "1", "-ar", str(SR),
"-f", "s16le", str(dst)], check=True, stderr=subprocess.DEVNULL)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
str(args.out),
])
print(" ".join(cmd))
subprocess.run(cmd, check=True)
if __name__ == "__main__":
main()
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
str(args.out),
])
print(" ".join(cmd))
subprocess.run(cmd, check=True)
if __name__ == "__main__":
main()
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
str(args.out),
])
print(" ".join(cmd))
subprocess.run(cmd, check=True)
if __name__ == "__main__":
main()