/

CVE-2026-106059

Severity:

HIGH RISK

(8.8)

Command Injection (CWE-78) in GitAhead for macOS

CVE-2026-106059

Awaiting Analysis

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(8.8)

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

GitAhead for macOS contains a command injection flaw in the "Show in Finder" feature, where repository filenames are inserted into AppleScript without adequate escaping. If an attacker can cause a repository to contain a specially crafted filename and a victim opens that feature, shell commands may execute with the victim's privileges.

GitAhead for macOS contains a command injection flaw in the "Show in Finder" feature, where repository filenames are inserted into AppleScript without adequate escaping. If an attacker can cause a repository to contain a specially crafted filename and a victim opens that feature, shell commands may execute with the victim's privileges.

Affected context

The vulnerability occurs in GitAhead installations on macOS when the application generates AppleScript to reveal repository files in Finder. Risk is present when repository-controlled filenames are interpolated into the script without robust escaping and a user invokes the affected "Show in Finder" action.

The vulnerability occurs in GitAhead installations on macOS when the application generates AppleScript to reveal repository files in Finder. Risk is present when repository-controlled filenames are interpolated into the script without robust escaping and a user invokes the affected "Show in Finder" action.

Exploit preconditions

  • Attack surface: GitAhead's macOS "Show in Finder" functionality
  • Required access: Ability to introduce or commit a repository file with a crafted path
  • Trigger point: A victim selects the affected file or invokes the feature that generates the AppleScript
  • Why exploitation is possible: Repository-controlled filename content is incorporated into an AppleScript command without sufficient neutralization, allowing command syntax to escape its intended data context
  • Attack surface: GitAhead's macOS "Show in Finder" functionality
  • Required access: Ability to introduce or commit a repository file with a crafted path
  • Trigger point: A victim selects the affected file or invokes the feature that generates the AppleScript
  • Why exploitation is possible: Repository-controlled filename content is incorporated into an AppleScript command without sufficient neutralization, allowing command syntax to escape its intended data context

Why this happens

The underlying bug is improper neutralization of special elements in externally controlled input before that input is embedded in an interpreter command. In this case, a repository filename is inserted into AppleScript, where shell execution behavior can be invoked through the generated script. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because data is treated as executable command syntax.

The underlying bug is improper neutralization of special elements in externally controlled input before that input is embedded in an interpreter command. In this case, a repository filename is inserted into AppleScript, where shell execution behavior can be invoked through the generated script. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because data is treated as executable command syntax.

Potential impact

  • Arbitrary shell commands may execute as the victim user
  • Local files and repository contents could be read, modified, or deleted
  • Authentication material or other user data could be exposed
  • The attacker could alter development workspaces or establish persistence within the user account
  • Further compromise may be possible depending on the victim's permissions and system controls
  • Arbitrary shell commands may execute as the victim user
  • Local files and repository contents could be read, modified, or deleted
  • Authentication material or other user data could be exposed
  • The attacker could alter development workspaces or establish persistence within the user account
  • Further compromise may be possible depending on the victim's permissions and system controls

General mitigation guidance

Mitigation generally focuses on preventing repository-controlled values from becoming executable script or shell syntax.

Common defensive patterns include:

  • Avoiding shell or script construction when a native Finder or file-opening API is available
  • Passing paths through structured APIs rather than interpolating them into command text
  • Applying context-appropriate escaping and strict validation to filenames and paths
  • Treating repository metadata and filenames as untrusted input
  • Running desktop applications with the minimum available privileges
  • Restricting automation permissions and applying macOS privacy controls where practical
  • Adding security tests for filenames containing interpreter, quoting, and metacharacter syntax

Mitigation generally focuses on preventing repository-controlled values from becoming executable script or shell syntax.

Common defensive patterns include:

  • Avoiding shell or script construction when a native Finder or file-opening API is available
  • Passing paths through structured APIs rather than interpolating them into command text
  • Applying context-appropriate escaping and strict validation to filenames and paths
  • Treating repository metadata and filenames as untrusted input
  • Running desktop applications with the minimum available privileges
  • Restricting automation permissions and applying macOS privacy controls where practical
  • Adding security tests for filenames containing interpreter, quoting, and metacharacter syntax

How teams detect issues like this

Organizations can look for this vulnerability class through:

  • Static analysis rules identifying string interpolation into AppleScript, shell commands, or other interpreters
  • Code review checks for externally controlled filenames, paths, and repository metadata used in command construction
  • Tests using adversarial filenames to verify that generated scripts remain data-only
  • Policy enforcement requiring structured process and file APIs instead of dynamically assembled command strings
  • Endpoint monitoring for unexpected child processes launched by the Git client or its helper components

Automated security review tools may help identify command-construction patterns, but findings should be validated against the actual interpreter and data flow.

Organizations can look for this vulnerability class through:

  • Static analysis rules identifying string interpolation into AppleScript, shell commands, or other interpreters
  • Code review checks for externally controlled filenames, paths, and repository metadata used in command construction
  • Tests using adversarial filenames to verify that generated scripts remain data-only
  • Policy enforcement requiring structured process and file APIs instead of dynamically assembled command strings
  • Endpoint monitoring for unexpected child processes launched by the Git client or its helper components

Automated security review tools may help identify command-construction patterns, but findings should be validated against the actual interpreter and data flow.

Sources

SourceLink
github.comgithub.com/gitahead/gitahead
github.comgithub.com/gitahead/gitahead/blob/v2.7.1/src/tools/ShowTool.cpp#L40-L48
github.comgithub.com/gitahead/gitahead/issues/663
vulncheck.comvulncheck.com/advisories/gitahead-through-2.7.1-on-macos-command-injection-via-show-in-finder-applescript

Frequently asked

questions

It is generally not a direct network exploit. Exploitation depends on getting a crafted repository or filename into the victim's workflow and having the victim invoke the affected macOS feature.

An attacker typically needs a way to create or influence repository content, such as through a shared repository, contribution, or other distribution mechanism. The victim must then interact with the affected file or action.

The safest pattern is to avoid generating shell or AppleScript command text from filenames. Native, structured APIs should receive paths as data, with context-specific validation and escaping applied where scripting is unavoidable.

Treat filenames and repository metadata as untrusted, prohibit unreviewed command interpolation, test interpreter boundaries with adversarial inputs, and use least-privilege desktop application and automation permissions.

It is generally not a direct network exploit. Exploitation depends on getting a crafted repository or filename into the victim's workflow and having the victim invoke the affected macOS feature.

An attacker typically needs a way to create or influence repository content, such as through a shared repository, contribution, or other distribution mechanism. The victim must then interact with the affected file or action.

The safest pattern is to avoid generating shell or AppleScript command text from filenames. Native, structured APIs should receive paths as data, with context-specific validation and escaping applied where scripting is unavoidable.

Treat filenames and repository metadata as untrusted, prohibit unreviewed command interpolation, test interpreter boundaries with adversarial inputs, and use least-privilege desktop application and automation permissions.

Find out what's already
exploitable in your codebase.