os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
"""提取音频到临时文件""" audio_path = os.path.join(temp_dir, f"{Path(video_path).stem}.wav") cmd = f'ffmpeg -y -i "{video_path}" -vn -acodec pcm_s16le -ar 16000 -ac 1 "{audio_path}" 2>/dev/null' os.system(cmd) return audio_path if os.path.exists(audio_path) else None- Confidence
- 98% confidence
- Finding
- The code builds a shell command with f-string interpolation of user-controlled paths and executes it with os.system(). Even though the paths are wrapped in double quotes, shell metacharacters such as embedded quotes can break out of the intended argument and lead to command injection, allowing arbitrary command execution under the user's privileges.
