/

CVE-2026-106764

Severity:

HIGH RISK

(7.5)

Code Injection (CWE-94) in @rog0x/mcp-git-tools Package

CVE-2026-106764

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code 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

A high-severity code injection vulnerability in @rog0x/mcp-git-tools 1.0.1 allows a remote attacker to execute arbitrary code through the resolveBaseBranch function.

The issue becomes risky when remotely supplied branch or repository-related input reaches a code execution path without sufficient validation or safe handling.

A high-severity code injection vulnerability in @rog0x/mcp-git-tools 1.0.1 allows a remote attacker to execute arbitrary code through the resolveBaseBranch function.

The issue becomes risky when remotely supplied branch or repository-related input reaches a code execution path without sufficient validation or safe handling.

Affected context

This issue affects deployments using @rog0x/mcp-git-tools 1.0.1 where the resolveBaseBranch function is exposed through a remotely reachable MCP or application interface.

Exploitation depends on attacker-controlled input being accepted by that function and processed in a way that permits code execution. The precise exposure depends on how the package is integrated, authenticated, and isolated.

This issue affects deployments using @rog0x/mcp-git-tools 1.0.1 where the resolveBaseBranch function is exposed through a remotely reachable MCP or application interface.

Exploitation depends on attacker-controlled input being accepted by that function and processed in a way that permits code execution. The precise exposure depends on how the package is integrated, authenticated, and isolated.

Exploit preconditions

  • Attack surface: A remotely reachable interface that invokes resolveBaseBranch
  • Required access: Ability to send requests or otherwise provide input to the exposed tool
  • Trigger point: Processing of attacker-controlled input by the branch-resolution function
  • Why exploitation is possible: Input reaches an unsafe execution-sensitive operation without adequate validation or separation from executable behavior
  • Attack surface: A remotely reachable interface that invokes resolveBaseBranch
  • Required access: Ability to send requests or otherwise provide input to the exposed tool
  • Trigger point: Processing of attacker-controlled input by the branch-resolution function
  • Why exploitation is possible: Input reaches an unsafe execution-sensitive operation without adequate validation or separation from executable behavior

Why this happens

The vulnerability is caused by an unsafe code-handling pattern in the resolveBaseBranch function, where externally influenced input can affect execution behavior.

This maps to CWE-94: Improper Control of Generation of Code ('Code Injection'). The underlying issue is treating data that should remain a branch or repository value as trusted input for an execution-capable operation, rather than constraining it to an explicitly allowed data format.

The vulnerability is caused by an unsafe code-handling pattern in the resolveBaseBranch function, where externally influenced input can affect execution behavior.

This maps to CWE-94: Improper Control of Generation of Code ('Code Injection'). The underlying issue is treating data that should remain a branch or repository value as trusted input for an execution-capable operation, rather than constraining it to an explicitly allowed data format.

Potential impact

  • An attacker may execute arbitrary code in the process hosting the tool
  • Application secrets and environment variables could be exposed
  • Repository contents may be modified, deleted, or exfiltrated
  • The attacker could gain access to connected services using the process's privileges
  • Additional systems could be affected if the runtime has excessive permissions
  • An attacker may execute arbitrary code in the process hosting the tool
  • Application secrets and environment variables could be exposed
  • Repository contents may be modified, deleted, or exfiltrated
  • The attacker could gain access to connected services using the process's privileges
  • Additional systems could be affected if the runtime has excessive permissions

General mitigation guidance

Mitigation generally focuses on ensuring branch and repository inputs remain data throughout processing.

Common defensive patterns include:

  • Replacing dynamic execution or evaluation with explicit, non-executable APIs
  • Applying allowlist-based validation for branch names and related identifiers
  • Separating input parsing from command or code construction
  • Avoiding shell interpretation when invoking Git or other external tools
  • Using structured process APIs with argument boundaries preserved
  • Limiting the tool's filesystem, network, repository, and operating-system privileges
  • Enforcing authentication and authorization around remotely exposed tool functions
  • Isolating the runtime so compromise does not automatically extend to other services

Mitigation generally focuses on ensuring branch and repository inputs remain data throughout processing.

Common defensive patterns include:

  • Replacing dynamic execution or evaluation with explicit, non-executable APIs
  • Applying allowlist-based validation for branch names and related identifiers
  • Separating input parsing from command or code construction
  • Avoiding shell interpretation when invoking Git or other external tools
  • Using structured process APIs with argument boundaries preserved
  • Limiting the tool's filesystem, network, repository, and operating-system privileges
  • Enforcing authentication and authorization around remotely exposed tool functions
  • Isolating the runtime so compromise does not automatically extend to other services

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving dynamic evaluation, shell construction, or execution APIs near resolveBaseBranch
  • Code-review changes that concatenate user-controlled branch or repository values into commands or executable expressions
  • Tests that submit malformed, unexpected, or metacharacter-containing branch identifiers
  • Runtime monitoring for unusual child-process creation, unexpected command interpreters, or access outside approved repositories
  • Policy checks requiring allowlisted branch formats and structured subprocess invocation

Automated code-review and application-security tools may help identify execution-sensitive data flows, but findings should be validated against the package's actual integration.

Organizations can look for:

  • Static-analysis findings involving dynamic evaluation, shell construction, or execution APIs near resolveBaseBranch
  • Code-review changes that concatenate user-controlled branch or repository values into commands or executable expressions
  • Tests that submit malformed, unexpected, or metacharacter-containing branch identifiers
  • Runtime monitoring for unusual child-process creation, unexpected command interpreters, or access outside approved repositories
  • Policy checks requiring allowlisted branch formats and structured subprocess invocation

Automated code-review and application-security tools may help identify execution-sensitive data flows, but findings should be validated against the package's actual integration.

Sources

SourceLink
github.comgithub.com/rog0x/mcp-git-tools/issues/1
stillosdigitalholdings.comstillosdigitalholdings.com/advisories/CVE-2026-106764.cve.json
npmjs.comnpmjs.com/package/@rog0x/mcp-git-tools

Frequently asked

questions

Yes, when the affected function is exposed through a remotely reachable interface and accepts attacker-controlled input. Actual exploitability depends on deployment and access controls.

Not necessarily. Authentication requirements are determined by the MCP or application layer exposing the function. Any account or integration permitted to invoke it may provide the relevant attack surface.

Keep branch and repository values as data, validate them against strict allowlists, and use structured Git or process APIs that do not interpret input as code or shell syntax.

Use least-privilege execution, isolate tool runtimes, add negative security tests for injection behavior, review execution-sensitive data flows, and enforce authorization and input-validation policies in CI.

Yes, when the affected function is exposed through a remotely reachable interface and accepts attacker-controlled input. Actual exploitability depends on deployment and access controls.

Not necessarily. Authentication requirements are determined by the MCP or application layer exposing the function. Any account or integration permitted to invoke it may provide the relevant attack surface.

Keep branch and repository values as data, validate them against strict allowlists, and use structured Git or process APIs that do not interpret input as code or shell syntax.

Use least-privilege execution, isolate tool runtimes, add negative security tests for injection behavior, review execution-sensitive data flows, and enforce authorization and input-validation policies in CI.

Find out what's already
exploitable in your codebase.