subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
tmpdir = Path(tempfile.mkdtemp(prefix="gh-extract-")) tmpdir.mkdir(parents=True, exist_ok=True) # work in tmpdir, let wget decide the file name subprocess.run(["wget", "--quiet", url], cwd=tmpdir) for path in tmpdir.glob("*"): # return the first file if path.is_file():- Confidence
- 93% confidence
- Finding
- subprocess.run(["wget", "--quiet", url], cwd=tmpdir)
