Skip to main content

Practice · 2 of 3

Kill the Shell Injection

CHALLENGE
Difficulty: intermediate+25 XP

Implement build_ffmpeg_cmd(filename: str) returning the SAFE argv LIST form for converting a video: ['ffmpeg', '-i', filename, filename + '.mp4']. Then implement run_demo(filename) that would execute it via subprocess.run(cmd) WITHOUT shell=True and without any f-string in the command construction (graders check the source). Return the command list from build_ffmpeg_cmd.

Back to lesson: Practice: Security Audit Drills