Summary
A critical command injection vulnerability in Semaphore UI allows a project Manager or Owner to influence a Git option used during repository processing. Under affected configurations, this may cause the Semaphore server process to execute arbitrary operating system commands.
Affected context
The issue occurs in Semaphore UI repository handling when a user-controlled git_url value is passed into Git client logic. It can be triggered through repository-management requests or scheduled commit-hash polling when the caller has project Manager or Owner privileges and the affected command construction path is available.
Exploit preconditions
- Attack surface: Semaphore UI repository-management API and scheduled repository polling
- Required access: Project Manager or Owner privileges
- Trigger point: Repository creation or update, and subsequent commit-hash retrieval
- Why exploitation is possible: Attacker-controlled repository data influences a Git command option without sufficient separation between data and command arguments
Why this happens
The vulnerability results from constructing or invoking a Git command with attacker-controlled input that can alter the command's option behavior. In particular, untrusted repository URL handling reaches the --upload-pack option, allowing command syntax to escape its intended data-only role. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') also describing the unsafe argument-boundary handling.
Potential impact
- An attacker may execute arbitrary OS commands in the Semaphore server process
- The application process and its accessible credentials may be compromised
- Managed repositories, deployment workflows, or stored secrets could be altered or exposed
- The server could be used for lateral movement or additional infrastructure compromise
General mitigation guidance
Mitigation generally focuses on ensuring that repository metadata remains data rather than executable command content.
Common defensive patterns include:
- Invoke Git through structured argument APIs that preserve argument boundaries
- Reject or canonicalize unexpected repository URL and option values using an allowlist
- Avoid passing user-controlled values into command-option parameters
- Apply strict authorization and minimize project-management privileges
- Run the Semaphore service with least-privilege OS credentials and restricted filesystem and network access
- Isolate repository-processing workloads from sensitive control-plane resources
How teams detect issues like this
Organizations can look for:
- Static-analysis findings involving shell execution, command construction, or concatenation of repository-controlled values
- Code-review signals where URLs or repository metadata flow into Git option parameters
- Runtime logs showing unusual repository URLs, unexpected
upload-packvalues, or anomalous child-process execution - Policy checks requiring structured process APIs, argument allowlists, and non-shell execution
Automated code-review and software-composition security tools may help identify related command-injection patterns, but behavioral monitoring remains useful for detecting exploitation attempts.

