subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
os.environ["LD_LIBRARY_PATH"] = "/tmp/evil/lib" # Execute with modified PATH subprocess.run(["helper"], shell=True)- Confidence
- 99% confidence
- Finding
- The code invokes `subprocess.run` with `shell=True` while also altering `PATH` and `LD_LIBRARY_PATH` immediately beforehand, making execution dependent on attacker-controlled command resolution and library loading. In this context, `helper` can be replaced by a malicious binary or influenced by injected shell behavior, enabling arbitrary code execution.
