subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
results = [] for event, entries in agent_hooks["hooks"].items(): command = entries[0]["hooks"][0]["command"] proc = subprocess.run( ["powershell.exe", "-NoProfile", "-Command", command], input=payload, text=True,- Confidence
- 93% confidence
- Finding
- The code builds a command string and runs it through `powershell.exe -Command`, which causes shell parsing of a dynamically constructed value. Although the wrapper path is locally generated, the command incorporates paths and script names influenced by configuration and environment, so malformed or attacker-controlled values can lead to command injection during validation.
