CVE-2026-57860

ForgeCode Arbitrary Code Execution via Unvetted .mcp.json in Untrusted Repository

Published Jul 17, 2026 CVSS 4.0 · 8.4 High EPSS < 1% KEV · Not listed
Description
ForgeCode (tailcallhq/forgecode), an AI pair-programming CLI, automatically loads and executes the MCP servers defined in a repository's .mcp.json file on startup without user confirmation. A malicious repository can supply a crafted .mcp.json whose mcpServers entries specify arbitrary command and args values (for example, command: bash with args: ['-c', 'touch /tmp/pwned']). When a user runs the forge CLI inside a cloned untrusted repository, the specified commands are spawned with the invoking user's privileges, resulting in arbitrary code execution. This provides a reliable initial-access and persistence primitive against developers who evaluate untrusted repositories with ForgeCode.

Analysis

AI-generated

Technical impact

ForgeCode automatically loads and executes the MCP servers defined in a repository's .mcp.json file when the CLI starts, without prompting the user. This flaw, identified as CWE-829, allows an attacker to craft the mcpServers entries to include arbitrary command and argument values, which are then spawned as processes with the invoking user's privileges. This enables an attacker to run arbitrary code on the local machine, providing high‑severity compromise and persistence for developers evaluating untrusted repositories.

Affected Systems

The vulnerability affects the TailcallHQ ForgeCode AI pair‑programming CLI. No specific product version information was provided; the issue applies to the current codebase in the GitHub repository.

Risk and Exploitability

The CVSS score of 8.4 rates this flaw as high severity. The EPSS score of less than 1% indicates a low but non‑zero probability of exploitation in the wild. It is not listed in the CISA KEV catalog. The likely vector is inferred to be a local attacker who runs ForgeCode inside a cloned untrusted repository; no network‑based attack is described. Exploitation requires the user to execute the command line tool, and thus the impact is limited to systems where the tool is run but can be catastrophic given its arbitrary execution capability.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to the latest ForgeCode release that includes the fix available at the commit referenced in the advisory or later.
  • If upgrading is not possible, disable automatic loading of .mcp.json by setting an environment variable such as FORGECODE_DISABLE_AUTOLOAD=true or editing the configuration to prevent execution of external MCP servers.
  • Verify that the local repository does not contain malicious or untrusted .mcp.json files by manually inspecting the file or using a linting tool before running ForgeCode.

Generated by OpenCVE AI on August 3, 2026 at 02:45 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Tailcallhq
Tailcallhq forgecode
Vendors & Products Tailcallhq
Tailcallhq forgecode
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description ForgeCode (tailcallhq/forgecode), an AI pair-programming CLI, automatically loads and executes the MCP servers defined in a repository's .mcp.json file on startup without user confirmation. A malicious repository can supply a crafted .mcp.json whose mcpServers entries specify arbitrary command and args values (for example, command: bash with args: ['-c', 'touch /tmp/pwned']). When a user runs the forge CLI inside a cloned untrusted repository, the specified commands are spawned with the invoking user's privileges, resulting in arbitrary code execution. This provides a reliable initial-access and persistence primitive against developers who evaluate untrusted repositories with ForgeCode.
Title ForgeCode Arbitrary Code Execution via Unvetted .mcp.json in Untrusted Repository
Weaknesses CWE-829
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.4, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-829

    Inclusion of Functionality from Untrusted Control Sphere

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Jul 20, 2026, 5:45 PM
Reserved
Jun 25, 2026, 6:48 PM
Status
Deferred
Published
Jul 17, 2026, 5:17 PM
Modified
Oct 24, 2026, 8:10 PM