/

CVE-2026-26029

Severity:

HIGH RISK

(7.5)

Command Injection in sf-mcp-server Salesforce CLI

CVE-2026-26029

Awaiting Analysis

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

sf-mcp-server constructs Salesforce CLI commands using user-controlled input and passes them directly to child_process.exec, allowing shell metacharacters to be interpreted.

In environments where an attacker can influence these command arguments, this flaw can be used to execute arbitrary shell commands with the privileges of the MCP server process.

Affected context

This vulnerability affects deployments of sf-mcp-server that:

  • Expose Salesforce-related command functionality via MCP to clients (e.g., Claude for Desktop)
  • Build Salesforce CLI command strings from user-supplied or indirectly-controlled input
  • Execute those commands through child_process.exec or equivalent shell-invoking APIs

The risk is highest when the MCP server is reachable by untrusted or semi-trusted users and runs under a privileged account or on sensitive infrastructure.

Exploit preconditions

  • Attack surface: MCP server interface that accepts input used to construct Salesforce CLI commands.
  • Required access: Ability to issue requests or actions through the MCP interface that influence CLI parameters (e.g., org names, flags, target paths, or arbitrary argument fields).
  • Trigger point: Invocation of a Salesforce CLI command where user-controlled data is concatenated into a shell command string passed to child_process.exec.
  • Why exploitation is possible: The server does not properly sanitize or safely handle shell metacharacters, allowing user-controlled data to break out of intended arguments and inject additional commands.

Why this happens

The core bug is the use of child_process.exec with command strings constructed via string concatenation or interpolation that directly include user-controlled values.

Because exec invokes a shell, special characters (such as ;, &&, |, backticks, and others) are interpreted by the shell, turning data into executable syntax.

This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, where untrusted input is not properly constrained before being incorporated into a system command.

At an abstract level, the pattern is: user input → string-built shell command → shell execution, without robust argument separation, validation, or escaping.

Potential impact

  • Attackers could execute arbitrary shell commands with the privileges of the sf-mcp-server process.
  • Local files or environment variables (including credentials, API keys, or tokens) could be read or exfiltrated.
  • Additional software could be downloaded and executed, potentially establishing persistence or backdoors.
  • Data associated with Salesforce development workflows could be modified, corrupted, or deleted.
  • The host system could be used as a pivot point for further network compromise.

General mitigation guidance

Effective mitigation focuses on preventing untrusted input from being interpreted as shell syntax and reducing the impact of any command execution paths:

  • Prefer non-shell APIs such as child_process.execFile or spawn with argument arrays, so the shell is not invoked at all.
  • Avoid constructing command strings via concatenation; treat all user-influenced values as data, not as part of the command line.
  • Introduce strict input validation and allowlists for parameters (e.g., known command names, flags, and org identifiers), rejecting or normalizing unexpected characters.
  • Separate responsibilities so that only a minimal, well-audited subset of commands is exposed through the MCP server.
  • Run the MCP server with least privilege, restricting filesystem and network access to what is strictly necessary, and consider sandboxing or containerization to limit blast radius.
  • Centralize command-execution utilities in a small module that enforces safe patterns, making it easier to audit and maintain.

How teams detect issues like this

Detection is best approached through both code-centric and operational perspectives:

  • Static analysis: Configure rules to flag uses of child_process.exec, execSync, or similar APIs where arguments are derived from request parameters, MCP messages, or other user inputs.
  • Code review: Look for any string concatenation or template literals that build shell commands, especially around Salesforce CLI invocations and user-facing features.
  • Security testing: Use dynamic application security testing (DAST) or manual penetration testing to inject shell metacharacters in CLI-related parameters and observe unexpected behavior.
  • Logging and monitoring: Enable detailed logging for command execution paths and alert on anomalous or multi-part shell commands, unexpected utilities being invoked, or outbound network connections from the MCP server.
  • Automated code review tools and CI checks can enforce policies that prohibit unsafe shell invocation patterns and require safer alternatives.

Sources

SourceLink
github.comgithub.com/akutishevsky/sf-mcp-server/commit/99fba0171b8c22b5ee3c0405053ccfd2910a066d
github.comgithub.com/akutishevsky/sf-mcp-server/security/advisories/GHSA-h4w9-g9c5-vfwq

Frequently asked

questions

It can be remotely exploitable if the sf-mcp-server is accessible over a network or via an integration (such as Claude for Desktop) where untrusted or semi-trusted users can influence the command parameters. If only fully trusted users can interact with the server, the practical risk is reduced but not eliminated.

An attacker must be able to send inputs that the MCP server uses when building Salesforce CLI commands—for example, fields that specify target orgs, paths, or command options. They do not need direct shell access; the vulnerability allows them to turn application-level access into OS-level command execution.

The most robust fix is to eliminate shell invocation entirely for user-influenced commands by using APIs like execFile or spawn with argument arrays, combined with strict input validation and allowlists for valid parameters. This ensures user data cannot be interpreted as shell syntax.

Establish a guideline that any interaction with the operating system must treat user input as data only, never as part of a shell command. Enforce the use of safe process-spawning APIs, add static analysis rules for dangerous patterns, perform security-focused code reviews on integration layers (such as MCP servers), and apply least-privilege and sandboxing to limit damage if a flaw is introduced.

Find out what's already
exploitable in your codebase.