Oct 6, 2026·5 min read·32 visits
Omission of the VISUAL environment variable from the GitEnvKeys lookup registry allows an attacker-controlled VISUAL variable to bypass simple-git security checks, leading to arbitrary command execution when Git falls back to an interactive editor.
A critical security control bypass vulnerability exists in @simple-git/argv-parser before version 2.0.1. The package fails to map the VISUAL environment variable to the allowUnsafeEditor rule, allowing attackers who control environment parameters to execute arbitrary commands when Git triggers an interactive editor fallback.
The Node.js library simple-git provides a fluent interface for executing Git commands within Node.js applications. To maintain system security, the underlying argument parser @simple-git/argv-parser implements strict sanitization routines. These routines filter ambient and user-supplied environment variables to prevent command injection and unauthorized execution of binary files.
By default, interactive operations such as commit amendments or interactive rebases spawn a terminal-based text editor. To prevent malicious commands from being executed during this transition, the library checks relevant environment variables against the allowUnsafeEditor configuration. If allowUnsafeEditor is false, unsafe editor values are neutralized or blocked.
However, a critical vulnerability arose because the registry of tracked environment variables omitted the standard VISUAL variable. This omission allowed the environment variable to pass through the validation layer without validation. If an application forwards attacker-controlled environment variables to simple-git, an attacker can achieve arbitrary remote code execution.
The vulnerability exists due to an incomplete blocklist/allowlist structure within the file packages/argv-parser/src/env/parse-env.ts. The implementation maintains a registry named GitEnvKeys that maps environment variables to security restriction categories such as allowUnsafeEditor or allowUnsafePager. This mapping determines which variables must undergo security checks before command execution.
Git relies on a specific sequence of fallbacks to launch an interactive editor. It checks GIT_EDITOR first, followed by the git configuration core.editor, then VISUAL, and finally EDITOR. While GIT_EDITOR and EDITOR were mapped to allowUnsafeEditor in the package's configuration, the VISUAL variable was completely omitted from the list.
When a child process is spawned, simple-git constructs the runtime environment using prepareEnv. This function cleans the environment by stripping variables that do not start with a git prefix or are not explicitly defined in the GitEnvKeys dictionary. Because visual was absent from GitEnvKeys, the parser did not check its contents against the security rules. The variable was propagated to the spawned Git process unmodified, allowing the bypass of allowUnsafeEditor restrictions.
The root of the flaw is found in the definition of GitEnvKeys. Before the patch was applied, the mapping array registered keys representing editors and pagers, but completely missed the visual variable. This meant any security policy configured for safe editor execution was ineffective against payloads supplied through the VISUAL environment variable.
Below is the comparison of the vulnerable and patched code states in packages/argv-parser/src/env/parse-env.ts:
// Vulnerable Code State
const GitEnvKeys = {
'editor': 'allowUnsafeEditor',
'git_editor': 'allowUnsafeEditor',
'git_sequence_editor': 'allowUnsafeEditor',
'pager': 'allowUnsafePager',
'prefix': 'allowUnsafeConfigPaths',
'ssh_askpass': 'allowUnsafeAskPass',
} as const satisfies Record<string, VulnerabilityCategory>;The corresponding patch explicitly registers visual to map to the allowUnsafeEditor category:
// Patched Code State
const GitEnvKeys = {
'editor': 'allowUnsafeEditor',
'git_editor': 'allowUnsafeEditor',
'git_sequence_editor': 'allowUnsafeEditor',
'pager': 'allowUnsafePager',
'prefix': 'allowUnsafeConfigPaths',
'ssh_askpass': 'allowUnsafeAskPass',
'visual': 'allowUnsafeEditor', // Fix: Maps VISUAL to the editor safety category
} as const satisfies Record<string, VulnerabilityCategory>;This simple addition ensures that whenever a command block contains the VISUAL variable, the input value is subjected to validation against unsafe shell patterns and command segments.
An exploit targeting this vulnerability requires that a Node.js application accept user-influenced properties or environment variables and forward them to a simple-git instance. This occurs frequently in applications that accept external configuration blocks, environment payloads, or dynamically generated execution parameters.
To trigger the vulnerability, the attacker passes the VISUAL variable mapped to a malicious command sequence, such as a shell command downloader or a local payload writer. The application must also trigger an operation that requires Git to launch an interactive editor. Common interactive actions include running git commit --amend or initiation of an interactive rebase.
When the Git child process is invoked, it evaluates the environment. Finding that GIT_EDITOR is unset and the git config does not restrict it, Git accesses VISUAL and executes the command string directly in the shell. The execution takes place with the OS-level permissions of the running Node.js application process.
The consequence of this flaw is remote command execution under the privileges of the Node.js process. In cloud or containerized environments, this can lead to total system compromise, credential exfiltration from local environments, and lateral movement within the network.
According to CVSS v4.0 metrics, this vulnerability is scored at 9.2 (Critical). The high score reflects the potential for unauthenticated remote code execution, although the attack complexity is classified as high due to the requirement for specific application behaviors that forward untrusted environment variables.
Because the vulnerability exists in a core helper dependency of simple-git, its reach extends to any downstream application that relies on simple-git for managing git operations with user-supplied environment configurations. Security teams must identify and patch all instances immediately to mitigate risks.
The primary remediation strategy is upgrading the @simple-git/argv-parser package to version 2.0.1 or later. Alternatively, updating the consuming library simple-git to its latest version will pull in the resolved dependency automatically. This closes the control bypass by ensuring VISUAL is systematically checked.
If patching is not immediately feasible, developers must implement strict validation on environment variables passed to simple-git APIs. Manually deleting keys like VISUAL, EDITOR, and GIT_EDITOR from custom environment blocks before passing them to the .env() chain prevents injection vectors.
Additionally, applications can explicitly define a safe, static global variable for GIT_EDITOR (e.g., GIT_EDITOR=true or /usr/bin/true) in the environment or Git configuration. Because Git evaluates GIT_EDITOR before VISUAL, this blocks Git from ever falling back to the unvalidated VISUAL variable, rendering the bypass ineffective.
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
@simple-git/argv-parser simple-git | < 2.0.1 | 2.0.1 |
simple-git simple-git | < 4.0.2 | 4.0.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-78 / CWE-184 |
| Attack Vector | Network |
| CVSS v4.0 Score | 9.2 (Critical) |
| EPSS Score | 0.00275 (Percentile: 18.07%) |
| Impact | Unauthenticated Remote Code Execution |
| Exploit Status | Proof of Concept |
| KEV Status | Not Listed |
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') and Incomplete List of Disallowed Inputs
A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.
A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.
CVE-2026-12411 is a broken access control vulnerability in the DevLXD interface of Canonical LXD versions 6.6 through 6.8. The flaw resides in the devLXDInstancePatchHandler component, which fails to verify storage volume ownership when an instance attaches a new disk device via the /dev/lxd guest socket. When the security.devlxd.management.volumes configuration option is enabled, an untrusted guest or DevLXD identity can issue a crafted HTTP PATCH request referencing another tenant's custom storage volume. The LXD host daemon subsequently mounts the target volume into the requesting guest, permitting unauthorized cross-tenant read and write operations.
CVE-2026-105769 (GHSA-5q7h-w9jf-cx97, GO-2026-6225) is an origin validation error and credential exfiltration vulnerability affecting Kaniko prior to version 1.25.20. The flaw stems from an unanchored regular expression in the integrated Azure Container Registry (ACR) credential helper (github.com/chrismellard/docker-credential-acr-env). When Kaniko processes a Dockerfile containing an image reference hosted on a lookalike domain containing an ACR suffix as a substring (e.g., x.azurecr.io.attacker.com), the credential helper acquires a Microsoft Entra ID access token for Azure Resource Manager and transmits it via HTTP POST to the attacker-controlled host.
CVE-2026-62300 is an uncontrolled resource consumption vulnerability (CWE-400) affecting the daemon mode of filecoin-pin in versions up to and including 1.1.0. The daemon implements the IPFS Pinning Service API to store content on Filecoin's Proof of Data Possession (PDP) service. Due to the absence of rate limits, concurrency caps, execution timeouts, and Directed Acyclic Graph (DAG) traversal limits, an authenticated user—or an unauthenticated user when authentication is disabled—can exhaust system resources via crafted POST /pins requests.
CVE-2026-61536 is a high-severity Remote Code Execution (RCE) vulnerability in the masci/banks Python library prior to version 2.4.3. The flaw exists within the CompletionExtension component, which parses JSON-serialized Tool definitions directly from rendered Jinja template bodies inside {% completion %} blocks. When handling tool calls returned by an LLM, the library dynamically resolves the target callable using importlib.import_module() and getattr() based on an unvalidated import_path string. An attacker who can supply or modify prompt templates can inject a malicious Tool JSON object pointing to arbitrary Python functions (such as os.system), bypassing the Jinja SandboxedEnvironment introduced in version 2.4.2 and achieving arbitrary code execution when the LLM invokes the tool.