subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
async def action_shutdown(): """Shutdown the system.""" try: subprocess.Popen(["sudo", "shutdown", "-h", "now"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) return {"status": "ok", "message": "System is shutting down..."} except Exception as e: raise HTTPException(500, f"Failed to shutdown: {e}")- Confidence
- 99% confidence
- Finding
- subprocess.Popen(["sudo", "shutdown", "-h", "now"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
