You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inputs path and opt_format_path are directly concatenated into a shell command without any sanitization or validation. If a malicious user is able to influence the content of either path or opt_format_path, they could inject arbitrary shell commands, leading to remote code execution (RCE).
📌 Description
The following line of code is vulnerable to command injection:
The inputs
path
andopt_format_path
are directly concatenated into a shell command without any sanitization or validation. If a malicious user is able to influence the content of eitherpath
oropt_format_path
, they could inject arbitrary shell commands, leading to remote code execution (RCE).✅ Proof of Concept
If
path
is set to a malicious input like:The constructed command would become:
ffmpeg -i input.wav; rm -rf /important_data -vn output.wav -q:a 2 -y
Which would execute the destructive
rm -rf
command.🔧 Recommendation
Avoid using
os.system()
with unsanitized inputs. Use thesubprocess
module with argument lists to avoid shell injection:This ensures each argument is passed safely, regardless of its content.
The text was updated successfully, but these errors were encountered: