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/configcan 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/configfile 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.allowwithext::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
-cflags 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.

