subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: tmp_svg = svg_path + '.svg' shutil.copy2(svg_path, tmp_svg) result = subprocess.run( ['qlmanage', '-t', '-s', str(size), '-o', '/tmp/', tmp_svg], capture_output=True, text=True, timeout=15 )- Confidence
- 81% confidence
- Finding
- The code invokes qlmanage on a file derived from potentially untrusted SVG content and writes intermediate output into the shared /tmp directory. In this context, the bigger issue is unsafe temporary-file handling: predictable names in /tmp can enable symlink or file-clobbering attacks on multi-user systems, and qlmanage itself expands the attack surface by parsing attacker-supplied files through a system component.
