subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
src = Path(tempfile.gettempdir()) / "lo_socket_shim.c" src.write_text(_SHIM_SOURCE) subprocess.run( ["gcc", "-shared", "-fPIC", "-o", str(_SHIM_SO), str(src), "-ldl"], check=True, capture_output=True,- Confidence
- 93% confidence
- Finding
- The code compiles attacker-modifiable native code at runtime from a world-writable temporary directory and produces a shared object that is later injected into another process. In a DOCX-processing skill, compiling and loading arbitrary native code materially expands the attack surface and can enable local code execution or tampering if the temp files are raced, replaced, or reused across trust boundaries.
