/

CVE-2026-49959

Severity:

HIGH RISK

(8.8)

Command Injection (CWE-78) via Git config in Hermes WebUI

CVE-2026-49959

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

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

Hermes WebUI before 0.51.311 contains a command injection flaw where Git subprocesses honor attacker-controlled configuration from a workspace repository's .git/config.

An authenticated attacker who can push or write malicious Git configuration entries can trigger arbitrary command execution on the host whenever the application runs Git operations such as status or fetch.

Affected context

This vulnerability manifests in deployments of Hermes WebUI that:

  • Use Git-backed workspaces where repository contents influence server-side Git operations
  • Allow authenticated users to create, import, or update repositories whose .git/config can be modified
  • Invoke Git commands (e.g., status, fetch) from the server process using inherited environment and repository-local configuration

Under these conditions, values in .git/config and related Git environment variables can shape how Git subprocesses are executed, enabling embedded shell commands to run on the host.

Exploit preconditions

  • Attack surface: Server-side Git operations invoked by Hermes WebUI (e.g., git status, git fetch).
  • Required access: Authenticated access with the ability to introduce or modify a workspace repository, including its .git/config file or equivalent Git settings.
  • Trigger point: Any server-initiated Git command executed against the malicious repository, such as status checks, fetch/pull operations, or credential handling flows.
  • Why exploitation is possible: Hermes WebUI launches Git subprocesses that fully honor repository-local configuration options and inherited environment variables (e.g., core.fsmonitor, protocol.ext.allow with ext:: remotes, credential.helper, core.askPass, core.gitProxy, GIT_SSH_COMMAND). These hooks can cause Git to invoke arbitrary external programs, which run with the privileges of the application host.

Why this happens

The root cause is the uncritical delegation of behavior to Git subprocesses whose configuration is partially controlled by workspace repositories.

By trusting .git/config and environment variables, the application permits untrusted inputs to influence which external programs are executed and with what arguments, effectively creating a command injection channel.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because user-influenced configuration is allowed to drive OS-level command execution without appropriate validation, sandboxing, or restriction to a safe subset of Git features.

Potential impact

  • Remote execution of arbitrary commands on the host running Hermes WebUI
  • Access or exfiltration of sensitive data accessible to the application process
  • Modification or destruction of application data and workspace contents
  • Lateral movement within the hosting environment or internal network
  • Use of the compromised host as a pivot for further attacks or persistence

General mitigation guidance

Effective mitigation typically focuses on restricting the influence of untrusted Git configuration and hardening how Git subprocesses are used:

  • Limit or disable Git configuration features that launch external programs (e.g., protocol ext::, credential helpers, core.fsmonitor, core.askPass, proxies) when operating on server-managed repositories.
  • Execute Git commands in a tightly controlled environment where only a predefined, safe configuration is honored (e.g., using -c flags or sanitized config files instead of repository-local .git/config).
  • Avoid inheriting sensitive or execution-capable environment variables from the web application process (GIT_SSH_COMMAND, GIT_EXEC_PATH, proxy settings) when launching Git.
  • Run Git subprocesses under a dedicated, minimally privileged account and, where possible, within additional isolation boundaries such as containers, chroots, or sandboxes.
  • Treat all repository content, including .git/config, as untrusted input and apply a default-deny approach to features that can spawn external processes.

How teams detect issues like this

Organizations can detect this class of vulnerability through:

  • Static analysis or manual code review focused on subprocess invocation patterns, especially wrappers around Git that allow repository-local configuration or unfiltered environment inheritance.
  • Security reviews that enumerate all Git-related hooks and configuration keys (credential.helper, core.fsmonitor, protocol.ext.*, core.gitProxy, core.askPass) and verify they cannot be influenced by untrusted repositories.
  • Runtime monitoring of the application host for unexpected child processes spawned from Git or the web application user, particularly interpreters (e.g., shells, Python, PowerShell) or network tools.
  • Centralized logging of Git command invocations and arguments, combined with anomaly detection to flag unusual helper executables or command lines.
  • Use of automated security testing tools and policies that flag server-side use of VCS tools where untrusted repositories can affect configuration-driven execution paths.

Sources

SourceLink
github.comgithub.com/nesquena/hermes-webui/commit/938ac9f55b53def1eefb48c4c42dabaf9c22e99c
github.comgithub.com/nesquena/hermes-webui/pull/3776
github.comgithub.com/nesquena/hermes-webui/releases/tag/v0.51.311
vulncheck.comvulncheck.com/advisories/hermes-webui-rce-via-git-configuration-injection

Frequently asked

questions

Yes. Any attacker who can authenticate to Hermes WebUI and gain control over a workspace repository (for example by importing or pushing to it) may be able to exploit this issue via normal web interactions, without direct shell access to the host.

The attacker must have authenticated access sufficient to add or modify repositories whose .git/config is used by server-side Git operations. Anonymous users generally cannot exploit it unless the deployment explicitly allows unauthenticated repository control.

The most robust approach is to decouple server-side Git subprocess behavior from untrusted repository configuration: run Git with a controlled configuration set, strip or override dangerous options, and prevent Git from invoking external helpers or ext:: protocols in this context.

When integrating tools like Git, treat all repository and configuration data as untrusted. Avoid allowing user-controlled configuration to affect executable paths, sanitize or ignore features that spawn external programs, enforce least privilege and isolation for subprocesses, and include these patterns in secure code review and design checklists.

Find out what's already
exploitable in your codebase.