The vulnerability is a command injection weakness in the fastmcp Python library, specifically affecting Windows users of the fastmcp install cursor command. The core of the issue lies in the insecure handling of user-provided input, which is then used in a shell command.
The analysis of the security patch, commit 5f8461b7f0eec7c6af7d7d6d8b52db909b411244, reveals that the vulnerability was addressed by removing the shell=True argument from subprocess.run calls in the codebase.
The primary vulnerable function is open_deeplink located in src/fastmcp/cli/install/cursor.py. In its vulnerable state, this function would take a deeplink string, which included an un-sanitized server_name provided by the user, and execute it on Windows using subprocess.run with shell=True. This allowed an attacker to inject malicious shell commands into the server_name field, leading to arbitrary code execution. The patch remediates this by explicitly calling cmd /c start and removing the shell=True argument, thus preventing the shell from interpreting metacharacters in the deeplink.
Additionally, the patch includes preventative fixes in other functions, namely _get_npx_command and dev in src/fastmcp/cli/cli.py, where shell=True was also removed. While the advisory does not mention an exploit path through these functions, their modification indicates a proactive hardening effort to eliminate similar command injection risks throughout the application.