Описание
figma-developer-mcp vulnerable to command injection in get_figma_data tool
Summary
A command injection vulnerability exists in the figma-developer-mcp MCP Server. The vulnerability is caused by the unsanitized use of input parameters within a call to child_process.exec, enabling an attacker to inject arbitrary system commands. Successful exploitation can lead to remote code execution under the server process's privileges.
The server constructs and executes shell commands using unvalidated user input directly within command-line strings. This introduces the possibility of shell metacharacter injection (|, >, &&, etc.).
Details
The MCP Server exposes tools to perform several figma operations. An MCP Client can be instructed to execute additional actions for example via indirect prompt injection that can lead to command injection by calling vulnerable tools with malicious inputs. Below some example of vulnerable code and different ways to test this vulnerability.
Vulnerable code
The following snippet illustrates the vulnerable code pattern used in the MCP Server’s tooling.
Using MCP Client IDE
- Verify the file
/tmp/TEST1 does not exist:
- setup your client IDE
- open the chat and enter the following prompt:
- run the
get_figma_datatool
- Confirm that the injected command executed:
Using MCP Inspector
- Open the MCP Inspector:
-
In MCP Inspector:
- set transport type:
STDIO - set the
commandtonpx - set the arguments to
figma-developer-mcp --stdio - set the
FIGMA_API_KEYenv variable (i.eTEST) - click Connect
- go to the Tools tab and click List Tools
- select the
get_figma_datatool
- set transport type:
-
Verify the file
/tmp/TESTdoes not exist:
- In the fileKey field, input:
- Click Run Tool
- Observe the request being sent:
Output:
Logs:
- Confirm that the injected command executed:
Remediation
To mitigate this vulnerability, I suggest to avoid using child_process.exec with untrusted input. Instead, use a safer API such as child_process.execFile, which allows you to pass arguments as a separate array — avoiding shell interpretation entirely.
NOTE: This mitigation—and others like input validation—have been implemented in versions 0.6.3 and above. To fix the issue, make sure you're using a version >=0.6.3.
Impact
Command Injection / Remote Code Execution (RCE)
Пакеты
figma-developer-mcp
<= 0.6.2
0.6.3
Связанные уязвимости
Framelink Figma MCP Server before 0.6.3 allows an unauthenticated remote attacker to execute arbitrary operating system commands via a crafted HTTP POST request with shell metacharacters in input that is used by a fetchWithRetry curl command. The vulnerable endpoint fails to properly sanitize user-supplied input, enabling the attacker to inject malicious commands that are executed with the privileges of the MCP process. Exploitation requires network access to the MCP interface.
Уязвимость MCP- сервера Framelink Figma MCP Server, связанная с использованием незащищенного альтернативного канала, позволяющая нарушителю выполнить произвольные команды